The AFL uses looping on all bars to generate buy-sell signals. This is because the entries and exit conditions are different but occur too frequently. Using flags in the loop helps to confirm: The proper cycle of Buy, Sell, Short, and Cover signals is maintained. There are no consecutive buy or sell signals.
RSI is an oscillator that depicts momentum in prices. We try using two RSI of different periods to judge the short-term momentum and long-term momentum. So trade entries will be based on RSI indicators. However, by construction, RSI gives a lot of whipsaws while it oscillates up and down. So trade exits are done using RSI levels to avoid too frequent re-entries.
Buy when short-term momentum crosses above long-term momentum.
Buy: When short-term RSI crosses above long-term RSI
Sell: When RSI goes below 40 level
When Strategy gives Buy, it will send LE in Call and LX in Put. When Strategy gives Sell, it will send LE in Put and LX in Call.
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.