// Prevents the system from creating new orders to enter the market or increase position size before the specified time
noEntryBeforeTime = 143000
timeEnterBefore = time >= noEntryBeforeTime
noEntryBeforeTime2 = 201500
timeEnterBefore2 = time >= noEntryBeforeTime2
// Prevents the system from placing new orders to enter the market or increase position size after the specified time
noEntryAfterTime = 180000
timeEnterAfter = time < noEntryAfterTime
noEntryAfterTime2 = 203000
timeEnterAfter2 = time < noEntryAfterTime2
// Prevents the system from placing new orders on specified days of the week
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
//timeframe (10 minute, updateonclose)
//max orders each day
if intradaybarindex=0 or day<>day[1] then
orderscount=0
endif
allowtrading=orderscount<maxDayOrder and ((timeenterbefore and timeenterafter) or (timeenterbefore2 and timeenterafter2)) and not daysforbiddenentry