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

 
Sergey Chalyshev:

added a symbol to the market overview The ticks have gone normal:

It turns out there is a solution.

But the bars still don't appear:

So write bars.

 
fxsaber:

It turns out there is a solution.

So write bars.

There is no solution within MT5, I have already tried everything.

I am writing bars and it does not give me any error, but I am not writing bars either.

Although, they should form their own bars.

 

This is the symbol for which the ticks are written and the bars are formed, although it is not even added to the market overview

and for this one there are no bars and the ticks are crooked,

The script is the same, the algorithm is the same, but the symbol names are different,

I see a wrong letter in the symbol name.

how do i know which letter is "wrong"?

 
Sergey Chalyshev:

how do you find out which letter is "wrong"?

Go over it. If I wanted to figure it out, I would have provided the source code. This seems to be a different case.

 
fxsaber:

Bug 07.

Tester generates bars by Last for stock custom symbols with Bid price to build bars.

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

Continuation on the strange bars in the Strategy Tester.

Bug 08.

Running this script on MQ-Beta EURUSD

Forum on trading, automated trading systems and strategy testing

Libraries: Symbol

fxsaber, 2018.07.09 14:20

// Включаем в бэктест текущий день
#property script_show_inputs

#include <Symbol.mqh> // https://www.mql5.com/ru/code/18855

input int Offset = -24 * 7; // Offset in hours

#define  HOUR 3600

void OnStart()
{
  const SYMBOL Symb(_Symbol + "_Offset" + (string)Offset); // Создали символ

  if (Symb.IsExist()) // Если символ создан
  {
    Symb.CloneProperties(); // Скопировали свойства
    
    MqlRates Rates[];

    // Сместили время баров
    for (int i = CopyRates(_Symbol, PERIOD_M1, 0, (int)SeriesInfoInteger(_Symbol, PERIOD_M1, SERIES_BARS_COUNT), Rates) - 1; i >= 0; i--)
      Rates[i].time += Offset * HOUR;
      
//    Symb.CloneTicks(Ticks);

    // Записали смещенные бары и включили символ в Обзор рынка
    if ((Symb.CloneRates(Rates) > 0) && Symb.On())
      ChartOpen(Symb.Name, PERIOD_CURRENT); // Открыли график нового символа
  }
}

Then in the Tester in OHLC M1 mode chase the Visualisation by the created custom symbol. You can see very well that the bars are very different from those in Terminal.


Terminal



Tester


 
fxsaber:

Continuation on the subject of strange bars in the Tester.

Bug 08.

Run this script on MQ-Beta EURUSD


Then we run visualization using created custom symbol in the Strategy Tester in OHLC M1 mode. It is clearly seen that bars are very different from those in Terminal.


Terminal



Tester


Try to remove the "-" symbol from the name of the custom symbol.

The help does not say anything about "-",

(allow ".", "_", "&" and "#"),

but the quote server does not like minus and dots.

 
Bild 2025 - I haven't noticed any changes.
 
Hello there is a problem with custom symbols. I'll try to describe it clearly.
In short. I created my own symbol in MT5 for example EURUSD, I took a CSV file (basic history) with tick data from Tick Data Suite program. When I added the symbol to MT5 and started the test, I saw incorrectly displayed bars on the chart, but the ticks became normal. I have understood that the problem is in CSV file itself, there is no data for bars there. So it looks like we need a script to fix the problem!
 
 
The CSV file looks like this
Reason: