It is now Sunday 6/28, but still Friday 6/26 session bar event is not fired, even though it is drawn on the StrategyPlot.
Example:
Create new chart, instrument = "MSFT", Period = Daily, BarsBack = 2
Strategy code:
protected override void Initialize()
{
CalculateOnBarClose = true;
BarsRequired = 0;
}
protectedoverridevoid OnBarUpdate()
{
string logText = "";
logText = String.Format("Instrument:{0} CurrentBar:{1} Date:{2}", Instruments[BarsInProgress], CurrentBar, Time[0]);
Log(logText, LogLevel.Information);
}
Output:
Category Message
Default Instrument:MSFT Default CurrentBar:0 Date:6/25/2009 00:00:00
Changing the BarsBack property results in the OnBarUpdate event firing for all bars except the last one.
If BarsBack is set to 1, this error occurs:
Error on plotting last value for indicator 'StrategyPlot'. Please check the 'OnBarUpdate' method: Index was out of range. Must be non-negative and less than the size of the collection.
Should not OnBarUpdate fire for the last completed bar?

Comment