I've attached an indicator which demonstrates an issue I've been experiencing using IsLastBarOfSession on a secondary data series that has a different session template applied than the primary dataseries.
The script adds 2 data series for CL 01-17, one with the RTH session template applied, the other with ETH. I then apply this indicator on a CL 01-17 chart with the same period and an ETH template, so Bars series 0 and Bars series 2 are the same session, where Bars series 1 is an RTH session. Periods of all series are the same (30 minute).
The script goes through each Bars series update and if IsLastBarOfSession is true, it prints out the series number, bar number, date and time.
The problem I am experiencing is inconsistent results on the last bar of the RTH series - sometimes not returning "true". It appears this usually occurs primarily on the last bar from the prior day to Today. For example, here is the tail end of the output of the indicator from this morning on a 30 minute CL Nymex Metals - Energy ETH chart loading 15 days.(pacific timezone):
Bars 0 - Last Bar Of Session: 350 12/2/2016 12:00 AM 140000
Bars 2 - Last Bar Of Session: 350 12/2/2016 12:00 AM 140000
Bars 1 - Last Bar Of Session: 91 12/5/2016 12:00 AM 113000
Bars 0 - Last Bar Of Session: 396 12/5/2016 12:00 AM 140000
Bars 2 - Last Bar Of Session: 396 12/5/2016 12:00 AM 140000
Bars 1 - Last Bar Of Session: 102 12/6/2016 12:00 AM 113000
Bars 0 - Last Bar Of Session: 442 12/6/2016 12:00 AM 140000
Bars 2 - Last Bar Of Session: 442 12/6/2016 12:00 AM 140000
Bars 0 - Last Bar Of Session: 488 12/7/2016 12:00 AM 140000
Bars 2 - Last Bar Of Session: 488 12/7/2016 12:00 AM 140000
Note that Bars series 1 does not fire a "last bar" for 12/7 (yesterday).
Please let me know if I've missed something, if this is expected, or if you might suggest a better way to determine the end of a secondary bar series session.
Thank you,
greagrea
Comment