Amibroker Auto Trading Problems - AlgoJi

Amibroker Auto Trading problems arise from wrong settings or wrong use of AFL code. Note that all Amibroker related issues are independent of APIBridge, or it’s plugin. These issues should be identified/resolved without integrating with APIBridge.

Repainting signals:

Many a times one may see that a buy / sell signal appears on the chart, and vanishes before the completion of the candle. This happens when the conditions for buy & sell are satisfied, but changes before the closing of the current candle.

This occurrence and then vanishing of the signal is called re-painting.

In some cases, repainting can occur in other forms as well, for example those who use the zigzag  indicator to identify the highs & lows or any such condition, then a buy / sell signal may appear a few candles before the current candle and even that signal may not sustain, as it has the tendency to shift itself as per price movement.

Let us understand this with the help of an pictorial example. To check repainting, you need to bar-replay with minimum time interval. Example, bar-replay with 1-min time interval even if the chart time frame is 15-minute.

Is some other cases of repainting, signal will appear on previous/historical candle, but not on current candle.

(Optional) In Amibroker top menu click Windows->Log. Then click on Trace tab and right click to enable Internal Outputs. You can bar-replay AFL and check whether all signals are displayed properly in Trace output.

How to Check repainting/fake signals.

To check fake signals, add plotALLsignals.afl from the AFL Toolkit

Order placed but no signal in Amibroker

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 (download from AFL Toolkit)

Signal comes in Amibroker but no trade placed

Check the following settings one-by-one

  1. Amibroker chart parameters or scanner parameters should show the correct market segment
  2. Scrips should be added in APIBridge with correct settings
  3. Start Trading button should be turned on
  4. If all above settings are correct, problem is with AFL code. 90% of AFLs found over internet have repainting/fake signals. (separate short tutorial- how to check repainting signals)

Too Many Orders Placed From Amibroker

Auto-trading AFLs rely heavily on static variables, which are bound to time stamp of candles. The following setting is very very important, please ensure it:

  1. In Amibroker, go to Tools->Preferences->Intraday. Check the option START time of interval (recommended). Click Apply.

Wrong price sent in order

APIBridge picks the price defined from AFL in the variables bp/sp etc.. If these are not defined properly it may pick wrong price. It is recommended to use market orders if price is not defined properly in AFL.

Video on Amibroker Repainting Signals

Use Paper Trading To Identify Correct Order Price

This is another old video, you can follow the same process in APIBridge paper trading mode. We have discontinued paper trading AFLs because the functionality can be handled in much improved way by APIBridge.