Best Optimized Supertrend V4.0 – Amibroker AFL Code



Supertrend v4.0 with the new version two interesting features has been added. One is a simple 200 EMA filter rule is added to Buy and Short Conditions and changes in the dashboard.

Trading Rules

Buy – if suptrend shows a buy signal and candle above 200 EMA (Green Arrow)
Exit Buy – if supertrend shows a exit signal (Yellow Star)

Short – if suptrend shows a sell signal and candle below 200 EMA (Red Arrow)
Exit Short – if supertrend shows a exit signal (Yellow Star)

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 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.

Afl Formula