// You can paste this anywhere inside the "public class <your indicator name> : Indicator" block of code, right before the "protected override void OnStateChange()" block // Function that displays chart loading progress for debug public void chartLoadProgress(string myTimeframe) // Takes "Intraday" or "Daily" edit as needed { double tempProgress = 0; double loadedProgress = 0; // For % loaded counter double myBars = 0; if (myTimeframe == "Intraday") { myBars = Convert.ToDouble(CurrentBars[0]); } else if (myTimeframe == "Daily") { myBars = Convert.ToDouble(CurrentBars[1]); } tempProgress = (myBars / Convert.ToDouble(Count)); loadedProgress = Math.Round(tempProgress, 2, MidpointRounding.AwayFromZero) * 100; if (loadedProgress < 100) { Print("Chart load progress: " + loadedProgress + "%"); } }
protected override void OnBarUpdate() { if(BarsInProgress == 0) // Primary intraday bar series { chartLoadProgress("Intraday"); // Display loaded percentage } }
Enjoy!