int bars=Bars(_Symbol,_Period);
if(bars>0)
{
Print("Количество баров в истории терминала по символу-периоду на данный момент = ",bars);
}
else//нет доступных баров
{
//--- видимо, данные по символу не синхронизированы с данными на сервереbool synchronized=false;
//--- счетчик циклаint attempts=0;
// сделаем 5 попыток дождаться синхронизацииwhile(attempts<5)
{
if(SeriesInfoInteger(Symbol(),0,SERIES_SYNCHRONIZED))
{
//--- есть синхронизация, выходим
synchronized=true;
break;
}
//--- увеличим счетчик
attempts++;
//--- подождем 10 миллисекунд до следующей итерацииSleep(10);
}
//--- вышли из цикла по факту синхронизацииif(synchronized)
{
Print("Количество баров в истории терминала по символу-периоду на данный момент = ",bars);
Print("Самая первая в истории терминала дата по символу-периоду на данный момент = ",
(datetime)SeriesInfoInteger(Symbol(),0,SERIES_FIRSTDATE));
Print("Самая первая дата в истории по символу на сервере = ",
(datetime)SeriesInfoInteger(Symbol(),0,SERIES_SERVER_FIRSTDATE));
}
//--- синхронизация данных так и не была достигнутаelse
{
Print("Не удалось получить количество баров на ",_Symbol);
}
}
also, reference to prices in OnTick should be (so that third-party characters are loaded).
Also, there should be a reference to prices in OnTick (so that third-party characters are loaded).
This does not solve the problem of the original
SymbolInfoDouble(euSY06,SYMBOL_BID,euSY06b) is always filled with value when used correctly. For some reason the correct value for the required symbol does not come. And it seems to be filled using the previous value received, which is the value of one of the other seven currencies.
If there is no solution, and this solution I am looking for more than a month, I feel that it is just a bug tester. Developers please pay attention to this. If it is a bug fix it
But when I test one of my multisymbol indicators, the list of symbols from the string of input parameters is loaded in OnInit. And their prices are accessed in OnCalculate. Moreover, when I set to load symbols from Market Watch, only one basic symbol appears in the tester.
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.
Be consistent. If you check
then check and
:)
If you do this, and there are seven such lines in the code for seven pairs, then the market overview will only have quotes for one currency.
Be consistent. If you check
then check and
:)
It's better than just
euSY01b>0If you check synchronisation, it only works for one currency. I need to analyse 7 currencies at a time.
I need to do it in OnInit()
If you check synchronisation, it only works for one currency. And I need to analyse 7 currencies in a moment.
As a crutch, you could try to remember the time when the pair was last synchronised and use that as a reference.
Also, you can use SymbolInfoTick() for ask and bid
Forum on trading, automated trading systems and trading strategy testing
Bugs, bugs, questions
Yury Lemeshev, 2022.01.02 08:54
This is more correct than just
euSY01b>0it is like true == true, result: true. and false == true, result: false :)
this is exactly the result you get if
or
If you do this, and there are 7 such lines in the code for seven pairs, then the market overview will only show quotes for one currency.
try calling Bars in OnTick
https://www.mql5.com/ru/docs/series/bars
from the article:
also, reference to prices in OnTick should be (so that third-party characters are loaded).try calling Bars in OnTick
https://www.mql5.com/ru/docs/series/bars
from the article:
Also, there should be a reference to prices in OnTick (so that third-party characters are loaded).This does not solve the problem of the original
SymbolInfoDouble(euSY06,SYMBOL_BID,euSY06b) is always filled with value when used correctly. For some reason the correct value for the required symbol does not come. And it seems to be filled using the previous value received, which is the value of one of the other seven currencies.
If there is no solution, and this solution I am looking for more than a month, I feel that it is just a bug tester. Developers please pay attention to this. If it is a bug fix itI need to do in OnInit()
But when I test one of my multisymbol indicators, the list of symbols from the string of input parameters is loaded in OnInit. And their prices are accessed in OnCalculate. Moreover, when I set to load symbols from Market Watch, only one basic symbol appears in the tester.