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



Search Forums

(Advanced Search)

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

Full Statistics

Online Users
There are currently 16 online users.
» 0 Member(s) | 16 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,675
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
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: 382
broker support
Forum: Feature Requests
Last Post: admin
03-25-2021, 09:04 AM
» Replies: 1
» Views: 247
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: 260

  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.



Print this item

  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,


Print this item

Posted by: admin - 08-03-2019, 06:23 PM - Forum: Documentation - No Replies

As of version 1.1, we have added the ability to hedge a strategy through hedging actions. The idea is that a user can now place an order based on their strategy's long/short exposure, which essentially grants the ability to hedge a strategy with some asset.

Before reading ahead, make sure you have read the Stock Signals tutorial.

Hedging Actions
The two hedging actions are Hedge With Exposure(HWE) and Hedge Against Exposure(HAE), which each act as their name suggests.

Hedging Unit Types
These hedging actions can only be used with some specific hedging unit types, that each behave slightly differently.

Percent of Long Exposure (%LONGEXP)

  • Open a position based on only the long exposure of your strategy (i.e. sum of the exposure of all your long stocks)
  • Note that in this case, HWE means you will be going long, and HAE means you will be going short
Percent of Short Exposure (%SHORTEXP)
  • Open a position based on only the short exposure of your strategy (i.e. sum of the exposure of all your short stocks)
  • Note that in this case, HWE means you will be going short, and HAE means you will be going long
Percent of Net Exposure (%NETEXP)
  • Open a position based on the net exposure of your strategy (i.e. long exposure - short exposure)
  • Note that in this case, HWE and HAE don't necessarily mean you will go long or short (see below for examples)
Percent of Account Long Exposure (%ACCTLONGEXP)
  • Open a position based on only the long exposure of all your strategies (i.e. sum of the exposure of all your long stocks)
  • Note that in this case, HWE means you will be going long, and HAE means you will be going short
Percent of Account Short Exposure (%ACCTSHORTEXP)
  • Open a position based on only the short exposure of all your strategies (i.e. sum of the exposure of all your short stocks)
  • Note that in this case, HWE means you will be going short, and HAE means you will be going long
Percent of Account Net Exposure (%ACCTNETEXP)
  • Open a position based on the net exposure of all your strategies (i.e. long exposure - short exposure)
  • Note that in this case, HWE and HAE don't necessarily mean you will go long or short (see below for examples)

Each strategy below examines what happens when hedging with different types of portfolios.
Note that hedging actions still support the different order types, time in force, prices, etc. that regular actions support. For the purpose of these examples, we are using simple signals.
Strategy 1 and 2 are basic cases, but please go over them briefly.
We highly recommend you read the examples under Strategy 3, so you can understand exactly how hedging is handled in APM.

Strategy 1
Suppose our current strategy contains the stocks:
AAPL (long $10,000)
IBM (long $5,000)
MSFT (short $4,000)

Now we will look at what happens with various signals:

1) Use SH (Proshares Short ETF) to hedge with our long exposure
We are long $15,000, so we would go LONG $7,500 of SH.

2) Use SH to hedge with our short exposure
We are short $4,000, so we would go SHORT $2,000 of SH

3) Use SH to hedge with our net exposure
Our net exposure is $11,000, so we would go LONG $5,500 of SH

4) Use SPY to hedge against our long exposure
We are long $15,000, so we would go SHORT $7,500 of SPY.

5) Use SPY to hedge against our short exposure
We are short $4,000, so we would go LONG $2000 of SPY

6) Use SPY to hedge against our net exposure
Our net exposure is $11,000, so we would go SHORT $5,500 of SPY

Strategy 2
Suppose our current strategy contains the stocks:
AAPL (long $1,000)
IBM (long $4,000)
MSFT (short $10,000)

1) Use SH to hedge with our net exposure
Our net exposure is -$5,000, so we would go SHORT $2,500 of SH

2) Use SPY to hedge against our net exposure
Our net exposure is -$5,000, so we would go LONG $2,500 of SPY

Strategy 3
Suppose our current strategy contains the same stocks as Strategy 1:
AAPL (long $10,000)
SH (long $5,000)
MSFT (short $4,000)

But now we will use SH to hedge:

1) Use SH to hedge with our short exposure.
Our short exposure is $4,000, so we would go SHORT $400 of SH.
Since we are currently LONG $5,000 of SH, we would SELL $5,400 of SH.

2) Use SH to hedge with our long exposure
Our long exposure is $10,000 without SH, so we would go LONG $1,000 of SH.
However, we are currently LONG $5,000 of SH, so we have to SELL $4,000 of SH.

Why do we exclude SH when calculating long exposure? We assume that we are using SH to hedge against the rest of the portfolio. It wouldn't make sense to include SH in the long exposure calculation since then we would essentially be using SH to hedge against SH.
The same is true for short and net exposure calculations.

1) It only makes sense to hedge with one stock in most cases. For example, take the portfolio:
MSFT (long $10,000)

and try hedging with it using SH and TLT:


We process the SH signal first, so we go LONG $1,000 of SH.
Now we process the TLT signal (suppose after the SH order has been executed), but now our long exposure is $11,000, so we would go LONG $1,100 of TLT, which is $100 more than we wanted since we did not want to include SH in the calculation.

Similarly, hedging with multiple stocks using net exposure will also fail since the net exposure calculation will include the other hedges as well.

On the bright side, this issue does not occur when you hedge against long/short exposure. In this case, you are not including the stocks you are using to hedge in the actual long/short exposure calculation.

2) The other limitation is that you cannot hedge for strategies using screeners, since they don't take hedging signals.

Print this item

  File Formats
Posted by: admin - 07-14-2019, 07:15 PM - Forum: Documentation - No Replies

File Formats
The different file formats give you freedom in how you want to create/store signals, and can be set using the File Type field under the Local File, File Screener, Google Drive File and Google Drive Screener signal provider types.
There are three types of file formats: text, json, csv with the following file type extensions: .txt, .json, .csv

Note that all signal files should still have the .sig extension either by itself or followed buy the file type extension. ( i.e. oldstrat.sig, newstrat.sig.txt, newerstrat.sig.csv, lateststrat.sig.json are all valid files names while a file named strat.txt will not be processed).
We recommend using .sig.txt, .sig.csv and .sig.json extensions as they can be identified and thus (pre)viewed easier on mobile devices.

All files are processed OLDEST to NEWEST by the last modified time. When your strategy requires you to process files in a specific order, make sure the last modified time is set appropriately.

The text format is described in the Stock Signals and Stock Screeners threads.
Make sure you have read these threads first in order to understand what makes up a stock signal/screener.

The csv file is for table formatted signals (comma separated values).
You can specify which columns you want to include (in any order) out of TICKER, ACTION, QUANTITY, UNIT, ORDERTYPE, LIMIT, STOP, TIF, TIFDATE, ID, EXITTARGET, EXITSTOP.
The only mandatory fields, as with the text format, are TICKER and ACTION. Fields do not need to be capitalized.
You can also include column names that are not one of the above, these columns will simply be ignored.
Note that TIFDATE refers to the date specified for the GTD time in force.

Here are some sample csv formatted signal files

AAPL,BTO,20180909,buy apple,,,,
IBM,LONG,20180909,long ibm,100,SHARES,LMT,100


The following is a specific example for a Custom Target Order (see documenation)

Notice that you can leave fields you don't need blank. You only need to fill out fields such that the signal is valid.

The csv file format for screeners is very similar, except that only the ACTION and TICKER columns will be read, and the only valid ACTIONS are BUY/SELL (as usual for screeners).
The order of tickers in the screener is from top to bottom, similar to the text format.

BUY,IBM,Buying IBM today

The json file format allows for signals to be directly decoded from a json string, and it is only available for signals (and not screeners) as of now.

The file should contain a single JSON object that is a list of JSON formatted signals.
The valid signal fields are: Action, Quantity, Unit, Symbol, TimeInForce, OrderType, LimitPrice, SignalId.
Of these fields, Action and Symbol are mandatory.

Here is a sample json formatted file:

        "Action" : "BTO",
        "Symbol" : "AAPL"
        "Action" : "LONG",
        "Symbol" : "IBM",
        "Quantity" : 100,
        "Unit" : "SHARES",
        "OrderType" : "LMT",
        "LimitPrice" : 100

Print this item

  Troubleshooting and Known Issues
Posted by: admin - 11-20-2018, 09:35 PM - Forum: Bugs and Problems - Replies (2)

Troubleshooting and Known Issues
This thread will contain a list of known issues regarding APM and the softwares it is integrated with.
Some issues will have easy fixes if you come across them.


  • After restating your computer or APM, it is possible that APM may tell you that an account is already open, when it is not. Close APM, check your task manager, and close any instances of APM. If that doesn't work, delete the lock.txt file in your account folder.

Interactive Brokers
  • Market on Close and Limit on Close orders cannot be placed outside of market hours on paper trading accounts.
    • Live accounts will work perfectly fine.
    • For paper trading accounts, you should either trade during market hours or use Market/Limit orders instead.
  • IB usually must be restarted each weekend. There is no known fix, but it is as simple as reopening it and logging back in.

Print this item

  Account Settings
Posted by: admin - 11-19-2018, 01:39 PM - Forum: Documentation - No Replies

Account Settings
The account settings page is where you will manage your broker settings and other account related settings.
Details about setting up your broker are in the startup guide.

[Image: apm_fullaccountsettings.png]

Refer to the startup guide for details about licenses. When you obtain a license for a real account, you will have to input your license token into the Token field.

This section lets you manage the tickers that APM uses at the account level.

Ignore Tickers
You can use this text box to prevent APM from trading a ticker across all strategies. This will allow you to manually trade the ticker yourself without worrying about it affecting your APM strategies.

Orphaned Tickers
This text box will tell you if there are non-ignored tickers that you own (or have orders for) in your portfolio that do not belong to a strategy.
If you want to trade these tickers manually yourself, then you should add them to Ignored Tickers because otherwise any manual orders for them will be automatically cancelled by APM.
If you want to assign some of these tickers to a specific strategy, then simply highlight the ones you want with your mouse and use the buttons above the orphaned tickers text box to transfer them.
If you don't care about what happens to these tickers, then you can leave them and a strategy will be able to take the ticker over and place orders for it.
Note that the orphan tickers text box will only have tickers in it once you connect to your broker.

You have the option to email yourself account information on a schedule that you input.
We suggest you create a new email account that will be used to send the outgoing mail (preferably Gmail). The password you use will be encrypted and stored locally on your computer. The reason we do not use an Alera email to send your data is because we want to preserve the privacy of your data by keeping it off of our own servers.
Once you input this information and set a schedule (refer to the cron guide), you should save the strategy and click the 'play' button beside your schedule to send a test email. If you there is an error with the information you inputted, there will be a message displayed on APM.

Some email services, like Gmail, will not accept automated email messages by default. APM may not be able to detect this issue on its end, so you will have to make sure you modify the settings on your email service to allow this (if you didn't receive the test email). For Gmail, you can find out how to do this here.

Start and Strategies
The Start button will initiate a connection to your broker. If it is successful, the status bar on the bottom of your screen will turn blue.
The Strategies button allows you to view your strategies.

Print this item

Posted by: admin - 11-18-2018, 09:10 PM - Forum: Documentation - Replies (2)

You can configure the strategies you want to run in the strategy settings, which is the default page that opens once you've created an account.
Your strategies are listed as tabs at the top of the window, and each individual strategy has 3 tabs: settings, logs and portfolio.
This guide will go over the various sections of the settings tab and then explain what the portfolio and log tabs do.
Before you get started, remember that every time you change a setting, you should click Save, otherwise your settings won't be updated.
Also note that most of the information in this guide can be found directly on APM by hovering over the text boxes.

[Image: apm_strategysettings3.png]

This section is used to configure the where your strategy will get its signals from. Choose a signal provider type from the ones listed and fill out the fields.
There are guides to using the individual signals and screeners that explain the fields in detail.

Strategy Type
This field lets you select the type of asset you will be trading (stocks, crypto, fx) as well as the country and currency the assets are in. Note that you cannot trade assets of two different types in the same strategy, e.g. you cannot trade stocks and fx, nor can you trade UK stocks and USD stocks in the same strategy.

Strategy Priority
Strategy priority allows a strategy to trade tickers from other strategies with lower priority. For example, suppose strategy A has priority 2, strategy B has priority 1, and strategy B is trading AAPL. If strategy A receives a signal for AAPL, then it can "take" AAPL from B and trade it. However, if strategy B then receives a signal for AAPL, it will not be able to trade it since strategy A has higher priority. If two strategies have the same priority, then neither one can trade tickers from the other. Also note that in the account settings there is an Orphan Ticker Priority text box, which lets you set the priority value for orphan tickers. This allow you to manage which strategies can process orphan tickers -- by default orphan ticker priority is 0, so all strategies can process orphan tickers.

Max Number of Positions - non-screener strategies only
This field determines the max number of positions your strategy can hold. There are three ways to cap your positions.

Hard Cap
This option ensures that you cannot place orders if the number of positions + orders is larger than the cap. For example, if your cap is 5 positions, and you have 3 positions in AAPL, IBM, SPY and 2 orders for TLT, GOOG, then you CANNOT place anymore orders in this strategy (unless they are for those 5 tickers)

Hard Cap+
This option functions similar to Hard Cap, except now we don't count CLOSING market orders (MKT/MOC/MOO) towards the number of positions you own. This allows you to "replace" positions by first placing sell market orders and then placing buy orders.

Soft Cap
This option only counts your current positions + market (MKT/MOC/MOO) + limit auction (LOO/LOC) orders towards the cap. Then when your cap is full, all remaining orders are automatically cancelled. For example, suppose your cap is 5 and you have 3 positions in AAPL, IBM, SPY, a MKT order to open TLT, three LMT orders for GOOG, AMZN, V, and a close MKT order for AAPL. Then you are considered to currently have 3 positions in your cap: IBM, SPY, and TLT. We do not count AAPL since there is a market (MKT/MOO/MOC) order closing AAPL. If the LMT orders for GOOG and AMZN are executed, then we will count 5 total positions towards the cap, so the remaining LMT order for V will be cancelled.

  • If you want to replace existing positions by placing CLOSE market orders for those positions and placing some LMT orders to open new positions, you will have to place the market orders FIRST before you place your new orders in order (otherwise APM won’t think there are free positions available)
  • Limit Auction (LOO/LOC) orders are counted towards the cap since they cannot be cancelled at certain times of day (e.g. near market close or open). However, using a CLOSE LOO/LOC order will not free up a position like a market (MKT/MOC/MOO) order since these limit auction orders are not guaranteed to execute.

Number of Positions - screener strategies only
This is the number of positions from your screener that APM will hold.

External Program
The purpose of using external programs is to have the ability to run other software to create signals for APM to process.
The guide here goes in detail over how to do this.

The scheduler section allows you to schedule your strategy. Refer to the cron guide to learn how to fill in schedule fields.
There is also a 'play' button to the right of the schedule, which we will call the run button. It will run the strategy immediately instead of waiting for the schedule to trigger, but it will only be enabled when the account is connected and the strategy is not already running.
You also have the option to disable the scheduler for the strategy by unchecking the checkbox beside Enable Scheduler. Everything else will remain the same, except that the strategy won't run.

Position Sizing
This section allows you to allocate how much money you would like to allocate to each strategy and each trade. Refer to the signals guide for details on Unit types.

Strategy Allocation
  • Choose how much to money to allocate to this strategy, either as total dollar value or a percent of your portfolio
  • If you are connected to your broker, then the dollar value associated with your strategy will appear to the left of the text box
Position Sizing Type
There are three types of position sizing types that determine how large position will be
  • None
    • Use the position size provided by the signal provider if it is provided. Otherwise use the Custom Lot Size
  • Custom
    • Override the position provided by the signal provider and use the Custom Lot Size instead
    • We only override if the Unit type is DOLLARS or SHARES because the other types do not need to be overridden
  • Scaling
    • Scale the position size from the signal provider by a given factor that you specify in the Scaling Factor field.
    • We only scale if the Unit type is DOLLARS or SHARES
Custom Lot Size
Allows you to specify the position you want to take if it is not specified by the signal provider or you choose the Custom position sizing type.
The value you specify will be treated as percent of your Strategy Allocation or a dollar amount. Note that if you are connected to your broker, then the current dollar value of the custom lot size will be displayed to the left of the text box.

Very Important!!
Your Strategy Allocation value does not prevent orders from being placed if they will make the strategy exceed its allocation.
This means if you allocate $100,000 to your strategy, and set the Custom Lot Size to 10% (which is $10,000), and the signal provider gives 20 signals, then the strategy will have a total dollar value of $200,000. You should choose your Custom Lot Size based on how many positions you think you will take. You also have the ability to limit the number of positions your strategy will use with the Max Number of Positions field under the Strategy section (where your signal provider settings are). This way if your Custom Lot Size is 10%, you can set the Max Number of Positions to 10 and put a hard limit on the number of positions you take.

Allow Odd Lots
Check this if you want to allow orders/positions of any size to be placed/held.
Otherwise, all orders will be rounded such that the final position held will be a multiple of 100 shares.

Order Types
This section is used to specify the kind of orders you want placed in the market. Refer to the signals guide for details on Order Types.

Default Market Order Type
If no order type is specified by the signal provider, then the order will be a market order. Here you can specify whether you would like to place a Market (MKT) or Market On Close (MOC) order in this case.
This also applies to screeners as well since they use market orders.

Override Market Order Type
This option allows you to override the market order type specified by the signal provider with the Default Market Order Type. This will only override MKT and MOC orders, not LMT or LOC.

Protect Market Orders
This allows the user to 'protect' their market orders by converting them to limit orders as follows:
  • Buy orders will have a limit price equal to the current bid price PLUS the Protection Offset (as a percent)
  • Sell orders will have a limit price equal to the current ask price MINUS the Protection Offset (as a percent)
This prevents buy/sell orders from executing too far away from the current bid/ask price.
This only works for Market orders and not Market on Close orders.

Note that this is broker dependent and the order may not literally be converted to a limit order. For example, in Interactive Brokers, we use SNAP PRIM orders

Override Limit Order Type
This option allows you to override the limit order type specified by the signal provider with your own (keeping the same limit price).

Default Time in Force
If a time in force is not specified by the signal provider, then you can specify a default value. Note that MOC and LOC orders are always going to have DAY time in force.
The time in force specified here will be applied to all screeners as well, but we recommend you use DAY orders.

Email settings related to your strategy

Send Email After Strategy Runs
Check this to send an email after you strategy runs. It will contain data relevant to this specific strategy.
If this check box is disabled, then either your email has not been set up or is disabled in your Account Settings.

Position Management
This section allows you do automatically manage stop loss and target orders for your current positions.

Stop Loss Order Type
Allows you to place stop loss orders with the Stop Loss Percent

  • A trailing stop loss order will trail by the Stop Loss Percent
  • An update of the percentage amount will trigger an order update as soon as you save the strategy
  • A regular stop loss order will be placed away from the current price by the Stop Loss Percent
  • An update of the Stop Loss Percent will not trigger any update on existing orders. It will be used only for all newly placed orders.
A change from regular stop to trailing (or from trailing to stop) will cancel all existing stop loss orders and generate new ones based on the current price.

Generate Target Orders
Allows you to place target profit orders with the Target Profit Percentage.
Note that updating the Target Profit Percentage will not update any existing orders, similar to the stop loss orders.

It is important to note that for both Stop Loss and Target Profit orders, the amount of shares will adjust so the position will be closed if all other regular orders that shrink that position were to be executed at once.
This means if we had a 100 shares of AAPL plus an order to sell 30 shares of AAPL, and we enabled both stop and target orders, we would end up with 3 orders in the market, one to sell 30 shares of AAPL, a stop loss to sell 70, and a target profit to sell 70. Since APM continuously monitors all positions, if the order to sell 30 shares of AAPL gets canceled for any reason at a later time, the quantities for both the stop and target orders will be adjusted to 100 shares automatically by APM.

Order Limits
This section allows you put limits on the number of shares, stock price, or total dollar value (shares x price) of an order.

The Min fields specify that an order that does not CLOSE positions will be ignored if it does not meet the min criteria (the exception to this is Min Price, which only applies to non-shrinking orders)
The reason we do not limit close orders is that we need to be able to close positions even if they have a small number of shares.

The Max fields specify that an order that does not SHRINK positions will be ignored if it does not meet the criteria.
This is slightly different than Min because we don't apply the limits to close orders and orders that shrink positions.
Why? Because we want you to be able to shrink positions that are very large without having to close them (think about going from long 1000 shares to 100 shares).
We do, however, want the Min conditions to apply to 'shrinking' orders because you may not want to buy/sell one share. For example, processing a signal LONG AAPL everyday may change the number of shares you hold by 1-2 everyday. You can prevent this behavior by setting Min Shares to maybe 10. This feature is not useful for Min Price, so it behaves the same way as the Max fields.

Order Preview and Skip Orders
APM allows you preview the orders that would be placed in the market by clicking the Order Preview button on the bottom left of the settings page.
This feature allows you to semi-automate your system by having the ability to process your signals automatically, review them, and only then place them in the market.
You will notice that in the order preview window, there is a checkbox beside each order that allows you skip the associated ticker or not. Once you click Update Skip Orders List at the bottom of the order preview window, the tickers associated with the orders you selected will be stored in the Skip Orders text box on the bottom right of the strategy page.
Now whenever your strategy runs (for real), it will skip the orders for the tickers in Skip Orders. You can also manually edit skip orders when the strategy is not running.

[Image: apm_orderpreview.png]

The log tab mainly logs signals as they are being processed and serves as a way to check that your strategy is running correctly.
Any issues that will cause a signal (or order) to not be processed will appear here. If you notice that some signals have not been processed, check the log to find the reason for having unprocessed signals.

The portfolio tab stores a table of the positions you own and any active orders for the strategy. 
You can sort by a specific column by clicking on the column's header. 
You can remove a ticker from the strategy by clicking the Remove button on the right. This will not sell the position, it will simply remove it from the strategy so that another strategy can take it.

The trades tab lists the latest trades for the strategy. The trades go back one or more days depending on the broker API. (e.g. IB reports only the trades since the last closing while the crypto brokers report trades going back weeks)
The partial trades that belong to the same order are aggregated in one entry.
The tickers removed from the strategy (either manually or automatically) will not show in the trades tab.

Order Ref Field (Interactive Brokers)
Each order that is placed by APM in IB has an Order Ref field which is set as the ID of the strategy placing the order. This allows you to keep track of all your trades in each strategy through IB Flex reports. You need to specify "Include Audit Trail Fields" in your Flex Query configuration in order for the Order Ref field to be included in your reports. This solution was originally posted by a user in the following thread: https://aleratrading.com/forum/showthrea...601#pid601
[Image: ib_orderref.png]

Signal Processing
A ticker can only belong to one strategy at a time. When a strategy processes a signal for a ticker, it needs to check that the ticker does not already belong to a different strategy. If it does belong to a different strategy, then the signal is ignored.

Print this item

  Automating your Self-Contained System
Posted by: admin - 11-18-2018, 11:41 AM - Forum: Documentation - Replies (2)

Automating your Self-Contained System
This guide explains the steps to completely automate data download, signal creation, and signal processing.

The following guides may be helpful:

  • You have software that can create signals (and download the necessary data) at your disposal
  • Enough computer/programming skills to tell your software how to format the signals and where to place them on your computer
Setting up your Program(s)
Make sure you can run any necessary signal generating and data downloading programs as command line executables (that will terminate).
It is not necessary that your software is a command line exe, but it makes it easier to work with in general.
The next thing you want to do is make sure your software can write signals (or a screener) to a file in the format specified in the guides.
The directory that your strategy will read signal files from is located on the bottom right of your screen. Go ahead and modify your software so that it will write files to that directory.

Note that APM can run other programs with command line arguments, meaning that you can take in the file directory as an argument rather than hard-coding it.

Setting up your APM Strategy
We will be using the External Program section of the strategy settings to run your programs. First enable Use External Program.

The File and Arguments fields are used to specify the program you would like to run.
To schedule your program, put a cron string in the Run External Program field (refer to the cron guide).

If there is more than one program you need to run (i.e. one program to download data and one to generate the signals), then you have two options:
  1. Create a 'dummy' strategy that does nothing except run your second program on a schedule.
  2. Create a batch file that will run all your programs. This is the more advanced option, so beware of problems such as not waiting for other processes to finish.
For reference, a simple batch file may look like:


Note that if DownloadData.exe is not a command line executable, then the system may not wait for DownloadData.exe to finish before generating signals.
In that case, you will want to try something like:

powershell -Command "Start-Process 'C:/Users/DownloadData.exe' -Wait;Start-Process 'C:/Users/GenerateSignals.exe';"

It is highly recommended that you test that your external program work as expected by manually running them (press the button beside Run External Program) and checking that your signals were generated in the correct folder.
Once you have set up your external program to run, you can set up the other fields in the strategy settings as usual (make sure to use Local File or File Screener as your signal provider).
Then you should check that the signals are correctly processed by pressing Order Preview.

Print this item

  Using Cron for Scheduling
Posted by: admin - 11-09-2018, 09:13 PM - Forum: Documentation - Replies (6)

Cron Scheduling
Scheduling your strategies, email notifications, and external programs in APM can be done using the cron (also crontab) syntax.
Please refer to this guide for another explanation (and some more advanced uses) of the cron syntax used in APM.

The cron syntax that APM is slightly different than the classic Unix cron syntax:

* * * * * * *
| | | | | | |
| | | | | | +-- Year              (range: 1900-3000)
| | | | | +---- Day of the Week   (range: 1-7 or SUN - SAT)
| | | | +------ Month of the Year (range: 1-12)
| | | +-------- Day of the Month  (range: 1-31)
| | +---------- Hour              (range: 0-23)
| +------------ Minute            (range: 0-59)
+-------------- Second            (range: 0-59)

Some notes about this format:
  • The year is optional and does not have to be included
  • The week starts on Sunday
  • You cannot put a day of the week and a day of the month. Put a ? for one of the options.
  • This format includes the second to run at, which is a mandatory field
The idea behind this format is that each cron string is 6 (or 7) numbers (or special characters) that define a schedule.

Special Characters
* : means all possible values. For example, putting * for hours would mean every hour.
? : means no value. This is used for conflicting values, such as putting a number for both the day of month and day of week. One of those values must be ?
- : is used to specify a range of numbers, i.e. 5-7 for hours would mean at 5,6, and 7am.
, : is used to specify a set of numbers, i.e. 5,7 for hours would mean at 5am and at 7am.

Here are some example cron schedules:

* * * ? * *                 Runs every second
0 * * ? * *                 Runs every minute
0 30 15 ? * *               Runs at 3:30pm every day
0 30 15 ? * MON-FRI         Runs at 3:30pm, Monday through Friday
0 30 10,15 ? * MON-FRI      Runs at 10:30am and 3:30pm, Monday through Friday
0 10 * ? * *                Runs every hour at 10 past the hour

If you are unsure about using cron, we suggest to copy one of the above schedules into APM and modify the second, minute, and/or hour fields to your needs.
Note that APM will tell you the schedule your cron string represents if you hover over the Run Strategy text.

Print this item

Posted by: admin - 11-06-2018, 02:28 PM - Forum: General Discussion - No Replies

Frequently Asked Questions
This thread will contain a list of frequently asked questions that will help users get an understanding of the Alera Portfolio Manager (APM).
Feel free to post other questions you have or think should be added to this list in the comments.

Where do I download the software from?
You can download APM from the installation page.

What Brokers does APM work with?
Currently, the software is only compatible with Interactive Brokers (IB), but we plan to add more brokers in the future.
You will have to open an account with IB in order to use the software.

How do I test APM before using it with real money?
When you open an account with IB, you are given a free paper trading (simulated trading) account that you can use to test APM.

Does it cost money?
The software is free to use for 3 months with a paper trading account (no sign-up required currently).
If you would like to use it with a real account, please email us at contact@aleratrading.com.

What do you do with my account information?
We understand that traders want to keep not only their strategies private, but also their account information. 
That is why we designed APM so that no information, other than your account ID (for licensing purposes), is sent to our servers.

What can I trade with APM?
APM currently handles only U.S. stocks. We plan to support options, futures, forex, and crypto.

Print this item