Errors, bugs, questions - page 3047

 
Yury Lemeshev:
Good afternoon. Help. SymbolSelect andSymbolExist work differently?

Print(SymbolSelect(" EURUSD",true)); I get an error - true
Print(SymbolExist("EURUSD",false)); I get error - 'true' - variable expected.

Read documentation carefully:SymbolExist

bool  SymbolExist(
   const string  name,    // имя символа
   bool&   is_custom      // признак пользовательского символа
   );


Here's how it looks in code:

   Print(SymbolSelect("EURUSD",true));
   bool exist=false;
   Print(SymbolExist("EURUSD",exist));
Документация по MQL5: Получение рыночной информации / SymbolExist
Документация по MQL5: Получение рыночной информации / SymbolExist
  • www.mql5.com
SymbolExist - Получение рыночной информации - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Vladimir Karputov:

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.

int  TicksTesterIndicatorHandle = INVALID_HANDLE;
bool InitComplite=false;
int OnInit()
  {
   IndicatorInitialization();
   return(INIT_SUCCEEDED);
  }

void OnDeinit(const int reason)
  {
   IndicatorRelease(TicksTesterIndicatorHandle);
  }

void OnTick()
  {
//if(!InitComplite)
//  {
//   IndicatorInitialization();
//  }
  }
//+------------------------------------------------------------------+
bool IndicatorInitialization()
  {
//---Получить хэндл индикатора TicksTesterIndicator
   TicksTesterIndicatorHandle=iCustom(NULL, _Period, "OnInit_TestIndicator");

//--- Нужно проверить, не были ли возвращены значения Invalid Handle
   if(TicksTesterIndicatorHandle<0)
     {
      Print("Ошибка при создании индикатора TicksTesterIndicator - номер ошибки: ",GetLastError(),"!!!");
      return(false);
     }
   else
     {
      Print("TicksTesterIndicator инициализирован, хэндл: ", TicksTesterIndicatorHandle);
      ArraySetAsSeries(Buf, true);
      InitComplite=true;
     }
   return(true);
  }
 

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)

Files:
main.txt  1 kb
 

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.

Standard checks report

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
  • Freeze level (not sure)
I will be glad for any tips :)
 

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.

 
Dmitry Homenkov:

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

  • Not normalized price
  • Price above/below market price for a certain order type
  • Freeze level (not sure)
I will be glad to receive any tips :)

Article: What tests does a trading robot have to pass before it is published in the Marketplace?

Какие проверки должен пройти торговый робот перед публикацией в Маркете
Какие проверки должен пройти торговый робот перед публикацией в Маркете
  • www.mql5.com
Все продукты Маркета перед публикацией проходят обязательную предварительную проверку для обеспечения единого стандарта качества. В этой статье мы расскажем о наиболее частых ошибках, которые допускают разработчики в своих технических индикаторах и торговых роботах. А также покажем как самостоятельно проверить свой продукт перед отправкой в Маркет.
 
Yury Lemeshev:

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.

Reason: