Paper Trading App Functionality

Note: You can use APIBridge for paper trading easily.
Paper Trading App is available for Amibroker software to verify the reliability of AFL strategies. You can use the app for full automated  trading without risking any money. Please go through detailed functionality given below to use the app for different types of testing.

Watch short video to see how app is being used to simulate limit orders:

Watch another short video on how to verify AFLs using historical data:

Contents

Settings for Paper Trading App

  1. The Paper Trading App should be started before running Amibroker. You need to run Amibroker in Admin mode to create txt log file in C drive (for executed trades). The Paper Trading App works good with free trial version of Amibroker, you do not need to purchase Amibroker to use the app.
  2. In Amibroker, Go To Tools->Preferences->Intraday->select Start Time of Interval
  3. In Amibroker, click anywhere in Charts tab so that AlgoJi folder is available with AFLs
  4. Display Log window, In Amibroker go to Windows->Tools-Log Window. In Log window, slect Trace tab, right click and ensure that both external and internal Trace output are available
  5. To use the paper trading afl on any strategy, you need to have minimum Buy/Sell/Short/Cover defined in your strategy.
  6. In AFL parameters, you can set details for order execution, like LMT or MKT orders. Short and Cover trades are executed using the symmetrically reverse parameters which you specify for Long Entry and Long Exit.
  7. The Paper Trade afl can be left unattended on VPS/VM/Cloud also.
  8. Paper Trades.txt will show you the executed trades with slippage. You can easily beat the slippage by using a good API like Symphony Presto. If the strategy is profitable, you have a good strategy!

Paper Trading App Functionality

Learning how algorithmic trades work using live data:

1. Use “Paper Trade Bid-Ak.afl” or “Paper Trade LTP.afl” depending on whether your data vendor provides bid-ask data or not.
2. Test using both LMT and MKT orders depending on your strategy logic. Let the AFL run for entire day over multiple stock charts.
4. Paper Trades.txt will show you the executed trades with slippage.

Verifiying future looking and repainting signals in AFL Code:

1. Use “Paper Trade BarReplay.afl”: Drag-drop this AFL on your strategy to paper trade using Bar Replay feature of Amibroker.
2. Always use the bar-replay step interval minimum regardless of the chart time frame
3. Use MKT order type for both entry and exit orders
4. Replay paper trading to capture aprox 50 trades, then match the executed trades (PaperTrades.txt in C drive) with the chart signals.

Verifiying Trade Execution Price in Backtest using live data:

1. Use “Paper Trade Bid-Ak.afl” or “Paper Trade LTP.afl” depending on whether your data vendor provides bid-ask data or not.
2. Test using both LMT and MKT orders depending on your strategy logic. Let the AFL run for entire day over multiple stock charts until you have atleast 50 trades.
3. At end-of-day, run a backtest on the stocks that you have paper traded. Compare the backtest trades with paper trades.

Verifiying Trade Execution Price in Backtest using historical data:

1. Not recommended, use this funtionality for estimates only! You should have data resolution atleast 1-min, otherwise AFL shows unrealistic slippage
2. Use “Paper Trade BarReplay.afl”: Drag-drop this AFL on your strategy to paper trade using Bar Replay feature of Amibroker.
3. Always use the bar-replay step interval minimum regardless of the chart time frame
4. Test using both LMT and MKT orders depending on your strategy logic
5. It will actually show you the WORST slippage. If the strategt is profitable even after that, you have a robust strategy!

Verifiying Optimized parameters using live data:

1. This is basically out-of-sample testing… the last leg of testing before you start trading with real money.
1. Use “Paper Trade Bid-Ak.afl” or “Paper Trade LTP.afl” depending on whether your data vendor provides bid-ask data or not.
2. Test using both LMT and MKT orders depending on your strategy logic. Let the AFL run for entire day over multiple stock charts until you have 200-500 trades. If the strategy is profitable, you have a good strategy!

Improving Order Execution at Candle Hi/Lo/Close using live data:

1. This functionality is useful for mean-reverting strategies, and some trend following strategies
2. Use “Paper Trade Bid-Ak.afl” or “Paper Trade LTP.afl” depending on whether your data vendor provides bid-ask data or not.
3. Test using LMT orders and appropriate parameters. Let the AFL run for entire day over multiple stock charts until you have 200-500 trades. If the strategy is profitable, you have a good strategy!

Improving Order Execution at Bid-Ask using live data:

1. This functionality is useful for almost all type of strategies
2. Use “Paper Trade Bid-Ak.afl”
3. Test using LMT orders and appropriate bid/ask parameters. Modify the LMT order price by few points so orders have high probability of getting filled.
4. Let the AFL run for entire day over multiple stock charts until you have 200-500 trades. If the strategy is profitable, you have a good strategy!