Amibroker Autotrade AFL Toolkit - AlgoJi

Amibroker Autotrade AFL Toolkit contains a set of AFLs for automating/modifying your strategy. You can use these set of AFLs to change any strategy signals for intraday trading or multiple targets. The AFLs work for different markets like stocks, futures, options, currency and commodities.

How to Use Amibroker Autotrade AFL Toolkit

To modify your strategy, simply add the required autotrade AFL at the end of your strategy AFL. This is all you need to start automated trading with AlgoJi APIBridge.

You can also use these AFLs if you do not have APIBridge subscription.

However, remember the Garbage In Garbage Out principle. 90% of AFL codes on internet are not programmed properly. If you use the Autotrade AFL toolkit with random AFLs on the internet, chances are that you will face many issues.

Basic AutoTrading AFLs

This basic autotrading is primarily used to fire signals from Amibroker to APIBridge. It has 5 parameters:

  1. Instrument Name: Select the instrument name for the market segment you want to trade
  2. Trade Intrabar: If you want to trade immediately when signal appears, select Yes. If you want to wait for signal confirmation until completion of candle, select Candle Completion
  3. Strategy Tag: You can use any strategy tag to manage signals coming from mutiple strategies in Amibroker. Eg. STG1, STG2, STG3 etc.
  4. Disable Long: If you want to disable all Long signals (use only Short side for trading), then turn this Yes
  5. Disable Short: If you want to disable all Short signals (use only Long side for trading), then turn this Yes

Click here to download which has these parameters.

The has additional parameter of quantity. It should be used for for strategies where buy= cover and sell= short,

Intraday Martingale AFL

Using this AFL, you can apply stoploss/target to any strategy, or even make it intraday only. It has following additional parameters:

  1. Activate Intrade Mode? If turned yes, it makes even a positional trading or indicator based strategy for intraday trading only. To apply the intraday timings rule, you should turn this on
  2. Trade Entry From(HHMM): Time when you want to start trading, example 930
  3. Trade Entry Upto(HHMM): Time upto which you want to take fresh trades, example 1430 (for 2:30pm)
  4. Trade Exit(HHMM): Time at which you want to exit all open positions, example 1515
  5. StopLoss(%): Stoploss in percentage from Buy/Short signals
  6. Trail Stop(%): Trail Stop in percentage from Buy/Short signals
  7. Target(%): Target in percentage from Buy/Short signals
  8. Color of Modified Signals: This AFL displays on chart both original signals and modified signals, you can set colors. The stoploss, trail stop and target lines are also drawn on chart with same color.
  9. Exposure  and Quantity both parameters are available. If exposure is 0, it will take the defined Quantity. Exposure example: If you want to buy/sell each stock with Rs. 100,000, you can se the exposure =100000 and run the AFL on multiple stocks. It will automatically trade 1000 share for a 100 rs. stock, and 250 shares of a 400 rs. stock.
  10. Apply Intraday Martingale: Select NO or Arithmetic or Geometric
    A. This works only when Intraday mode is activated
    B. If selected Arithmetic, it adds the trading quantity on every losing trading. Example trade quantity is 1, after every losing trading it adds 1 to new trade. So progression is like 1, 2, 3, 4, 5….
    C. If selected Geometric, it multiplies the trading quantity on every losing trading with 2. Example trade quantity is 1, after every losing trading it multiplies 2 to new trade. So progression is like 1, 2, 4, 8, 16….
    D. In case of winning trade, quantity is reset to initial quantity

Click here to download Intraday Martingale AFL with autotrading

Click here to download Intraday Martingale AFL without automation (for personal use)

Intraday Profit/Loss and Multi Targets

You can also use to set stoploss/target of strategy based on  max profit/loss for each trade. For autotrading with profit/target, use AutoTrade-Intraday-Profit-Loss.afll

For multiple targets to scale-out positions, use

90% of AFLs found over internet have repainting/fake signals. Sometimes you may find an Order placed but no signal in Amibroker Chart. This can happen only if AFL has fake signals. The actual signals triggered by AFL may be different then the signals plot on chart. To check signals, use the AFL with bar-replay.

Click here to download the

Latest Amibroker AFL

Please visit this section to download many clean and verified AFL codes: