/ Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Conditions to enter long positions
indicator1 = Average[90](close)
c1 = (close[1] > indicator1[1])
indicator2 = MACDline[12,26,9](close)
indicator3 = ExponentialAverage[9](indicator2)
c2 = (indicator2[1] CROSSES OVER indicator3[1])
IF c1 AND c2 THEN
BUY 100 PERPOINT AT MARKET
ENDIF
// Conditions to exit long positions
indicator4 = MACDline[12,26,9](close)
indicator5 = ExponentialAverage[9](indicator4)
c3 = (indicator4[1] CROSSES UNDER indicator5[1])
IF c3 THEN
SELL AT MARKET
ENDIF
// Conditions to enter short positions
indicator6 = Average[90](close)
c4 = (close[1] < indicator6[1])
indicator7 = MACDline[12,26,9](close)
indicator8 = ExponentialAverage[9](indicator7)
c5 = (indicator7[1] CROSSES UNDER indicator8[1])
IF c4 AND c5 THEN
SELLSHORT 100 PERPOINT AT MARKET
ENDIF
// Conditions to exit short positions
indicator9 = MACDline[12,26,9](close)
indicator10 = ExponentialAverage[9](indicator9)
c6 = (indicator9[1] CROSSES OVER indicator10[1])
IF c6 THEN
EXITSHORT AT MARKET
ENDIF
// Stops and targets
SET STOP pLOSS 50
SET TARGET pPROFIT 200