Well technically it is possible to have an EA work with other charts so in that sense the all other charts can be directed from other EA's but in those cases the EA itself isn't attached (initialized) onto the chart so if the chart is running another EA that is initialized on the chart itself it will still not count as two Ea's on one chart.
hongbin fei: How can we using code DETERMINE How many EA is running and attached the chart?
Maybe youcanuse theexample ofcodetofind out how manyEA theattachedon the chart.
string eaname="YOUREANAME";
//--long currChart,prevChart=ChartFirst();
int c=0,ex=0,cht=36; // not more than 36 open chartswhile(c<cht)
{
currChart=ChartNext(prevChart); // Get the new chart ID by using the previous chart IDif(currChart<0) break; // Have reached the end of the chart list
prevChart=currChart; // let's save the current chart ID for the ChartNext()if(WindowExpertName()==eaname) {ex++;} // sum EA attachted on chart
c++; // Do not forget to increase the counter
}
//--Print("-----Total EA ",eaname," attached on the charts are ",string(ex));
code an EA to save template file of each chart, then make EA to read template file and get EA name.
Dear hongbin fei,
Please try and attach two EA's to a single chart.
Let me know if you succeed.
how can I know the EAs is running or trade not allowed?
excellent advice!
How can we using code DETERMINE How many EA is running and attached the chart?
Maybe you can use the example of code to find out how many EA the attached on the chart.
read template file, if it have EA name, EA running. value of flags = 343 : allow live trading and allow both long, short.
read template file, if it have EA name, EA running. value of flags = 343 : allow live trading and allow both long, short.
I saved the chart to template, but error while open:
2016.07.12 00:39:34.515 Notify GBPUSD,M30: Failed to open C:\Program Files\MetaTrader 4 IC Markets\templates\MVE131127257216093752.tpl file, Error code = 5002
Thanks for help.
better use DLL to copy the file to Experts\Files