Custom symbols. Errors, bugs, questions, suggestions. - page 9

 
Andrey Khatimlianskii:

Poured 2009 and 2025 into the former location.

Thanks. Tried builds 1970+ - all have this bug until you hard recreate the custom characters, staying within the same tore account.

 
fxsaber:

2009:

2033:

 

Bug 10.

The symbol cannot be deleted.

#define  PRINT(A) Print(#A + " = " + (string)(A))

void OnStart()
{
  MathSrand((uint)TimeLocal());
  
  const string Name = _Symbol + (string)MathRand();

  PRINT(CustomSymbolCreate(Name));

  PRINT(CustomRatesDelete(Name, 0, 0)); // Без этой строки удаление работает.
  
  PRINT(CustomSymbolDelete(Name)); // false
  PRINT(GetLastError());  
}


CustomSymbolCreate(Name) = true
CustomRatesDelete(Name,0,0) = 0
CustomSymbolDelete(Name) = false
GetLastError() = 5306
 

Bug 11.

CustomTicksAdd does not form bars.

// Проигрываем тиковую историю через таймер.
#define  PRINT(A) Print(#A + " = " + (string)(A))

void OnInit()
{
  if (EventSetMillisecondTimer(20)) // С такой частотой будем пробрасывать тики
    MathSrand((uint)TimeLocal());  
}

void OnTimer()
{
  static const string Name = _Symbol + (string)MathRand();
  
  static bool FirstRun = true;
  static MqlTick Ticks[];
  static int Pos = 0;
    
  if (FirstRun)
  {
    PRINT(CustomSymbolCreate(Name, NULL, _Symbol)); // Создали символ.
  
    PRINT(CustomRatesDelete(Name, 0, 0)); // Без этой строки работает.    
    PRINT(SymbolSelect(Name, false));     // https://www.mql5.com/ru/forum/304554/page9#comment_11680616
    
    PRINT(CustomSymbolDelete(Name));                // Убили.
    PRINT(CustomSymbolCreate(Name, NULL, _Symbol)); // Воскресили.
    
    if (SymbolSelect(Name, true)) // Поместили в Обзор рынка
    {
      ChartOpen(Name, PERIOD_M1);            // Открыли чарт
      PRINT(CopyTicksRange(_Symbol, Ticks, COPY_TICKS_INFO, (TimeCurrent() - 3600) * 1000)); // Взяли тики (последний час) для проброса
    }
      
    FirstRun = false;
  }
  else if (Pos < ArraySize(Ticks))
  {
    MqlTick Tick[1];
    
    // Пробрасываем по тику
    Tick[0] = Ticks[Pos++];
    CustomTicksAdd(Name, Tick);
  }
}

Bars will not be formed on the open chart. In Market Watch, the ticks are updated.

 

Bug 12.

When creating a custom symbol from scratch (via CTRL+U for example) the maximum volume is prescribed such that the tester is unable to calculate its profit.

#include <MT4Orders.mqh> // https://www.mql5.com/ru/code/16006

#define  Ask SymbolInfoDouble(_Symbol, SYMBOL_ASK)

void OnInit()
{
  // Именно такой макс. объем автоматом прописывается при создании кастомного символа с нуля.
  const double Lot = 1 e11; // SymbolInfoDouble(symbol,SYMBOL_VOLUME_MAX)
  
  OrderSend(_Symbol, OP_BUY, Lot, Ask, 0, 0, 0); // После закрытия этой позиции ее профит будет нулевым.
}
 
For some reason, the developers don't get their hands on reproducible bugs in this thread.
 
fxsaber:
For some reason the developers don't get their hands on reproducible bugs in this thread.
We should probably invite them in
 

invited Slava Stringo.

i enter a custom instrument in this field (attachment 1). it opens without quotes. if i open it through the menu, everything is ok.

attachment 2 is just a word.

attachment 3: sick of this button, no one needs it. make an option to hide it. there is a help. let's do a poll.

cpsb

Files:
x34zq9.PNG  2 kb
1wvlwh2.PNG  10 kb
qfd9jf.PNG  2 kb
 
superman:

invited Slava Stringo.

i enter a custom instrument in this field (attachment 1). it opens without quotes. if i open it through the menu, everything is ok.

attachment 2 is just a word.

That's not how they invite.

So: @Slava

 
fxsaber:

Bug 07.

Tester forms bars by Last for exchange custom symbols with Bid price of bar building.

Therefore, the bar history in the Terminal and the Strategy Tester completely diverges. And if someone uses bars in TS (indicators, for example), the result of backtest is random for him/her.

Show the specification of the custom symbol.

And give the custom ticks.

To fix something, you have to reproduce it first

Reason: