This is an example when I want to check if the ADX (of ADXp periods) has CrossedAbove its own moving average (of ADXma periods) in weekly timeframe, to enter long if the daily moving average is above a slower one.
// Condition set 1
if (CrossAbove(ADX(BarsArray[1],(ADXp)), SMA((ADX(BarsArray[1],(ADXp))), ADXma), 1)
&& EMA(EMAfast)[0] > EMA(EMAslow)[0])
This is another example, but the crossover given by daily moving averages.
// Condition set 2
if (ADX(ADXp)[1] >= SMA(ADX(ADXp), ADXma)[1]
&& CrossAbove(EMA(EMAfast), EMA(EMAslow), 1))
I cannot seem to make it work, the strategy compiles and runs, but everything seems to still happen in Daily frame.
Thanks a lot for any help!
Comment