Trades are Executed on the close of the Candle. And so SetTradeDelays(1,1,1,1) functions is mentioned in the afl code to introduce a delay of trade at next bar open.

Steps to Install in your Amibroker
1)Download Supertrend v4.0 – Amibroker AFL Code. If you are not comfortable in running Backtesting and Optimization try with the following code Supertrend V4.0 Backtest and Optimize
2)Unzip Supertrend V4.0 afl to local folder
3)Copy Supertrend V4.0.afl file to \\program files\\amibroker\\formula\\basic folder\\
5)Open Amibroker and Open a New Blank Chart
6)Goto Charts->Basic Charts and apply/drag-and-drop the Supertrend v4.0 code into the blank chart
7)Bingo you are done. Now you will be able to see the Supertrend v4.0 Trading System indicator with Buy and Sell signals.