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

 
ANDREY:

And what exactly does the tester do with each tick , if there is not a single symbol in the program it is running, which would give the tester a command?

Well, the tester creates a simulation of the market. It sends a new price to your EA at every tick. And because there are 53 thousand ticks, it needs considerable time to send them all. All this happens before the EA code is executed. What to write in the EA is the programmer's business and has nothing to do with the work of the tester.

 

The total time includes the tester run time and the tester preparation time. Your tester run time is minimum (processed in) in both modes. The preparation time is standard regardless of the mode.

 
ANDREY:

When testing at OPENING PRICES - out of 160 orders which were opened at EACH TICK, only 120 were opened, and besides not at intra-minute prices (as the code requires).

Here everything is in the hands of the programmer: how to construct the logic, how it will work, look for errors in understanding of the program.

Working on ticks on a long history takes a lot of time. And since there will be a great number of tester runs, the calculation time must be reduced. Therefore, it is better to develop an Expert Advisor with control of opening of a new bar and use the mode - by opening prices. And then study and analyze what is wrong.

 
Aleksei Stepanenko:

Well, the tester creates a simulated market operation. It sends a new price to your EA on every tick. And since there are 53 thousand ticks, it takes a significant amount of time to send them all. All this happens before the EA code is executed. What to write in the EA is the programmer's business and has nothing to do with the work of the tester.

Thank you for the information. However, the yellow and gray phrases seem to contradict each other. It appears that the tester will send ALL ticks with prices to my Expert Advisor by the moment the OnTick() function starts working. But, when OnTick( ) starts working , the tester will not send ticks with prices to the Expert Advisor. In this case, what if it's not ticks that will process program lines of my EA? I'm sorry if I've misunderstood you.

 
Aleksei Stepanenko:

Everything here is in the hands of the programmer: what kind of logic to build, how it will work, look for errors in understanding how the program works.

Working on ticks on a long history takes a lot of time. And because the tester will run a great number of times, the calculation time must be reduced. Therefore, it is better to develop an Expert Advisor with control of opening of a new bar and use the mode - by opening prices. And then study and analyze what is wrong.

Do you agree that if the orders are opened within a minute candle on ticks, the model BAR OPENING PRICES will not open orders at ticks prices within a minute candle? Even if we control the opening of each minute candle.

 
Aleksei Stepanenko:

The total time includes the tester run time and the tester preparation time. Your tester run time is minimum (processed in) in both modes. Preparation takes the standard time irrespective of the mode.

This means that you can only save the tester run time on processed in

 
Hello! I did not know where to write a little off-topic, I need an indicator for Binance application, there is a "configurable indicator" added by direct entry of a code. If you can help, here's the assignment:
"Identifying an impulse candle"

1. Comparing the body size of a just closed candlestick with previous candlesticks (number of previous candlesticks X (should be changed in the indicator parameters window or in the code itself?)

2. the candlestick must be larger than the previous candlesticks by Y% (possibility to change the Y in the indicator parameters window or in the code)

3. the shadow of a candlestick makes not more than Z% of the candlestick body (it should also change)

When all three conditions are fulfilled, it is desirable to send a notification to the email.
I already have one in luac format, but I need it on Binance.

 
ANDREY:

It turns out that the tester will send ALL ticks with prices to my Expert Advisor by the moment when OnTick() function starts working.

OnTick() is the function of event capturing, where the event is arrival of a tick to the terminal, or imitation of such arrival in the tester. If there is a code in OnTick(), it will execute every incoming tick. If a new tick comes at the moment of processing the old tick, the new tick is not placed in the queue but skipped (in the trade mode). If there is no code in OnTick(), the tick also activates this function, but the code is not there, so there is nothing to execute.

 
Aleksei Stepanenko:

OnTick() is an event catching function, where the event is the arrival of a tick in the terminal, or a simulated arrival in the tester. Ticks come one after another, and activate the function. If there is code in OnTick(), then it processes every tick that comes. If a new tick arrives while the old one is being processed, the new tick is skipped and not put into the queue. If there is no code in OnTick(), the tick also activates this function, but there is no code there, so there is nothing to work out.

Got it. Thanks.

 
Hello, can you please help me understand why PrintFormat() needs the % sign, if without it the values are logged as in Print()?
PrintFormat("%s %d: shoulder = 1:%I64d",
server,login,leverage);