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
Ok thanks, but I will try a few more things to see if I can reduce dropped ticks a bit.
Just testing some things I found something surprising. This little script takes 10 whole seconds to do the 9999 iterations
I realise an average 1ms per iteration is nothing really but the dll does more operations and takes 0.5 secs to do 1,000,000 iterations.
Yes the C++ code stores the string in memory
but that's after a few checks to see if it's really a new tick and checking if it's a new hour. The values are turned to strings with stringstream.
Maybe running the dll repeatedly in the same start function reduces some kind of dll 'calling' time..?
Yes the C++ code stores the string in memory
but that's after a few checks to see if it's really a new tick and checking if it's a new hour. The values are turned to strings with stringstream.
Maybe running the dll repeatedly in the same start function reduces some kind of dll 'calling' time..?
So your DLL code is different . . . no suprise that it may be quicker then.
I'm still surprised! An external dll can do the same things and more in a 2000th of the time it takes mql!
Maybe StringConcatenate() and DoubleToStr() are really, really slow . . .
That seems to be it. + is faster than StringConcatenate with just 2 or 3 strings to be joined, but not more. Using + in that script doubles the time taken.
So it seems I've got the highest granularity (??) without skipping MT4 altogether.
Ohhh, I see my mistake now, the Volume was fixed in the loop calling the dll, so i wasn't processing all those ticks.
Actually 10000 iterations takes 1 second, which is still 10 times faster than StringConcatenate, but much slower than writing straight to file
Still, well done to MQ if they did take effort to improve the speed of calling the DLL
So yes, for anyone actually reading this... the fastest way to get ticks seems to be use FileOpen in Init, FileWrite in Start and FileClose in Deinit
And if you know how to let MT4 retain control after calling a dll function, let me know
meh. despite all the speed tests, the DLL is still picking up more ticks. I tested side by side with just writing the values straight to file.
Strangely... the ticks missed writing straight to file came BEFORE a very short gap, not AFTER. I assumed ticks were missed because the Start function was running when it arrived.. but seemingly not. Unless the volume number is not a unique indicator for each tick.
meh. despite all the speed tests, the DLL is still picking up more ticks. I tested side by side with just writing the values straight to file.
Strangely... the ticks missed writing straight to file came BEFORE a very short gap, not AFTER. I assumed ticks were missed because the Start function was running when it arrived.. but seemingly not. Unless the volume number is not a unique indicator for each tick.