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
noEntryBeforeTime = 090000
timeEnterBefore = time >= noEntryBeforeTime
// Prevents the system from placing new orders to enter the market or increase position size after the specified time
noEntryAfterTime = 160000
timeEnterAfter = time < noEntryAfterTime
// Prevents the system from placing new orders on specified days of the week
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
// Conditions to enter long positions
c1 = (close CROSSES OVER high[1])
indicator1 = ExponentialAverage[50](close)
c2 = (close > indicator1)
IF (c1 AND c2) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
BUY 1 CONTRACT AT MARKET
ENDIF
// Conditions to exit long positions
c3 = (close < low[1])
IF c3 THEN
SELL AT MARKET
ENDIF
// Conditions to enter short positions
c4 = (close CROSSES UNDER low[1])
indicator2 = ExponentialAverage[50](close)
c5 = (close < indicator2)
IF (c4 AND c5) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
// Conditions to exit short positions
c6 = (close > high[1])
IF c6 THEN
EXITSHORT AT MARKET
ENDIF
// Stops and targets
SET STOP pLOSS 25
SET TARGET pPROFIT 25