// Definition of code parameters
DEFPARAM CumulateOrders = false
// Cumulating positions deactivated
// The system will cancel all pending orders and close all positions at 0:00. No new ones will be allowed until after the "FLATBEFORE" time.
DEFPARAM FLATBEFORE = 100000
// Cancel all pending orders and close all positions at the "FLATAFTER" time
DEFPARAM FLATAFTER = 155800
// Prevents the system from creating new orders to enter the market or increase position size before the specified time
noEntryBeforeTime = 100000
timeEnterBefore = time >= noEntryBeforeTime
Daysforbidden=Call"ASX Closed Days"
// Prevents the system from placing new orders to enter the market or increase position size after the specified time
noEntryAfterTime = 155900
timeEnterAfter = time < noEntryAfterTime
ONCE Start=100000
If Time=Start Then
TC=0
Endif
Bank= 6000
Capital=Bank//+Strategyprofit
risk=1
SHTPsize=Round((Risk/100*Capital)/sstp+.04,2)
LNGPsize=Round((Risk/100*Capital)/lstp+.04,2)
Timeframe(1hour,UPDATEONCLOSE)
FL,ignored=call"Harko_fractals BW"(1)
ignored,FH=call"Harko_fractals BW"(1)
Timeframe (Default)
// Conditions to enter long positions
c1= close crosses over FH
if c1 and TC<1 and timeEnterBefore AND timeEnterAfter AND Not Daysforbidden THEN
buy LNGpsize CONTRACT AT market
LTC=LTC+1
SET STOP ploss lstp//58
SET TARGET pPROFIT ltgt//32
ENDIF
//condition to enter short
c2=close crosses under FL
If c2 AND STC<1 And timeEnterBefore AND timeEnterAfter And NOT Daysforbidden THEN
Sellshort SHTPsize contract at Market
STC=STC+1
SET STOP ploss sstp// 54
SET TARGET pPROFIT stgt//90
Endif
//reverse position if stop hit
graph FH
graph FL