New daily high using intraday bars
Author: trader rog
Creation Date: 6/28/2011 11:53 AM
profile picture

trader rog

#1
I'm looking for the previous day's high to have reached a new 10 day high using intraday bars. The following code doesn't work but I think it's almost there. Can someone please have a look?

CODE:
Please log in to see this code.
profile picture

Eugene

#2
high1dayhigh[bar1] here is the High price of the bar1 dynamically changing with bar number.

If you intended to compare the today's High, then you need to keep saving High[bar] in a variable (let's call it highOfDay) and compare the High[bar] with that variable. If the current High is not higher than the highOfDay, then the highest reached price have remained. Now, compare highOfDay and high10dayhigh.
profile picture

trader rog

#3
My intention is for bar1 to be the closing bar of the previous day and to remain static. I'm looking for yesterday's high to have reached a new 10 day high.

I think I left out an important detail. I am trying to use it in this loop:

CODE:
Please log in to see this code.
profile picture

Eugene

#4
I misread your post.

Although the reason of avoiding SetScaleDaily is unknown to me, how about shifting the Daily High one bar to get yesterday's high?
CODE:
Please log in to see this code.
profile picture

Cone

#5
Here's how I'd do it (not in a loop).

CODE:
Please log in to see this code.
profile picture

trader rog

#6
Thanks guys. I didn't realize this could be done using SetScaleDaily. That's much easier than what I was attempting to do.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).