find Chart ID
By looping through all open charts with ChartNext and filtering to only the charts you want.
- www.mql5.com
By looping through all open charts with ChartNext and filtering to only the charts you want.
i test with simple code :
long chartID=ChartFirst(); while(chartID >= 0) { Print(chartID); chartID = ChartNext(chartID); }
this code work in real time , but in ST output is only : 12345 (this is for first chart ID) .
I think the second chart in ST is an indicator with a different time frame than the main chart. In this case you should have the values already in your EA.
But you can start the EA on the timeframe of the indicator or you can change the indicator to m5 but showing the values of M30 - search for multi timeframe.
I use two time frame in Strategy Tester.
with function ChartID() i can find first chart id . who can i find second time frame (in this screenshot M30) Chart ID ?