Okay lets say a simple moving average crossover system with ADX filter
The strategy longs when SMA5 is above SMA20 and ADX18 > 20. Close longs when SMA5 crossunder SMA20 . The opposite for shorts
{
function run()
vars Price = series(price());
SMA5 = series(SMA(seriesC(),5));
SMA20 = series(SMA(series(),20));
vars ADX18 = series(ADX(price,18));
if(SMA5[0] > SMA20[0] and ADX18[0]>20) enterLong();
else if(SMA5[0]< SMA20[0] and ADX18[0]>20) enterShort();
if(crossOver(SMA5, SMA20)) exitShort();
else if(crossUnder(SMA5, SMA20)) exitLong();
}
When I ran it, zorro says
"ADX(): wrong number of parameters"
Last edited by Oliverlista; 12/07/21 13:41.