I have searched this site, gone through the replies by Nicolas, watched the video various times, checked youtube comments and sections, but I can’t seem to find the code for the “How to create a breakout box between 2 hours” ?
I would then apply the code I was trying to develop, into an automated system.
I was looking at the 5 minute chart, I was trying to build a breakout box for 11pm-6am. It would reset each day, and show high and low between the set times each day, see indicator below that somebody else wrote, but I have amended;
if time = 061000 then //
x1= barindex[0] //
x2 = barindex[86] //
yh = highest[86](high)
yL=lowest[86](low)
drawsegment(x1,yh,x2,yh) coloured (0,0,255)
drawsegment(x1,yL,x2,yL) coloured (255,0,0)
// set text offset from line
os = 4*pipsize
drawtext("#yh#",barindex,yh+os,SansSerif,bold,20) coloured(0,0,0)
drawtext("#yL#",barindex,yL-os,SansSerif,bold,20) coloured(0,0,0)
endif
return yh as "hi" ,yL as "Lo"
The code would work out the high and low between these times, 11pm-6am, and only trade between 8am and 8pm, it would close all trades at 9pm.
It would Buy, if the price crosses over the high, by 2 points, or sell, if the price crosses under the low, by 2 points.
Only 1 buy allowed per day and 1 sell allowed per day.
Stop loss 15, target 15.
I have read various topics and codes, it seems fairly straight forward, and is covered in various posts by various people, but not all together, I have tried to piece the codes together, but I can’t seem to make it all work. 🙁
Any help would be much appreaciated. 🙂