// Definition of code parameters
DEFPARAM CumulateOrders = False// Cumulating positions deactivated
// Conditions to enter long positions
indicator1 = ExponentialAverage[5](close)
indicator2 = ExponentialAverage[100](close)
c1 = (indicator1 CROSSES OVER indicator2)
indicator3 = ExponentialAverage[5](close)
indicator4 = ExponentialAverage[200](close)
c2 = (indicator3 CROSSES OVER indicator4)
IF c1 AND c2 THEN
BUY 1 PERPOINT AT MARKET
ENDIF
// Conditions to exit long positions
indicator5 = ExponentialAverage[5](close)
indicator6 = ExponentialAverage[100](close)
c3 = (indicator5 CROSSES UNDER indicator6)
IF c3 THEN
SELL AT MARKET
ENDIF
// Conditions to enter short positions
indicator7 = ExponentialAverage[5](close)
indicator8 = ExponentialAverage[100](close)
c4 = (indicator7 CROSSES UNDER indicator8)
indicator9 = ExponentialAverage[5](close)
indicator10 = ExponentialAverage[200](close)
c5 = (indicator9 CROSSES UNDER indicator10)
IF c4 AND c5 THEN
SELLSHORT 1 PERPOINT AT MARKET
ENDIF
// Conditions to exit short positions
indicator11 = ExponentialAverage[5](close)
indicator12 = ExponentialAverage[100](close)
c6 = (indicator11 CROSSES OVER indicator12)
IF c6 THEN
EXITSHORT AT MARKET
ENDIF
// Stops and targets
SET STOP pLOSS 150