The Bars.GetDayBar(1) call will return the day bar for the previous session. On a day bar this is straight forward as each bar is a complete session and will always return the previous session. On a minute bar this is not as straight forward because a minute bar could be part of different sessions depending on when the bar is made.
If you would like this to work differently with a minute bar and not reference the previous session how would you suggest this works?
Regarding your script, we can modify this so that it is working the way you would like.
If a bar comes out after 5 PM Eastern you can ignore that bar, or you can have it reference the second previous session to match the call made by bars before 5..
For example:
if (ToTime(Time[0]) < 170000)
{
Print(Bars.GetDayBar(1);
}
else
{
Print(Bars.GetDayBar(2);
}
If a bar is after 5 PM, what would you like to see from it? The current session starting at 5, the previous session starting at 5 the previous day, or the session before that starting at 5 2 days previous?

Comment