Select Page

his is perhaps the simplest afl trading system in which the afl code can be understood by non-programmers also. We carefully define the Buy, Sell, Short and Cover rules; where Short and Cover are symmetrically opposite if Buy and Sell. This helps in smooth integration of this AFL with automated trading systems.

We try to buy when a) trend is strong b) exit when trend is weak.

Strategy Premise 

The ADX is perhaps the most popular trend detection indicator, developed by Welles Wilder.  The Plus Directional Index (PDI) is calculated as the current high minus the prior high, provided it is positive. It is assigned a value of zero if not positive. The Minus Directional Index (MDI) is calculated as the prior low minus the current low, provided it is positive. It is also assigned a value of zero if this figure is not positive.PDI indicates the strength of the uptrend while MDI indicates the strength of the downtrend. A low value of PDI or MDI suggests that there is not any clear trend in the market. Currently, we do not add any other indicator to this system to test the technical strength of ADX.

Strategy Logic

Buy: Buy When PDI crossed above MDI, the value of PDI is greater than 25  and value of MDI is less than 25.

Sell:  When PDI falls below MDI.

When ADX gives Buy, it will send LE in Call and LX in Put. When ADX gives Sell, it will send LE in Put and LX in Call.

Amibroker Settings 

Step 1: Make sure you have completed Jump Start setup 

Step 2: Download AFL from here. In Amibroker, Go to Formula editor and paste the AFL here.   

Step 3: Right Click on the chart and go Parameters to adjust the inputs of the strategy.