I wish to print certain information in my Output window including the time interval of the current chart I am using my indicator on.
The below code works fine and prints me "5" when I use the indicator on a 5-minute chart. However, the integer time_interval is not available in OnBarUpdate() where I need it - the error CS0103 says "The name "time_interval" does not exits in the current context".
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
int time_interval = chartControl.BarsPeriod.Value;
Print(time_interval);
}
Does anybody know how I have to change my code to make that happen?
Thank you, P

Comment