that is, as long as CopyBuffer>0 we calculate it, and the new parameter (Close())
appears when the position is closed. In other words, we need to loop through While. It turns out like this.
I would put it this way: "While CopyBuffer<0, we repeat the call of this function".
The While (vhandle>0) line doesn't seem to carry any special load, because in case of first CopyBuffer<0 it will return(0);
I would work in this direction:
if(!PositionSelect(Symbol1) && !PositionSelect(Symbol2))
{
for(uchar u=0;u<100;u++) //запускаем цикл с ограниченным количеством шагов
{
if(CopyBuffer(vhandle,0,0,50,Sp1Buffer) && CopyBuffer(vhandle,1,0,50,Sp2Buffer))
{
return(true); //дождались копирования буферов - выходим
}
else
{
if(u==99) //т.е. выявляем последний шаг нашего цикла for, который не принёс ожидаемых результатов
{
Alert("Ошибка копирования буферов индикатора номер ошибки:",GetLastError());
return(0);
}
Sleep(50); //засыпаем ненадолго (хотя я сам не сторонник использования Sleep в теле OnTick)
}
}
}
In general, something along these lines, at the author's discretion. As rightly pointed out, a reference guide would not hurt.
Everything is clear about spreads, they are stored in bars and the tester can run the entire history, taking into account changing spreads (if the history is normally loaded), but what about swaps?
That is, what happens if broker/dealer changes rates of swaps or commission?
I understand the situation is a bit absurd, but still.
If I understand correctly now tester as in MT4 will take swaps and commission last....
Everything is clear about spreads, they are stored in bars and the tester can run the entire history, taking into account changing spreads (if the history is normally loaded), but what about swaps?
That is, what happens if a broker/dealer changes the size of swaps or commission?
The history of swaps and commissions is not stored, these settings are taken from the last connection
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Try reading about BarsCalculated in the help, which, by the way, gives the right example.
that is, as long as CopyBuffer>0 we calculate it, and the new parameter (Close())
appears when the position is closed. In other words, we need to loop through While. It turns out like this.
I would put it this way: "While CopyBuffer<0, we repeat the call of this function".
The While (vhandle>0) line doesn't seem to carry any special load, because in case of first CopyBuffer<0 it will return(0);
I would work in this direction:
In general, something along these lines, at the author's discretion. As rightly pointed out, a reference guide would not hurt.
Try to read in help about BarsCalculated, by the way, the right example is given there.
Thanks for the referral made - works, seems to have no issues (1 month tested)
Here is my working code for 1st pair
I would say: "as long as CopyBuffer<0, repeat calling this function".
The While (vhandle>0) line doesn't seem to be much load, because in case of first CopyBuffer<0 it would return(0);
I would work in this direction:
Basically, something like that, at the author's discretion. As rightly pointed out, a reference book wouldn't hurt.
It's even simpler, let's see which of these 2 approaches is better and faster - that's what we'll take,
Thank you all! Let's go to test.
developers, please pay attention to request #33601 (there is a "great feature" about leverage in different OSes)...
Perhaps you are using terminals originally installed from different brokers? Add details to your application, please.
Question for the developers.
Everything is clear about spreads, they are stored in bars and the tester can run the entire history, taking into account changing spreads (if the history is normally loaded), but what about swaps?
That is, what happens if broker/dealer changes rates of swaps or commission?
I understand the situation is a bit absurd, but still.
If I understand correctly now tester as in MT4 will take swaps and commission last....
PS
Clarified again, now with screenshots....
Question for the developers.
Everything is clear about spreads, they are stored in bars and the tester can run the entire history, taking into account changing spreads (if the history is normally loaded), but what about swaps?
That is, what happens if a broker/dealer changes the size of swaps or commission?
Swap and commission history is not stored, these settings are taken from the last connection