// Sets the chart panel back color to pale green BackBrush = Brushes.PaleGreen;
protected override void OnBarUpdate() { if (CotData.GetCotReportNames(Instrument.MasterInstrument.Name).Count == 0) { Draw.TextFixed(this, "Error", Custom.Resource.CotDataError, TextPosition.BottomRight); return; } if (!Core.Globals.MarketDataOptions.DownloadCotData) Draw.TextFixed(this, "Warning", Custom.Resource.CotDataWarning, TextPosition.BottomRight); if (CotData.IsDownloadingData) { Draw.TextFixed(this, "Warning", Custom.Resource.CotDataStillDownloading, TextPosition.BottomRight); return; } for (int i = 0; i < Number; i++) { if (!backCalculated && CurrentBar > 0) { for (int j = CurrentBar - 1; j >= 0; j--) { double value1 = reports[i].Calculate(Instrument.MasterInstrument.Name, Time[j]); if (!double.IsNaN(value1)) // returns NaN if Instrument/Report combination is not valid. Values[i][j] = value1; } } double value = reports[i].Calculate(Instrument.MasterInstrument.Name, Time[0]); if (!double.IsNaN(value)) // returns NaN if Instrument/Report combination is not valid. Values[i][0] = value; } backCalculated = true; }
Comment