Hello
I have a simple query regarding a breakout strategy. I am trying to test a breakout strategy where I would like to get the High and the low between certain time frames in the day. For e.g. The hi and lo between 11:00 PM to 12:30 AM.
Firstly, I would like to know the code to identify the hi and low levels between the time frames mentioned above (11:00 PM – 12:30 AM).
After the first step I would like to know the code to identify the breakout bar. The condition for a successful breakout is the bar should open inside the range defined in the first step but close outside the range defined.
Kindly check the image file link or the attachment for better clarity.
http://postimg.org/image/3vitfqp0t/
I would really appreciate if anyone can help me with my query.
Thank you
D
Hello Delta,
I made a little indicator to show you how to deal with finding highest and lowest between 2 hours. (please find attached a file and a screenshot of the indicator). You’ll find it easy to include that code into your automated trading strategy.
starttime = 050000
endtime = 090000
if intradaybarindex=0 then
hh = 0
ll = 0
endif
if time>=starttime and time<=endtime then
if high>hh then
hh = high
endif
if low<ll or ll=0 then
ll = low
endif
endif
RETURN hh,ll