Play videoPlease edit your post.
For large amounts of code, attach it.
- How can i make it work in tester as well?You can't. You must return from start() and count the number of times start() is called.
- and it works fine.And it uses all available CPU time both in the EA thread and in the GUI thread. You're probably missing ticks unless you have a fast enough processor.
Hi,
this code makes my EA loop until certain amount of ticks passes and it works fine.
The problem is in strategy tester. It makes the tester loop infinitly.
How can i make it work in tester as well?
Play videoPlease edit your post.
For large amounts of code, attach it.
- How can i make it work in tester as well?You can't. You must return from start() and count the number of times start() is called.
- and it works fine.And it uses all available CPU time both in the EA thread and in the GUI thread. You're probably missing ticks unless you have a fast enough processor.
Do it properly, count a tick each time start() is executed, if you haven't had enough ticks return(0);
I don`t want properly, i prefer by using RefreshRates, it`s more convinient in my EA.
So, RefreshRates in a loop will not work in tester?
Is there another way to count ticks without loop but using RefreshRates, that will work in tester too?
Thanks
I don`t want properly, i prefer by using RefreshRates, it`s more convinient in my EA.
So, RefreshRates in a loop will not work in tester?
Is there another way to count ticks without loop but using RefreshRates, that will work in tester too?
Thanks
yes, every tick is old fresh tick you have from history data
newer history you won't get testing
int start()
{
tick++;
I don`t want properly, i prefer by using RefreshRates, it`s more convinient in my EA.
So, RefreshRates in a loop will not work in tester?
Is there another way to count ticks without loop but using RefreshRates, that will work in tester too?
Thanks
If you don't want to do it properly, that is your choice. You should listen to RaptorUK and WHRoeder.
int max_ticks_to_wait = 50; // choose whatever number you want int current_tick_count = 0; int start() { if (current_tick_count <= max_ticks_to_wait) { current_tick_count++; return (0); } else current_tick_count = 0; // the rest of your code here return (0) }
RefreshRates() does nothing in the strategy tester, so you might wait forever. Neither does Alert(), so you have clear infinite loop with no option to break it.
RefreshRates() does nothing in the strategy tester, so you might wait forever. Neither does Alert(), so you have clear infinite loop with no option to break it.
Thank you all. It was helpfull.
I don`t want properly, i prefer by using RefreshRates, it`s more convinient in my EA.
So, RefreshRates in a loop will not work in tester?
Hi guys,
I know this thread is already a little bit old but I'm with the same problem as maniam01, and there is no start() function on my EA. Was it replaced for OnTick() in newer versions of MT4 or something like that ?
I'm totally newbie on MQL4 and strugling to backtest my first EA, I'll appreciate any help.
Thanks in advance.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- 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,
this code makes my EA loop until certain amount of ticks passes and it works fine.
The problem is in strategy tester. It makes the tester loop infinitly.
How can i make it work in tester as well?
Thanks.