You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hope for further guidance.
Quark
admits that between(GlobalVariableGet(strTradeSemaphore) == 0.0) and GlobalVariableSet(strTradeSemaphore, 1.0); another EA will cut in. We need a function that will capture and inhibit the execution thread (i.e. wait for the resource) and then return control to the Expert Advisor. Something like WaitForExclusive()
. Although, perhaps it is not the point. But the errors keep appearing, alas.
Hope to get some help.
By the way, now that this conversation has started, how can I automatically determine how many digits to leave for the price using NormalizeDouble, i.e. 4 for EURUSD, 2 for EURJPY... ?
Error 138. Several times a minute (i.e. several of 12 Expert Advisors generate it).
Error 129. I was rationing prices and doing a lot of other things...
and your Expert Advisor with my 5 gave me one error - 6.
my Expert Advisor does not work in my correction - they messed up in this build =)
oh yeah... my 5 doesn't work either =)))) here we go...
and your Expert Advisor with my 5 gave one error - 6.
my Expert Advisor does not work in my correction - they messed up in this build =)
oh yeah... my 5 doesn't work either =)))) oh man...
Thanks for the code, it would have taken me a long time to find it myself.
The expert suggested by Slava and improved :) by me is given below. You can run it like me - in 12 windows, with 12 currencies. It works for any timeframe, but it's faster on minutes.) I keep getting errors, damn it. I wish I knew why.
. Although, perhaps it is not the point. But alas, the errors keep appearing.
this is exactly what i meant about hypothetical function GlobalVariableSetOnCondition, that could set global variable as first parameter, provided its value is equal to the value of second parameter. since access to global variables is blocked, it will give "atomicity"
now about function IsStopped. it checks stop flag, so that EA could normally stop (it has 2.5 seconds for that). it is recommended to use this function as one of loop conditions, especially infinite
Slava, for the life of me, I don't understand this text. Please explain it in other words, or show me what you mean. If you can.
By the way, what's wrong in the code I've rewritten? I mean, it's clear that something is wrong because it doesn't work, but I don't see the error. According to my hunch, this is what should have provided exclusive access...
именно так. я поэтому и говорил про гипотетическую функцию GlobalVariableSetOnCondition, которая могла бы устанавливать глобальную переменную первым параметром при условии, что значение её равно значению второго параметра. так как доступ к глобальным переменным блокируется, то это даст "атомарность"
Slava, for the life of me, I don't understand this text. Either explain it in other words, or show me what you mean. If you can.
We are talking about preventing the possibility of wedging between calls of GlobalVariableGet and GlobalVariableSet functions. wedging by another Expert Advisor is real since errors are still observed. this is why I'm talking about atomic access. you and I are talking about solving one and the same problem but in different words
.
By the way, what's wrong in the piece of code I reworked? I mean, it's clear that something is wrong as it doesn't work, but I don't see the error. According to my hunch, this is what should have provided exclusive access...
Your example is better