unsure about IsNewSession or if ok in NT8 or if IsFirstBarOfSession fix available?
using 8.0.0.9 64-bit.
protected override void OnBarUpdate()
{
// Switch a bool named takeTrades to false when IsNewSession() returns true.
if (Bars.SessionIterator.IsNewSession(DateTime.Now, true)) ;
{
Alert("EOS", Priority.Medium, String.Format("New session beginning. Waiting until {0} to begin trading again"), " ", 5, Brushes.Black, Brushes.White);
takeTrades = false;
}
// Set the bool back to true on the first bar of the new session
if (Bars.IsFirstBarOfSession)
takeTrades = true;
}

Comment