Hi Nicholas,
Could you please advise what’s different for X by using DailyHigh and High in “Highest[BarIndex – lastWeekBarIndex](X)”?
I observed some weeks having different result but I couldn’t explain why?
Which parameter is correct? I tried it on 4hours time frame.
to be sure, a screen capture of what was observed (what instrument and when) would help to answer, but without it, the only thing I can think of when reading this piece of code is:
if dailyhigh has been defined as Dhigh(1) (previous day) then
would include all highs from lastweekbarindex until today when searching the highest (but not high from day before lastweekbarindex).
So not knowing if it matches what you observed, I can only guess it is possible the differences you saw occured when current day high read by code was higher than any high from lastweekbarindex until previous day, or when a high the day before lastweekbarindex was higher than any high between lastweekbarindex and current day.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue