Getting Symbol info in Services
Hi please try to see if this code works:
//--- variables for chart ID long currChart,prevChart=ChartFirst(); int i=0,limit=100; Print("ChartFirst =",ChartSymbol(prevChart)," ID =",prevChart); while(i<limit)// We have certainly not more than 100 open charts { currChart=ChartNext(prevChart); // Get the new chart ID by using the previous chart ID if(currChart<0) break; // Have reached the end of the chart list Print(i,ChartSymbol(currChart)," ID =",currChart); prevChart=currChart;// let's save the current chart ID for the ChartNext() i++;// Do not forget to increase the counter }What Script are you trying to read exactly ?
Hi please try to see if this code works:
What Script are you trying to read exactly ?
I am have opened 2 charts one for EPM21, and second for ENQM21.
What I am trying to do is write all L1 and L2 data to file for open charts. This is just for learning purpose and my first code in MQL and I was stuck in start of it.
Okay I'm glad you got it to work.
There are many examples in the documentation.
It is working, thanks for the help.
I am have opened 2 charts one for EPM21, and second for ENQM21.
What I am trying to do is write all L1 and L2 data to file for open charts. This is just for learning purpose and my first code in MQL and I was stuck in start of it.
Hi,
I am new to MQL5 and wanted to build a Service to monitor/send data of multiple charts to some other app/file.
But as documentations states that we cannot use Symbol() function in Services, if tried following codes
and
but ChartID() is returning me an ID which I am using to get info of Symbol, but it is returning me empty string.
Please guide me how can I get Symbol info in Services.
Thanks.