Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 48 online users. » 0 Member(s) | 47 Guest(s) Google
|
Latest Threads |
Installation
Forum: Getting Started
Last Post: admin
04-20-2023, 08:00 AM
» Replies: 22
» Views: 19,351
|
Strategy allocation with ...
Forum: General Discussion
Last Post: admin
12-24-2022, 12:28 AM
» Replies: 1
» Views: 1,952
|
Adding color to the Portf...
Forum: General Discussion
Last Post: anis
12-20-2022, 02:57 AM
» Replies: 0
» Views: 1,213
|
Stock Signals
Forum: Documentation
Last Post: ds_13
08-08-2022, 01:25 AM
» Replies: 12
» Views: 22,976
|
Troubleshooting and Known...
Forum: Bugs and Problems
Last Post: admin
05-22-2022, 10:38 AM
» Replies: 12
» Views: 14,684
|
Scaling Factor
Forum: General Discussion
Last Post: admin
05-22-2022, 10:36 AM
» Replies: 3
» Views: 3,762
|
Support allocation method...
Forum: General Discussion
Last Post: Marcel
04-21-2022, 04:05 PM
» Replies: 3
» Views: 5,215
|
Check Out our YouTube Cha...
Forum: News
Last Post: MarkeyMark101
04-11-2022, 08:13 AM
» Replies: 1
» Views: 12,937
|
Time stop
Forum: Feature Requests
Last Post: Marcel
03-30-2022, 10:30 AM
» Replies: 2
» Views: 2,628
|
Rounding Shares
Forum: Feature Requests
Last Post: admin
03-21-2022, 06:28 PM
» Replies: 6
» Views: 5,442
|
|
|
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.
|
|
|
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.
|
|
|
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.
NOTE: Since APM requires read access to Google Drive, it is recommended that you create a new Google account if you do not wish to grant APM access to all your Google Drive files.
- 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)
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.
|
|
|
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.
This feature is only available for fully automated licenses.
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. 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/account?cmd=start |
Start the account (connect to broker) |
POST |
api/account?cmd=stop |
Stop the account |
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/account/stats/<currency> |
Get the account stats |
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 statistics for a strategy |
GET |
api/strategies/<id>/symbols |
Get a list of symbols assigned to the strategy by the APM |
HTTP POST Requests
Account
These calls allow us to start/stop the account.
Endpoint: http://localhost:7425/api/account?cmd=start
Parameters: None
Endpoint: http://localhost:7425/api/account?cmd=stop
Parameters: None
Strategies
This call allows the http client to send signals directly to APM for immediate processing. It requires the account to be running.
Signals
Endpoint: http://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
Endpoint: http://localhost:7425/api/strategies/<id>?cmd=run
Parameters: None
HTTP GET Requests
Account
This call returns the account settings that were setup in the APM user interface.
Endpoint: http://localhost:7425/api/account
Parameters: NONE
Endpoint: http://localhost:7425/api/account/stats
Parameters:- Currency:
- This is the currency you wish to receive the account stats in. Note that only valid strategy base currencies can be used here.
- This field is optional. Not providing it retrieves the stats in your account's base currency.
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.
Endpoint: http://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
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:
ReEnter Orders
The responses to these requests are the same as regular order requests:
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
Strategy Stats
URL: http://localhost:7425/api/strategies/1002/stats
Response:
{
"Allocation": 550000,
"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
}
|
|
|
Paper Trading Licenses |
Posted by: admin - 08-27-2019, 12:48 PM - Forum: News
- Replies (4)
|
|
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"
|
|
|
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
|
|
|
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
|
|
|
Strategy Tabs in Strategy Window |
Posted by: DaveDM - 08-16-2019, 07:24 PM - Forum: Feature Requests
- No Replies
|
|
Ability to re-arrange by dragging/dropping and change the order of the strategy tabs in the Strategy Window rather than having the order fixed based on the order in which each strategy was created.
Thanks,
DaveDM
|
|
|
Historical Trades and Performance by Strategy Tab |
Posted by: DaveDM - 08-13-2019, 05:00 PM - Forum: Feature Requests
- No Replies
|
|
Since it is possible to have multiple strategies within one physical account, it may be hard over time to keep track of how well each specific strategy is doing within the account since the broker metrics will be on the account level.
It would be helpful for each strategy tab to track it's own historical buy/sell orders and the prices they executed at if possible, and then for each strategy tab to have it's own sub-tab (similar to Settings, Log, Portfolio sub-tabs) that show basic strategy performance metrics over time, such as date of first trade, net profit since inception, equity curve, etc. -- Key Performance Indicators (KPI's) / performance metrics could be added over time.
Thank you,
DaveDM
|
|
|
|