I need to have afl code with following conditions fulfilled:
1. 20 Period Simple Moving average is rising for last N minute( N should be custom editable say = 10, 20,30 minutes). Rising means SMA line is upward trending.
2. Current candle close price has Body size(Open-close) greater than previous N Candles ( N may be = 5,10,20 editable)
on above condition fulfill Buy Green arrow should appear
also reverse of above process
i.e 20-period moving average should be falling and last Candle size is greater than N previous candle.
Candle means Japanese standard candle used in trading software
and buy condition coded with the above parameters.