// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
DEFPARAM FLATAFTER = 210000
// Prevents the system from creating new orders to enter the market or increase position size before the specified time
noEntryBeforeTime = 080000
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
size = (2000/400) + ROUND(STRATEGYPROFIT / 800)
// Levels 0% and 100%
if OpendayofWeek <> 1 then
L0 = DLow(1)
L100 = DHigh(1)
elsif OpendayofWeek = 1 then
L0 = DLow(2)
L100 = DHigh(2)
Endif
GRAPHONPRICE L0
GRAPHONPRICE L0 + -23 COLOURED (200,0,0)
GRAPHONPRICE L100
GRAPHONPRICE L100 - 7 COLOURED (200,0,0)
// Conditions to enter long positions
c1 = high crosses over L0 + -23
//c12 = close > L25-5
IF c1 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
BUY size PERPOINT AT MARKET
SET TARGET PPROFIT 84
//SET STOP PLOSS SL
ENDIF
// Conditions to enter shortpositions
c3 = low crosses under L100 - 7
//c32 = close < L75+5
IF c3 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
SELLSHORT size PERPOINT AT MARKET
SET TARGET PPROFIT 70
//SET STOP PLOSS SL
ENDIF