// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Conditions to enter long positions
indicator1 = Momentum[12](close)
c1 = (indicator1 >= 0)
indicator2 = Momentum[12](close)
indicator3 = Average[20](Momentum[12](close))
c2 = (indicator2 >= indicator3)
indicator4 = DIplus[14](close)
indicator5 = DIminus[14](close)
c3 = (indicator4 >= indicator5)
indicator6 = DIplus[14](close)
c4 = (indicator6 >= 23)
indicator7 = ExponentialAverage[8](close)
indicator8 = ExponentialAverage[89](close)
c5 = (indicator7 >= indicator8)
IF c1 AND c2 AND c3 AND c4 AND c5 THEN
BUY 1 CONTRACT AT MARKET
ENDIF
// Conditions to exit long positions
indicator9 = Average[20](Momentum[12](close))
indicator10 = Momentum[12](close)
c6 = (indicator9 CROSSES OVER indicator10)
IF c6 THEN
SELL AT MARKET
ENDIF
// Conditions to enter short positions
indicator11 = Momentum[12](close)
c7 = (indicator11 <= 0)
indicator12 = Average[20](Momentum[12](close))
indicator13 = Momentum[12](close)
c8 = (indicator12 >= indicator13)
indicator14 = DI[14](close)
indicator15 = DI[14](close)
c9 = (indicator14 >= indicator15)
indicator16 = DIminus[14](close)
c10 = (indicator16 >= 23)
indicator17 = ExponentialAverage[8](close)
indicator18 = ExponentialAverage[89](close)
c11 = (indicator17 <= indicator18)
IF c7 AND c8 AND c9 AND c10 AND c11 THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
// Conditions to exit short positions
indicator19 = Momentum[12](close)
indicator20 = Average[20](Momentum[12](close))
c12 = (indicator19 CROSSES OVER indicator20)
IF c12 THEN
EXITSHORT AT MARKET
ENDIF
// Stops and targets
SET STOP pLOSS 25
SET TARGET pPROFIT 50