Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1452

 

Run the EA with an empty OnTick(). How much time will be spent? And then any line of code only adds time, not reduces it.

 
Aleksei Stepanenko:

Run the EA with an empty OnTick(). How much time will be spent? And then any line of code only adds time, not reduces it.

Thanks for the unexpected information. It turns out that the Expert Advisor spends most of its time on nothing( for doing nothing) and only a small part of its time executing code.....funny....
It's funny, isn't it possible to make an EA spend less time doing nothing?

 
All ticks are hard mode. You have 53,000 of them, the tester should be running them all before your code.
 
Aleksei Stepanenko:
All ticks are hard mode. You have 53,000 of them, the tester should be running them all before your code.
Q. Is it possible to make an EA in All ticks mode spend less time in MT4 or in MT5 for doing nothing?
 
No, just change the mode. I use the opening prices and the code I wrote you. If the strategy is not a pips strategy, you don't need such precision.
 
Aleksei Stepanenko:
No, just change the mode. I use the opening prices and the code I dropped to you. If the strategy is not pips, you don't need that kind of precision.

Thank you for the valuable information

 
ANDREY:

It turns out that the Expert Advisor spends most of its time on nothing (doing nothing)

It's not nothing, the tester is working - it's ticking.

-----

You're welcome :)
 
Aleksei Stepanenko:

it's not a blank, the tester is working at this point - ticking away.

-----

You're welcome :)

I wonder.... ticking is probably a figurative expression... and what exactly the tester does with each tick , if there is no single symbol in the program it works with, which would give the tester some command? I mean the variant with empty void OnTick(). Or does OnTick() tell it to do the same operations with each tick?

 
Aleksei Stepanenko:
All the ticks are heavy mode. You have 53 thousand of them, the tester must run them all, even before your code.

Ran empty void OnTick() 5 times on MT4 in mode BAR OPEN PRICES.

Ran on MT4 5 times empty void OnTick() on ALL Ticks mode.

The difference is minimal (less than 1 second). But in first case it "ticked" 3879 times. In the second case, it was executed 53255 times. The difference is 13 times. And the time difference is much smaller. And you say that ALL TIKES is hard mode.... It turns out that the TICKED mode is not much easier in terms of time expenditure.

True, I have a six-core processor.

 
Aleksei Stepanenko:
No, just change the mode. I use open prices and the code I wrote you. If the strategy is non-pipsing, you don't need such precision.

I understood what you said, so all other strategies except for pipsing can be tested on the model at OPEN PRICES. And the accuracy of code execution will not suffer in this case.

My strategy is not a scalping one (Take Profit 10 pips), but most of my orders are opened on one of the ticks within a minute candle. When testing by OPENING PRICES - out of 160 orders that were opened at EACH TICK, only 120 were opened and not at intra-minute prices (as the code requires) Probably this model will not suit some non-pipsing strategies as well.

Reason: