3)when an up trend retraces between 20 and 40 sma, and a new candle breaks previous candle close(( which lies between 20 and 40 sma).and cci reaches -100
3)when in an up trend price retraces between 20 and 40 sma and cci reaches to -100 for buy signal,and in down trend price lies between 20 and 40 sma and cci reaches to +100 for sell signal.i need afl code for this
the above given conditions are not specific, you have mentioned values between some approx parameter values etc., parameters and manual studies which can not be coded in AFL for buy or sell signals exactly.
you can take it like when 20 > 40 sma and price close below 20 sma and above 40 sma ,and price breaks yesterdays high buy signal,and opposite 20< 40 sma and price close below 40 sma and above 20 sma sell signal,i dont want exact conditions to meet,any near by afl code is sufficient .