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

 
fxsaber:
Custom symbols on the real are for information only, not for trading. They can only be used for trading in the tester.

Custom symbols on real can be used as an indicator for opening or closing on real instruments.

 
Aidas Geguzis:

Custom symbols can be used as an indicator for opening or closing on real instruments.

You andfxsaber :thanks, and not a word about it in the documentation. The reason for this, as always, is that the information should be collected on the forum and by word of mouth. I thought they have implemented some kind of pair or n-tool trading by means of the terminal and I also thought how they deal with lot multiplicity. Now I see, it's probably useless for me.

 

Bug 05.

Bug CustomTicksAdd.

template <typename T>
T MyPrint( const T Value, const string Str, const bool DebugFlag = false ) { Print(Str + " = " + (string)Value); return(Value); }
#define _P(A) MyPrint(A, __FUNCSIG__ ", Line = " + (string)__LINE__ + ": " + #A)                    // Макрос для удобного и наглядного вывода значений

void OnStart()
{
  const string Name = "TEMP9";                                                                      // Имя кастомного символа
  const string SymbOrig = "EURUSD";                                                                 // Имя оригинального символа

  MqlTick Ticks[];
  const int Size = _P(CopyTicksRange(SymbOrig, Ticks, COPY_TICKS_ALL, (long)D'2019.01.01' * 1000)); // Считали EURUSD-тики за 2019 год.
    
  if ((Size > 0) && _P(CustomSymbolCreate(Name, NULL, SymbOrig)) && _P(SymbolSelect(Name, true)))   // Создали символ на основе EURUSD.
  {            
    _P(CustomTicksAdd(Name, Ticks));                                                                // Поместили в него историю EURUSD через CustomTicksAdd
  
    MqlTick AddTicks[1];
    AddTicks[0] = Ticks[Size - 1];                                                                  // Взяли последний тик
       
    AddTicks[0].time += 3600;                                                                       // И к его времени добавили час
    AddTicks[0].time_msc = (long)AddTicks[0].time * 1000;                                           
    
    _P(CustomTicksDelete(Name, (ulong)D'2019.02.01 00:00' * 1000, LONG_MAX));                       // Удалили все тики, оставив только данные за январь 2019.
    _P(CopyTicksRange(Name, Ticks));                                                                // Посмотрели, сколько тиков осталось.
    
    _P(CustomTicksAdd(Name, AddTicks));                                                             // Пробросили один тик.
    
    _P(CopyTicksRange(Name, Ticks));                                                                // Увидели, что добавился не один тик, а 129.
    _P(CustomTicksDelete(Name, (ulong)D'2019.02.01 00:00' * 1000, LONG_MAX));                       // Делаем повторное удаление - да, 129!

    _P(SymbolSelect(Name, false));                                                                  // Удалили символ из Обзора рынка.
    _P(CustomSymbolDelete(Name));                                                                   // Удалили символ.         
  }
}


Result

void OnStart(), Line = 11: CopyTicksRange(SymbOrig,Ticks,COPY_TICKS_ALL,(long)D'2019.01.01'*1000) = 3316638
void OnStart(), Line = 13: CustomSymbolCreate(Name,NULL,SymbOrig) = true
void OnStart(), Line = 13: SymbolSelect(Name,true) = true
void OnStart(), Line = 15: CustomTicksAdd(Name,Ticks) = 3316638
void OnStart(), Line = 23: CustomTicksDelete(Name,(ulong)D'2019.02.01 00:00'*1000,LONG_MAX) = 1158959
void OnStart(), Line = 24: CopyTicksRange(Name,Ticks) = 2157552
void OnStart(), Line = 26: CustomTicksAdd(Name,AddTicks) = 1
void OnStart(), Line = 28: CopyTicksRange(Name,Ticks) = 2157681
void OnStart(), Line = 29: CustomTicksDelete(Name,(ulong)D'2019.02.01 00:00'*1000,LONG_MAX) = 129
void OnStart(), Line = 31: SymbolSelect(Name,false) = true
void OnStart(), Line = 32: CustomSymbolDelete(Name) = true


More ticks are added than specified.

 

Something about synthetics is eating up memory and slowing down the terminal startup. I made two synthetics yesterday, opened a chart for each of them. Today terminal started three minutes(!!!), RAM consumption by Task Manager was 1.88 Gb. Removed these charts, hid synthetics, startup 20 sec. as before, RAM consumption 490 MB. Bild 2006, Max bars in window - Unlimited.

On first synthetic had formula from help:

1

On the second a simple formula:

0.5 * (ask(EURUSD) + ask(USDCAD))

Запуск платформы - Для продвинутых пользователей - MetaTrader 5
Запуск платформы - Для продвинутых пользователей - MetaTrader 5
  • www.metatrader5.com
По завершении установки в меню "Пуск" создается группа программ торговой платформы, а на рабочем столе дополнительно помещается ярлык программы. Используйте их для запуска. Нельзя запускать одновременно две копии платформы из одной директории. Чтобы одновременно запустить несколько копий, установите соответствующее количество программ в разные...
 
Alexey Volchanskiy:

Something about synthetics is eating up memory and slowing down the terminal startup. I made two synthetics yesterday, opened a chart for each of them. Today terminal started three minutes(!!!), RAM consumption by Task Manager was 1.88 Gb. Removed these charts, hid synthetics, startup 20 sec. as before, RAM consumption 490 MB. Bild 2006, Max bars in window - Unlimited.

On first synthetic had formula from help:

On the second a simple formula:

0.5 * (ask(EURUSD) + ask(USDCAD))

When running synthetic, it eats a lot of SSD disk resources. If SSD disk is slow, terminal start can take 10 minutes if there are several synthetics.

I'm not even talking about using HDD for terminal with synthetics.

When I've installed fast drive (Samsung 970 Pro) all problems with terminal start and syntheses stopped.

RAM is about 12 Gb when terminal starts, processor i7-6700K is used.

 
fxsaber:

Bug 05.

Bug CustomTicksAdd.

More ticks are added than specified.

2007 - it got even worse. CustomTicksAdd adds 63969 ticks instead of one.

void OnStart(), Line = 24: CopyTicksRange(Name,Ticks) = 2157552
void OnStart(), Line = 26: CustomTicksAdd(Name,AddTicks) = 1
void OnStart(), Line = 28: CopyTicksRange(Name,Ticks) = 2221521
void OnStart(), Line = 29: CustomTicksDelete(Name,(ulong)D'2019.02.01 00:00'*1000,LONG_MAX) = 63969


SZY 2007 - all bugs are actual.

 
fxsaber:

Bug 02.

even ChartRedraw does not give a visual effect.

Only if you scroll the chart with the mouse, it comes back to normal. Could you fix visualization by ChartRedraw?

Recommend a way to refresh the chart after CustomRatesUpdate so that it forcefully draws the updated bars, and not only when it decides to do so itself.

 
For some reason, a custom symbol can be removed from the Market Watch even when its chart is open.
 

Forum on trading, automated trading systems and trading strategy testing

New version of MetaTrader 5 build 2007: Economic Calendar, MQL5 Services and API for R

fxsaber, 2019.02.22 12:40

Is it correct that after RatesUpdate in OnCalculate it always resets prev_calculated to zero?

After all, if I update a fresh bar, for example, I don't need to recalculate the whole indicator.

 

Forum on trading, automated trading systems and trading strategy testing

New version of MetaTrader 5 build 2007: Economic Calendar, MQL5 Services and API for R

fxsaber, 2019.02.22 12:14

A big request, if there is no symbol, but there are its tkc files, delete them.

Faced with a situation that abnormally the Terminal crashed out.

I go in and see that my symbol is not there. Just create a symbol with the same name and shows it with the history from tkc. It looks like an error.

Reason: