Amibroker Autotrade AFL Toolkit

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.

See here Amibroker Setup Video हिन्दी में https://www.youtube.com/watch?v=Q2zIeD88P7U

See here Amibroker Setup Video in English https://www.youtube.com/watch?v=Y45X4SKju54

See here Amibroker Troubleshooting in English https://www.youtube.com/watch?v=9iXdfQBb554

Contents

How to Use Amibroker Autotrade AFL Toolkit

Amibroker setup with APIBridge requires two things:
1. One of the AFLs given below
2. If AFL throws error, go to Amibroker installation directory ->Plugins folder->Put dll file from here (can happen due to security permissions)
3. (On old PCs only) dll will not be detected, you need to update .Net Framework. Go to https://www.microsoft.com/en-in/download/details.aspx?id=48145 and install 32bit or 64bit as per your Amibroker version.

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.

PlotAll-Signals.afl

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 plotALLsignals.afl with bar-replay.

Click here to download the PlotAll-Signals.afl

Separate-Entry-Exit.afl

This is basic AFL useful for automation. Click here to download this AFL.

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

Buy-Sell-Double

Click here to download this AFL

This is a simple and powerful auto trading template for strategies where you want to trade DOUBLE quantity on reverse signal. It should be used only for strategies where buy= cover and sell= short.

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
  6. Initial qty-  quantity you want to trade . it will get double after the 1st trade signal
  7. Previous Session Position- If yes it will double the quantity from 1st  trade signal else it will double from second trade signal
  8. Reset – reset the trading quantity to initial quantity

Intraday

Click here to download this AFL

This is advanced template useful for intraday trading.

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. Qty Using SL: If this is given non-zero value, it calculates quantity based on SL as defined in percentage. It will ignore Quantity given in parameter or Quantity calculated from Exposure.

Options

Click here to download this AFL

This is a basic template used for trading in options.

  1. You can use it on any chart of cash/future to trade in options based on signals generated in the chart
  2. If Buy signal generated, it will Buy Call and exit Long position in Put
  3. If Sell signal generated, it will Buy Put and exit Long position in Call

Parameters:

  1. Base symbol- symbol of derivative you want to trade in.
  2. Expiry- Expiry of that Put/Call
  3. Put Strike – strike for selecting Put for trading
  4. Call strike- strike for selecting Cut for trading
  5. Instrument Name: should be OPTIDX or OPTSTK
  6. 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
  7. Quantity- Total quantity in which you want to trade. For example, in Nifty 1 lot use 75, Nifty 2 lot use 150…

Latest Amibroker AFL

Please visit this section to download many clean and verified AFL codes: https://algoji.com/latest-amibroker-afl/