Discussion of article "Creating and testing custom symbols in MetaTrader 5" - page 3

 
fxsaber:

Take 1653 (there are significant changes there on this topic) and if it doesn't work, post here.


Where can I get it? Even 1643 is downloaded from metatrader5.com?

 
bistreevseh:

Where to get it? Even from metatrader5.com it is downloaded 1643?

Open an account on Metaquotes-Demo and look at the logs.

 

Thanks, installed it!

2017.11.14 12:51:04.173 Ticks   old tick ARBINDEX (tick: 1970.01.01 00:00:25.934, last: 2017.11.14 11:50:09.000) 5.0000/6.0000
2017.11.14 12:51:05.198 Ticks   old tick ARBINDEX (tick: 1970.01.01 00:00:00.002, last: 2017.11.14 11:50:09.000) 5.0000/6.0000
2017.11.14 12:51:06.426 Ticks   future price ARBINDEX (tick: , last: 2017.11.14 11:49:46.000) 5.0000/6.0000/0.0000

I managed to create a couple of ticks, but as far as I understand there are errors, can you tell me what they mean? Thanks!

 
bistreevseh:

I managed to create a couple of ticks, but as far as I understand there are errors, can you tell me what they mean? Thank you!

For a tick you need to specify the time as well.

 
fxsaber:

For a tick, you need to specify the time as well.


I also thought about it before writing the last message.
I ran this code:

   MqlTick tick[];
   ArrayResize(tick, 1);
   tick[0].ask=6;
   tick[0].bid=5;
   tick[0].flags=TICK_FLAG_BID|TICK_FLAG_ASK;
   tick[0].time=TimeCurrent();
 
bistreevseh:

I thought of that too, before I wrote the last post.

You have an inconsistency between the two tenses, do it

tick[0].time_msc = 0;
 
It's also worth remembering that 1653 has bugs with custom characters. Been waiting for a build with fixes for over a month now. ;-/
 
Stanislav Korotky:
It's also worth remembering that 1653 has bugs with custom characters. Been waiting for a build with fixes for over a month now. ;-/
What bugs?
 
Aidas Geguzis:
What kind of bugs?

Specifically what I found - removal of custom bars didn't work and the log was clogged with gigabytes of unexplained error messages.

But the essence of my warning is that you should be ready for glitches and wait for a new build. Although the wait is very long.

 

Infinite growth of tkc-file when writing the same data

void OnStart()
{
  MqlTick Ticks[];

  const string Name = "A1234";
  
  if (CustomSymbolCreate(Name) && CustomSymbolSetInteger(Name, SYMBOL_DIGITS, _Digits))
  {
    if (CopyTicks(_Symbol, Ticks, COPY_TICKS_ALL, 0, 100000) > 0)
      Print(CustomTicksReplace(Name, Ticks[0].time_msc, Ticks[ArraySize(Ticks) - 1].time_msc, Ticks));
  }
  else if (SymbolInfoInteger(Name, SYMBOL_CUSTOM) && (CopyTicksRange(Name, Ticks) > 0))
    Print(CustomTicksReplace(Name, Ticks[0].time_msc, Ticks[ArraySize(Ticks) - 1].time_msc, Ticks));
}

Each run increases tkc-file by 0.5 Mb.


CustomTicksDelete deletes the ticks, but the tkc-file remains the same. Interestingly, reading ticks from a custom symbol before and after a reboot can give different results.