DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Prevents the system from creating new orders to enter the market or increase position size before the specified time
timeEnterBefore = time >= 070000
// Prevents the system from placing new orders to enter the market or increase position size after the specified time
timeEnterAfter = time < 220000
// 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[21](close)
indicator2 = Average[300](close)
c1 = (indicator1 > indicator2)
indicator3 = BollingerBandWidth[50](close)
c2 = (indicator3 > 0.003)
indicator4 = CCI[20]
c3 = (indicator4 CROSSES OVER -110)
IF (c1 AND c2 AND c3) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
BUY 1 CONTRACT AT MARKET
ENDIF
// Conditions to exit long positions
indicator5 = CCI[20]
c4 = (indicator5 CROSSES OVER 210)
IF c4 THEN
SELL AT MARKET
ENDIF
// Conditions to enter short positions
indicator6 = TEMA[21](close)
indicator7 = Average[300](close)
c5 = (indicator6 < indicator7)
indicator8 = BollingerBandWidth[50](close)
c6 = (indicator8 > 0.003)
indicator9 = CCI[20]
c7 = (indicator9 CROSSES UNDER 160)
IF (c5 AND c6 AND c7) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
// Conditions to exit short positions
indicator10 = CCI[20]
c8 = (indicator10 CROSSES UNDER -210)
IF c8 THEN
EXITSHORT AT MARKET
ENDIF
// Stops and targets
SET STOP pLOSS 25