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.
Size:
Color:
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.
Size:
Color:
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.
Size:
Color:
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.
Size:
Color:
Here's how I'd do it (not in a loop).
CODE:
Please log in to see this code.
Size:
Color:
Thanks guys. I didn't realize this could be done using SetScaleDaily. That's much easier than what I was attempting to do.
Size:
Color: