A simple trend following strategy built with MACD default settings and ADX.
Orders are launched when the MACD cross the 0 level line and with ADX minimal value condition.
Orders have stoploss and takeprofit.
defparam cumulateorders = false
indicator = macd[12,26,9]
n = 1
adxmin = 5
profitti = 70
perdite = 60
cl = indicator crosses over 0 and summation[n](indicator[1]<0)=n and adx[14]>adxmin
cs = indicator crosses under 0 and summation[n](indicator[1]>0)=n and adx[14]>adxmin
if cs then
sellshort 2 contract at market
endif
if cl then
buy 2 contract at market
endif
set target pprofit profitti
set stop ploss perdite