3) how many lines of what? code?
yes, lines of code.
any idea?
wing
Sometimes complex calculations can be executed by an EA and as a result the duration of start() execution can be longer and reach tens of seconds. In these cases start() function will not be started on every tick but only on the ticks that came while the start() is waiting for them. The fig. 159 shows that the tick that came at the execution of the start() function period (at the t4 moment) will not cause a new special function's start. The next time the start() function will start at the t5 moment. The pause between the end of the current execution and the beginning of the next execution of the start() function will appear with this provision.
From the MQL4 book. I thought i remembered something like "if a calculation on single tick exceeds N seconds, the calculation is terminated and the next tick is received", but after searching for that statement now, i didn't find it so i guess i was wrong :))
So technically you can do a number of calculations per second in order of the frequency of you cpu, so in it's in the billions of calcs/sec. This is a lot of lines of code if you code stuff well or it's a line of code for any buggy infinite loop.
2) Tbh I'm unsure about this one, but there's only 1 thread in MT4 (and 5 iirc) so you're limited to a single thread of operations. This means that a wave(sound) is started, it plays and if another comes along, the first one will be interrupted and so on. You could technically overcome this by checking how long the sound is and "Sleep()"-ing the execution of EA for the duration. It would be a totally uneffective solution though and I wouldn't use it. Hopefuly soemone else will offer a better one.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear all
I would like to ask for your help on two questions:
1) this seems to be an old question but I still can't find answer from this place : how can Playsound and Alert command work simultaneously in an "indicator"? Does it can't be solved in MT4?
2) If an indicator plays multiple sound files simultaneously, some of them can't be played completely and will be interrupted in the middle. any solutions?
3) How many lines can be run within a tick by an MT4 indicator/EA? Does anybody know?
Kindly thanks to the one who would like to give me a hand!
Wing