Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 816
» Latest member: w88malay
» Forum threads: 44
» Forum posts: 108

Full Statistics

Online Users
There are currently 20 online users.
» 0 Member(s) | 20 Guest(s)

Latest Threads
Delayed Signals
Forum: Documentation
Last Post: admin
Yesterday, 03:01 PM
» Replies: 0
» Views: 10
tracking individual strat...
Forum: Feature Requests
Last Post: ivanf
06-09-2021, 09:47 PM
» Replies: 8
» Views: 1,673
Get last used Trade ID fr...
Forum: Feature Requests
Last Post: patelgopesh
06-01-2021, 06:46 AM
» Replies: 2
» Views: 57
Tips and Tricks (Miscella...
Forum: Documentation
Last Post: admin
05-25-2021, 11:03 AM
» Replies: 0
» Views: 157
Strategies
Forum: Documentation
Last Post: admin
05-21-2021, 09:34 AM
» Replies: 2
» Views: 1,804
Custom Stop and Target Or...
Forum: Documentation
Last Post: admin
05-12-2021, 03:00 PM
» Replies: 0
» Views: 174
Features Roadmap
Forum: Feature Requests
Last Post: EbertM
04-28-2021, 07:00 AM
» Replies: 2
» Views: 381
broker support
Forum: Feature Requests
Last Post: admin
03-25-2021, 09:04 AM
» Replies: 1
» Views: 246
trade metrics
Forum: Feature Requests
Last Post: admin
03-25-2021, 09:02 AM
» Replies: 1
» Views: 202
Some comments and request...
Forum: Feature Requests
Last Post: admin
03-16-2021, 05:11 PM
» Replies: 1
» Views: 259

 
  LIT orders
Posted by: ivanf - 06-29-2020, 06:22 AM - Forum: Feature Requests - Replies (1)

I would like to see support for Limit if Touched orders ( LIT) 

This  especially important for IB non margin accounts so users can queue  more orders than available slots in the account. ( which is a real problem with using LIMIT orders)

Here is Australia most retail investors do not have access to IB margin due to govt restrictions placed on IB

Print this item

  support for CFD
Posted by: ivanf - 06-26-2020, 08:10 AM - Forum: General Discussion - No Replies

HI, I trade CFD's with IB, does Alera support CFD's as an instrument ?

Print this item

  Futures on Alera
Posted by: robx - 05-08-2020, 02:28 PM - Forum: Feature Requests - Replies (2)

Hi, Are there US Futures scheduled for using with Alera in next versions? It would be nice to trade them with AmiBroker strategies.

Print this item

  Trail Stop
Posted by: robx - 05-08-2020, 07:57 AM - Forum: Feature Requests - Replies (2)

Hi, it would be nice to define Trail Stop in Points or Ticks, not just Percentage. This can be useful when dealing with Chandelier Stops or when the amount is defined adaptatively on the AMI Strategy wich often occurs on Swing or Intraday Strategies.

Print this item

  Using Google Drive for Signals
Posted by: admin - 04-19-2020, 05:51 PM - Forum: Documentation - No Replies

Using Google Drive for Signals
You can connect APM to your Google Drive to pull signals from a specified folder.

  • Find or create the folder in Google Drive that will store the signals
  • Open the folder in your browser and copy the Folder Id from the URL (it is the last part of the URL, should look like in the image below)
  • Paste this Folder Id into the settings page and click Save
  • The first time you do this, you will be redirected to your browser in order to login into your Google account
  • Allow Alera to have readonly access to your Google Drive. You may want to create a new Google account just to use with APM.
  • If you gave a correct Folder Id, then the settings will save, otherwise you will see an error in APM
  • To test that everything is working, place a signal file in the Google Drive folder and hit the folder button beside the Folder ID to view your files (or hit Order Preview)

[Image: google_drive_example2.png]


Posting Your Signals
There are two main ways to post your signals to Google Drive

Backup and Sync
Use Google Backup and Sync to sync a local folder on your computer to your Google Drive. You can then write signals to this folder and they will automatically be uploaded to your Drive. Note that Backup and Sync only recognizes file changes WHEN the file contents change. This means the last modified time on your file will not update when you change it locally on your computer, unless you change the file contents too. You can change file contents without modifying signals by adding a blank new line to the file.

Google Drive API
If you're familiar with programming, you can attempt to upload files to your Drive directly through your code.

*IMPORTANT*
Google Drive only stores the last modified time up to one second accuracy AND since signal files are processed in the order of OLDEST to NEWEST, you need to make sure that your files are generated 2 seconds apart to ensure that they are processed in the desired order, e.g. process sell signals first, then buy signals. If you do not care about the order of your signals, then the last modified time does not matter.


Sharing Your Signals
Simply share your Google Drive folder with the desired party and have them use the same Folder ID in their APM instance.

Print this item

  Alera API
Posted by: admin - 04-14-2020, 10:58 AM - Forum: Documentation - No Replies

Alera API
This guide explains how the Alera API works and how you can use it.
Available with APM version 2.1.0+

The Alera API allows you to:

  • Send signals directly to the APM signal queue for immediate processing
  • Retrieve account and strategy settings programmatically
  • Retrieve current portfolio, order and trade information on a strategy by strategy basis
All of this is achieved through an HTTP endpoint.



HTTP Endpoints
All end-points are prefixed with http://localhost:<port>/api where <port> is the API Port set up in the account setting page. Don't forget to actually enable the API (it is not available with gold licenses). We've also gone ahead and prevented any traffic to the API from a non-local IP. This means you should only be accessing the API from the same computer that the APM runs on.

Port 7425 is the default port and will be used throughout this document. Please make sure that you select a different port for each account when enabling the API for multiple accounts and that you are connected to the proper account.

Type URL Description
POST api/strategies/<id> Add multiple signals to the queue
POST api/strategies/<id>?cmd=run Run this strategy
GET api/account Get the account settings
GET api/strategies Get the settings for all strategies
GET api/strategies/<id> Get the settings a specific strategy
GET api/strategies/<id>/portfolio/<format> Get the portfolio for a strategy as text or json
GET api/strategies/<id>/orders/<format> Get the orders for a strategy as text or json
GET api/strategies/<id>/trades/<format> Get the trades for a strategy as text or json
GET api/strategies/<id>/reenter/<format> Get the ReEnter orders for a strategy as text or json
GET api/strategies/<id>/stats Get some statistics for a strategy
GET api/strategies/<id>/symbols Get a list of symbols assigned to the strategy by the APM



HTTP POST Requests

Strategies
This call allows the http client to send signals directly to APM for immediate processing. It requires the account to be running.

Signals
Endpointhttp://localhost:7425/api/strategies/<id>
Parameters:
  • Header:
    • Content-Type: application/json
  • Body:
    • Key: “signals”
    • Value: A string containing multiple lines with the same format as the flat signal files (i.e. each line contains one signal. Comments are allowed). Invalid signals will be ignored. No csv formatting supported at this time.
The response will be a list that contains only the signals with a valid format that were sent to the signal queue. The execution can be monitored via the  log tab.

Example
URL: http://localhost:7425/api/strategies/1002
Header: Content-Type: application/json
Body:{"signals":"
    # This is just a comment
    BTO SPY
    LONG IVV 20 %position
    SHORT DELL 100 shares LMT 45
"}

Response:
BTO SPY
LONG IVV 20 %POSITION
SHORT DELL 100 SHARES LMT 45

Run Strategy
Endpointhttp://localhost:7425/api/strategies/<id>?cmd=run
Parameters: None

http://localhost:7425/api/strategies/1011?cmd=run


HTTP GET Requests

Account
This call returns the account settings that were setup in the APM user interface.

Endpointhttp://localhost:7425/api/account
Parameters: NONE

Strategies
This call returns information regarding the strategies setup in the APM user interface.
Any call to a specific strategy requires the account to be running.

Endpointhttp://localhost:7425/api/strategies
Parameters:
  • Id:
    • This is the strategyId of the strategy you wish to query. Usually a 4 digit number (e.g. 1002)
    • If no strategy with this id exists, the call returns Bad Request and an error message
  • Info:
    • This parameter is used to specify the type of information that is requested for a specific strategy
    • The following values are valid:
      • Portfolio - returns the current portfolio
      • Orders  - returns all active orders. This includes the Stop and Target orders. The ReEnter orders are not listed here as they are not active in the market.
      • ReEnter - returns all ReEnter orders
      • Trades  - returns the trades executed in the last 24 hours
      • Stats    - returns the strategy statistics
      • Symbols - return a list of symbols assigned to the strategy (you do not necessarily hold positions for assigned symbols)
  • Format:
    • The response for Portfolio, Orders, ReEnter, Trades can be requested in two different formats (optional: default Text)
      • JSON - returns a list of JSON formatted objects
      • Text - returns a nicely formatted string (use this for displaying info)
    • The response for Symbols, Stats come in JSON format (see examples below)

If no parameters are specified, the GET request returns settings information for all strategies.


GET Examples

Settings
http://localhost:7425/api/account
http://localhost:7425/api/strategies
The outputs for these are not specified here since there are a lot of settings.
If you want to use this information, we suggest you look at the output yourself and determine what information you might want to use.


Orders
URL:  http://localhost:7425/api/strategies/1002/orders
Response:
[
  {
    "Symbol": "QQQ",
    "Currency": "USD",
    "Country": "US",
    "Action": "SELL",
    "Type": "TGT",
    "Quantity": 100.0,
    "TimeInForce": "GTC",
    "LimitPrice": null,
    "StopPrice": null,
    "TargetPrice": 215.5,
    "TrailingPercent": null
  },
  {
    "Symbol": "QQQ",
    "Currency": "USD",
    "Country": "US",
    "Action": "SELL",
    "Type": "STP",
    "Quantity": 100.0,
    "TimeInForce": "GTC",
    "LimitPrice": null,
    "StopPrice": 195.36,
    "TargetPrice": null,
    "TrailingPercent": null
  },
]

Code:
URL: http://localhost:7425/api/strategies/1002/orders/text

Response:
 ORDERS    Action   Quantity   Type    Limit       %    TIF       ID
-------------------------------------------------------------------
  1.   QQQ   SELL        100    TGT   215.50            GTC
  2.   QQQ   SELL        100    STP   195.36            GTC
  3.  SVXY   SELL        917    MKT                     DAY
  4.   TLT   SELL      1,000    STP   160.47            GTC
  5.   TLT   SELL      1,000    TGT   177.01            GTC
  6.   TLT   SELL      1,018    LOC   100.00            DAY
  7.  TSLA    BUY         80    TGT   551.95            GTC
  8.  TSLA    BUY         80    STP   611.31            GTC
  9.  TSLA    BUY         49    MKT                     DAY
 10.   USD    BUY        370    MKT                     DAY
-------------------------------------------------------------------
The following two URLs also produce the above result:
http://localhost:7425/api/strategies/1002/orders
http://localhost:7425/api/strategies?id=1002&info=orders&format=text


ReEnter Orders
The responses to these requests are the same as regular order requests:
http://localhost:7425/api/strategies/1002/reenter
http://localhost:7425/api/strategies/1002/reenter/json
http://localhost:7425/api/strategies/1002/reenter/text


Portfolio
URL: http://localhost:7425/api/strategies/1002/portfolio

Response:
[
  {
    "Symbol": "QQQ",
    "Currency": "USD",
    "Country": "US",
    "Quantity": 100.0,
    "Exposure": "LONG",
    "MarketPrice": 201.3999939,
    "MarketValue": 20140.0,
    "AverageCost": 216.555,
    "UnrealizedPNL": -1515.5,
    "RealizedPNL": null,
    "Hold": null
  },
  {
    "Symbol": "SVXY",
    "Currency": "USD",
    "Country": "US",
    "Quantity": 917.0,
    "Exposure": "LONG",
    "MarketPrice": 32.54999925,
    "MarketValue": 29848.35,
    "AverageCost": 53.88827155,
    "UnrealizedPNL": -19567.2,
    "RealizedPNL": null,
    "Hold": null
  },
]


Trades
URL: http://localhost:7425/api/strategies/1002/symbols

Response:
[
   {
    "Symbol": "GS",
    "Currency": "USD",
    "Country": "US",
    "Side": "BOT",
    "Quantity": 181.0,
    "AveragePrice": 183.21,
    "Value": 33161.01,
    "Time": "20200413  10:30:32"
  },
  {
    "Symbol": "GS",
    "Currency": "USD",
    "Country": "US",
    "Side": "BOT",
    "Quantity": 46.0,
    "AveragePrice": 183.38,
    "Value": 8435.48,
    "Time": "20200413  10:33:14"
  },
]


Symbols
URL: http://localhost:7425/api/strategies/1002/symbols

Response:
["QQQ","SVXY","TLT","TSLA"]


Stats
URL: http://localhost:7425/api/strategies/1002/symbols

Response:

    "LongExposure": 383826.07999999996,
    "ShortExposure": -76561.5,
    "NumberOfLongPositions": 3,
    "NumberOfShortPositions": 1,
    "LongPNL": 20382.74,
    "ShortPNL": 23753.41,
    "NetExposure": 307264.57999999996,
    "TotalExposure": 460387.57999999996,
    "TotalNumberOfPositions": 4,
    "TotalPNL": 44136.15
}

Print this item

  Add price info to portfolio for neutral positions
Posted by: GaryB - 11-04-2019, 10:37 AM - Forum: Feature Requests - No Replies

Even if a position is NEUTRAL it would be nice to have the price data displayed in the portfolio window.

Print this item

  Paper Trading Licenses
Posted by: admin - 08-27-2019, 12:48 PM - Forum: News - No Replies

Paper Trading Licenses

Interactive Brokers
These licenses let you trade on the real market with simulated money. Paper trading licenses can be used indefinitely for as many accounts as you have.
You can generate a paper trading license by simply running APM with your paper trading account, as described here (please sign up on the forum to view this link).

Binance and Binance US
Binance and Binance US do not support paper trading for crypto BUT you can manage up to $3,000 USD for free with APM
To get a free license, simply set up the connection to Binance with APM and check "Free Test License"

Print this item

  Email when IB Gateway disconnected for more than X amount of time
Posted by: DaveDM - 08-26-2019, 08:30 AM - Forum: Feature Requests - No Replies

Sometimes IB Gateway can get disconnected from the broker side.  It would be useful to have an email sent to the email address set up with APM if IB Gateway is disconnected for more than a set amount of time in order to alert the user.  Especially useful if the system is running on a remote server and the user doesn't "see" the system as much as they would if running locally.

Thanks,

DaveDM

Print this item

  Process Sell Signals before Buy Signals?
Posted by: DaveDM - 08-17-2019, 11:00 AM - Forum: Feature Requests - Replies (1)

I'm not sure if this is necessary, but for strategies where you are buying and selling on the same days, it might make sense to be able to sell first in order to make room in the portfolio and have more cash available to buy. 

DaveDM

Print this item