Question about initialization of indicators by the Expert Advisor during testing in visual mode.
If I initialize indicators in OnInit() { } of the Expert Advisor, then in the visual tester the indicator usually doesn't appear and is not drawn.
At the same time, in the log the initialization is passed and the handle is received. It feels that in the visual mode the tester doesn't have time to do something and the indicator doesn't stick to the chart.
If I initialize indicators in OnTick() { } of the EA, the problem disappears, but it creates unnecessary writing, checking and so on.
If I uncomment the IndicatorInitialization() in OnTick and comment it in OnInit, it starts working.
int TicksTesterIndicatorHandle = INVALID_HANDLE;
bool InitComplite=false;
intOnInit()
{
IndicatorInitialization();
return(INIT_SUCCEEDED);
}
voidOnDeinit(constint reason)
{
IndicatorRelease(TicksTesterIndicatorHandle);
}
voidOnTick()
{
//if(!InitComplite)// {// IndicatorInitialization();// }
}
//+------------------------------------------------------------------+bool IndicatorInitialization()
{
//---Получить хэндл индикатора TicksTesterIndicator
TicksTesterIndicatorHandle=iCustom(NULL, _Period, "OnInit_TestIndicator");
//--- Нужно проверить, не были ли возвращены значения Invalid Handleif(TicksTesterIndicatorHandle<0)
{
Print("Ошибка при создании индикатора TicksTesterIndicator - номер ошибки: ",GetLastError(),"!!!");
return(false);
}
else
{
Print("TicksTesterIndicator инициализирован, хэндл: ", TicksTesterIndicatorHandle);
ArraySetAsSeries(Buf, true);
InitComplite=true;
}
return(true);
}
After MetaEditor hangs and then reboots - this file is now displayed as a set of red text, but the same notepad opens it normally (removed unnecessary)
Can't overcome [Invalid price] error when placing a pending order. The whole problem is that such errors are falling on standard checks on EA publication. I can't look at the logs accordingly to understand what the reason is. I haven't reproduced it in my tests. Of course, the complexity is that I do not know what parameters the symbol stands for in the standard checks. I tried to use MetaQuotes terminal to play it. The order opens in the same place, even at the same price and there is no error. Prices are normalized by CSymbolinfo::NormilizePrice(), there are checks for StopsLevel, freeze level, for correctness of prices of pending orders, I update price data with each check.
Maybe someone knows all the cases when such an error may occur on pending orders? The only one I can think of is
Not normalized price
Price above/below market price for a certain order type
Can't overcome [Invalid price] error when placing a pending order. The whole problem is that such errors are falling on standard checks on EA publication. I can't look at the logs accordingly to understand what the reason is. I haven't reproduced it in my tests. Of course, the complexity is that I do not know what parameters the symbol stands for in the standard checks. I tried to use MetaQuotes terminal to play it. The order opens in the same place, even at the same price and there is no error. Prices are normalized by CSymbolinfo::NormilizePrice(), there are checks for StopsLevel, freeze level, for correctness of prices of pending orders, I update price data with each check.
Maybe someone knows all the cases when such an error may occur on pending orders? The only one I can think of is
Not normalized price
Price above/below market price for a certain order type
Все продукты Маркета перед публикацией проходят обязательную предварительную проверку для обеспечения единого стандарта качества. В этой статье мы расскажем о наиболее частых ошибках, которые допускают разработчики в своих технических индикаторах и торговых роботах. А также покажем как самостоятельно проверить свой продукт перед отправкой в Маркет.
Is it possible to make a test cutoff by parameters in the tester?
For example, if a drawdown of 40% is reached on a test, it stops and resources are used for the next tests.
This is possible for your EAs: you need to count the exit criterion inside (if it is heavy - in OnTimer), reached the threshold - TesterStop()/ExpertRemove().
Print(SymbolSelect(" EURUSD",true)); I get an error - true
Read documentation carefully:SymbolExist
Here's how it looks in code:
Read the documentation carefully:SymbolExist
Here's how it looks in the code:
Thank you, Vladimir
Question about initialization of indicators by the Expert Advisor during testing in visual mode.
If I initialize indicators in OnInit() { } of the Expert Advisor, then in the visual tester the indicator usually doesn't appear and is not drawn.
At the same time, in the log the initialization is passed and the handle is received. It feels that in the visual mode the tester doesn't have time to do something and the indicator doesn't stick to the chart.
If I initialize indicators in OnTick() { } of the EA, the problem disappears, but it creates unnecessary writing, checking and so on.
If I uncomment the IndicatorInitialization() in OnTick and comment it in OnInit, it starts working.
Continuation of the historyof magic files:
After MetaEditor hangs and then reboots - this file is now displayed as a set of red text, but the same notepad opens it normally (removed unnecessary)
Afternoon,
Android MT5/MT4: In the order placement window the colours of the tick lines are mixed up. Also in the chart colour schemes.
Hi all!
Can't overcome [Invalid price] error when placing a pending order. The whole problem is that such errors are falling on standard checks on EA publication. I can't look at the logs accordingly to understand what the reason is. I haven't reproduced it in my tests. Of course, the complexity is that I do not know what parameters the symbol stands for in the standard checks. I tried to use MetaQuotes terminal to play it. The order opens in the same place, even at the same price and there is no error. Prices are normalized by CSymbolinfo::NormilizePrice(), there are checks for StopsLevel, freeze level, for correctness of prices of pending orders, I update price data with each check.
Maybe someone knows all the cases when such an error may occur on pending orders? The only one I can think of is
Good morning.
Is it possible to make a test cutoff by parameters in the tester?
For example, if a drawdown of 40% on a test is reached, it stops and resources go in favour of the next tests.
Hi all!
Can't overcome [Invalid price] error when placing a pending order. The whole problem is that such errors are falling on standard checks on EA publication. I can't look at the logs accordingly to understand what the reason is. I haven't reproduced it in my tests. Of course, the complexity is that I do not know what parameters the symbol stands for in the standard checks. I tried to use MetaQuotes terminal to play it. The order opens in the same place, even at the same price and there is no error. Prices are normalized by CSymbolinfo::NormilizePrice(), there are checks for StopsLevel, freeze level, for correctness of prices of pending orders, I update price data with each check.
Maybe someone knows all the cases when such an error may occur on pending orders? The only one I can think of is
Article: What tests does a trading robot have to pass before it is published in the Marketplace?
Is it possible to make a test cutoff by parameters in the tester?
For example, if a drawdown of 40% is reached on a test, it stops and resources are used for the next tests.
This is possible for your EAs: you need to count the exit criterion inside (if it is heavy - in OnTimer), reached the threshold - TesterStop()/ExpertRemove().
Something unnecessary.