Doerk:
Yes it's possible with Scope Resolution Operator.
Aloha,
...Direct import via DLL is not possible, because of the reserved word GetTickCount in MT. I don´t want to code a separate DLL just because of this silly feature ...
Thanks
Doerk
Yeah, thank you. Sometimes the answer is just in front of your eyes and one doesn´t recognize it ;) But reading the testers speed isn´t possible, right?
Doerk:
Yeah, thank you. Sometimes the answer is just in front of your eyes and one doesn´t recognize it ;) But reading the testers speed isn´t possible, right?
Unfortunately no, at least with mql4/5. Maybe with WINAPI but I never tried.
Yeah, thank you. Sometimes the answer is just in front of your eyes and one doesn´t recognize it ;) But reading the testers speed isn´t possible, right?
But the difference between two GetTickCount() call gives you the time between the generated ticks and that is independet of simulated time (at least on my MQL4 and MQL5 terminals).
This is a quick example. But I am curious what for do you need that values?
Uwe
uint oldtc; int oldspeed; int prevspeed; int oldtrigger; void OnTick() { int newspeed = GetReplaySpeed(); if (newspeed!=oldspeed) { if (oldtrigger==3) // prevent inbetween values { Print(newspeed); oldspeed=newspeed; oldtrigger=0; } if (newspeed==prevspeed) oldtrigger++; else oldtrigger=0; prevspeed=newspeed; } } int GetReplaySpeed() // difference between to OnTick calls { int speedval=32; // max speed uint tc = GetTickCount(); uint diff = tc-oldtc; oldtc=tc; if (diff>16000) speedval=1; else if (diff>12000) speedval=2; else if (diff>8000) speedval=3; else if (diff>6000) speedval=4; else if (diff>4000) speedval=5; else if (diff>3000) speedval=6; else if (diff>2000) speedval=7; else if (diff>1500) speedval=8; else if (diff>1000) speedval=9; else if (diff>900) speedval=10; else if (diff>820) speedval=11; else if (diff>750) speedval=12; else if (diff>690) speedval=13; else if (diff>630) speedval=14; else if (diff>570) speedval=15; else if (diff>510) speedval=16; else if (diff>470) speedval=17; else if (diff>430) speedval=18; else if (diff>390) speedval=19; else if (diff>360) speedval=20; else if (diff>330) speedval=21; else if (diff>300) speedval=22; else if (diff>270) speedval=23; else if (diff>240) speedval=24; else if (diff>210) speedval=25; else if (diff>180) speedval=26; else if (diff>150) speedval=27; else if (diff>120) speedval=28; else if (diff>090) speedval=29; else if (diff>060) speedval=30; else if (diff>030) speedval=31; return(speedval); }
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
Aloha,
does somebody know if it´s possible to read the speed-value of the strategy tester? Or, if this is not possible, a way to get the real value of GetTickCount() from the Windows Kernel32.dll, because GetTickCount() is matched to the simulated server time in the strategy tester, but I would need the real value? Direct import via DLL is not possible, because of the reserved word GetTickCount in MT. I don´t want to code a separate DLL just because of this silly feature ...
Thanks
Doerk