Result of WindowBarsPerChart() for a given chart changes when I navigate to another window
You have “an indicator attached to a chart.” You changed the chart, your indicator is now on the changed chart. There is no “original chart.”
You have “an indicator attached to a chart.” You changed the chart, your indicator is now on the changed chart. There is no “original chart.”
And yet if my trivial indicator were to have
Print(Bid); rather than
Print(WindowBarsPerChart()); then even by flicking between the charts of various symbols I would always see the price of the original chart.
I am trying to use the result of
in an MQL4 indicator attached to a chart. By using Print() I can view the result in the 'Experts' tab of the terminal window.
As I navigate between other symbols' chart windows I see that the value varies despite the indicator being attached only in the original window/chart.
I see the same behaviour if I expose the values of
and
I created a trivial indicator to attach to a chart to demonstrate the issue.
Is this expected behaviour? Especially in the case of the use of CHART_VISIBLE_BARS where the ChartID() has been explicitly defined.
Thanks,
James