The log is showing many of these. Usually during startup while it refreshes the charts. But it does not occur all the time so could be multi-thread related also or of course my custom code.
Would it be possible to enhance all log error messages in the future with some standard context so it can be more easily traced to a particular chart? An example hacked-together context is shown at the bottom:
Thanks,
Chris
2017-02-22 21:22:11:825 ERROR: Failed to call OnRender() for chart object 'Region': ''barsAgo' needed to be between 0 and -1 but was 4590 Parameter name: barIndex'
2017-02-22 21:22:11:825 ERROR: Failed to call OnRender() for chart object 'Region': ''barsAgo' needed to be between 0 and -1 but was 4590 Parameter name: barIndex'
2017-02-22 21:22:11:825 ERROR: Failed to call OnRender() for chart object 'Region': ''barsAgo' needed to be between 0 and -1 but was 4590 Parameter name: barIndex'
2017-02-22 21:22:11:825 ERROR: Failed to call OnRender() for chart object 'Region': ''barsAgo' needed to be between 0 and -1 but was 4590 Parameter name: barIndex'
2
protected string DebugContext()
{
return String.Format("{0} (OBU): Bip {1} CurBar {2}, BAs {3}, BA0.Type/Type/Period/Count {4} {5} {6} {7}, Ba1.Count {8}",
InfoMsgBase(),
BarsInProgress,
CurrentBar,
BarsArray.Length,
BarsArray[0].BarsPeriod.BarsPeriodType,
BarsArray[0].BarsType,
BarsArray[0].BarsPeriod,
BarsArray[0].Count,
BarsArray.Length > 1 ? BarsArray[1].Count.ToString() : "",
Times[BarsInProgress][0].ToSortable());
}
protected string InfoMsgBase()
{
return String.Format("{0} {1} {2} {3} {4}",
GetType().Name,
GetHashCode().ToString("X"),
Instrument != null ? Instrument.FullName : "",
Bars != null ? Bars.BarsPeriod.BarsPeriodType.ToString() : "",
Bars != null ? Bars.BarsPeriod.Value : 0);
}
Comment