// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Prevents the system from placing new orders on specified days of the week
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
// Conditions to enter long positions
indicator1 = TEMA[10](close)
indicator2 = SuperTrend[3,10]
c1 = (indicator1 > indicator2)
indicator3 = CCI[20]
c2 = (indicator3 CROSSES OVER -150)
IF (c1 AND c2) AND not daysForbiddenEntry THEN
BUY 1 CONTRACT AT MARKET
ENDIF
// Conditions to exit long positions
indicator4 = CCI[20]
c3 = (indicator4 CROSSES UNDER 200)
IF c3 THEN
SELL AT MARKET
ENDIF
// Conditions to enter short positions
indicator5 = TEMA[10](close)
indicator6 = SuperTrend[3,10]
c4 = (indicator5 < indicator6)
indicator7 = CCI[20]
c5 = (indicator7 CROSSES UNDER 180)
IF (c4 AND c5) AND not daysForbiddenEntry THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
// Conditions to exit short positions
indicator8 = CCI[20]
c6 = (indicator8 CROSSES OVER -300)
IF c6 THEN
EXITSHORT AT MARKET
ENDIF
// Stops and targets
SET STOP %LOSS 0.5