protected override void OnBarUpdate()
{
if (CurrentBar < BarsRequiredToTrade)
return;
// I wish the line below could be called only for back-test charts and live charts, not during back-tests
// that are running invisibly in memory, because it is a waste of computer resources.
[COLOR="Red"]if (ChartControl != null) [COLOR="Blue"]//meaning that we are on a chart, and will only draw if we are on a chart[/COLOR]
{[/COLOR]
SolidColorBrush myCustomSolidBrush = ComputationallyExpensiveMethodToGetACustomBrush();
Draw.Dot(this, GetNewUniqueIdForThisDrawingObject(), true, 0, High[0], myCustomSolidBrush, false);
[COLOR="red"]}[/COLOR]
}



Comment