hi;
is there a function to identify : from several chart is availabe on metatrader , how many of them have the same expert run on them. ?
or how can do this ?
use these case for calculating and used in money management.
I guess it's your own EA ? So you can, for example, use a global variable to "register" each instance of your EA.
yes.
thank to reply;
and then ; sum of them return and can see on all those chart we have the same equal number ?
how to count and sum ? ( sorry , i dont understand it )
1.) do you mean by : " GlobalVariablesTotal ()" and then by divide it on the number of global value we have in our expert ?
2.) if there was another ea send global vaue ?
yes.
thank to reply;
and then ; sum of them return and can see on all those chart we have the same equal number ?
how to count and sum ? ( sorry , i dont understand it )
1.) do you mean by : " GlobalVariablesTotal ()" and then by divide it on the number of global value we have in our expert ?
2.) if there was another ea send global vaue ?
simplest way is to use a single gv as a counter. your ea can add 1 in oninit and subtract 1 in ondeinit. if any ea crashes or somehow turns off or reinitialized without deinitializing though the count would be incorrect until you manually fix it... to circumvent that it seems like it will be a bit of work, I think you may have to use timestamps in individual gv's.
Why do the ea need to know this?
It might even be better to create a single ea that trades on multiple timeframes and currencies instead of trying to communicate between instances of the same ea:
- 2010.07.08
- Nikolay Kositsin
- www.mql5.com
simplest way is to use a single gv as a counter. your ea can add 1 in oninit and subtract 1 in ondeinit. if any ea crashes or somehow turns off or reinitialized without deinitializing though the count would be incorrect until you manually fix it... to circumvent that it seems like it will be a bit of work, I think you may have to use timestamps in individual gv's.
Why do the ea need to know this?
hi & thank you.
because of money management.
assume i want to have sum of volume ( lat ) for all my positions limited to 1 lot for every 10000$ balance,.
then ea divided the lot for each chart and send order such that total vol will be as we want i .
and if number of chart who has this expert , changed ; it can automatically redistribution .
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi;
is there a function to identify : from several chart is availabe on metatrader , how many of them have the same expert run on them. ?
or how can do this ?
use these case for calculating and used in money management.