I'm trying to create an indicator which requires the use of True High and True Low of the previous day. True High is defined as the higher of yesterday's high and the close 2 days ago while true low is defined as the lower of yesterday's low and the close 2 days ago. Upon calculating that, I'd like to transpose that information (true high and true low) to today's intraday chart. Could someone please help?
DClose2 gets value DClose1 then DClose1 gets new value Close and DClose2 <> Close, DClose2 still remain value of DClose1.
It use Bars.SessionBreak (This property returns true if the call to OnBarUpdate() is the first call of the session). So it is a new day and saved DayClose became DayClose 2 day ago. Because first bar of the session, Close (close of 1 bar ago) = yesterday's Close.
So there was a mistake in DClose1 = Close[-1] should be DClose1 = Close of course.
Yes. Just test it!
Last edited by Eloy; January 20th, 2010 at 03:40 PM.
The following user says Thank You to Eloy for this post: