Libraries: Symbol - page 7

 
Aleksey Vyazmikin:

Of course, the source data is in the terminal - futures of previous years. What does it mean to form a tick archive? In general, I would be satisfied with the variant of testing OHLC on M1, without extra ticks, so to speak.

To form a custom symbol you need either its ticks or its bars.

And why do not like last prices? Again, I did not understand about the bar formation price - minute bars will do, at the prices of the original. In general, I need the same thing as on a separate futures, and the fact that it will not coincide with the real at any settings, so it is clear - according to my observations it is necessary to put 5 points in the minus on average, if testing on all ticks.

I have a slightly different vision of how everything should be. I also do not use bars and indicators. I told about it somewhere on the forum.

Can you help me with such a script?

I seem to have formed a wrong reputation here, since such questions are raised.

As for custom symbols, this thread contains 95% of what you will need to solve this problem.

 
fxsaber:

To form a custom symbol, you need either its ticks or its bars.

I have a slightly different vision of how things should be. I also do not use bars and indicators. Somewhere about it I spoke about it on the forum.

I seem to have formed a wrong reputation here, since such questions are raised.

As for custom symbols, this thread has 95% of what would be needed to solve this problem.

I appreciate your time, I just thought the code would allow this to be implemented without a huge time investment. I personally don't know how to copy into one custom character a dozen others one after another and change the date on the fly so that they don't overlap.

 
Aleksey Vyazmikin:

I don't know how to copy dozens of other symbols one after another into one custom symbol and change the date on the fly so that they don't overlap.

A custom symbol is just one of the varieties of storing quotes. Imagine you want to get a CSV file of a gluing. That's pretty much the same as a custom symbol.

So create a "CSV file" and putting it into a custom one is a matter of a few lines.

 
fxsaber:

A custom symbol is just one kind of quote storage. Imagine you need to get a CSV file of a gluing. This is almost the same as a custom symbol.

So create a "CSV file" and putting it into a custom one is a matter of a few lines.

Thanks! Great, I can create the file, but how do I fill it in afterwards?

 
Aleksey Vyazmikin:

Thank you! Great, I can create a file, but how do I upload it?

Create not a file, but MqlRates[] or MqlTick[]. I'll give you a hint.

 
fxsaber:

Create not a file, but MqlRates[] or MqlTick[]. And then I will give you a hint.

It is easier for me to unload everything in a file, as it will be necessary to shift the date in some way, and then load everything into each type of array separately, as MqlRates[] .

 
The library has extended functionality because of certain events. Example of its use
// Example of creating a "live" symbol.

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

const bool Init = EventSetMillisecondTimer(20); // At this frequency we will throw ticks

void OnTimer()
{
  static bool FirstRun = true;

  static const SYMBOL Symb("CUSTOM_" + _Symbol); // Created a symbol
  
  static MqlTick Ticks[];
  static int Pos = 0;
    
  if (FirstRun)
  {
    Symb.DeleteHistory();       // Little things in history have been rumbled.
    Symb.Delete(true);          // We will also nail the symbol to exclude the presence of a tick in the Market Watch.
    Symb.Create(NULL, _Symbol); // Resurrected pristine.
    
    if (Symb.IsExist() && Symb.On())   // If everything is fine
    {     
      ChartOpen(Symb.Name, PERIOD_M1); // Opened the chart
      CopyTicksRange(_Symbol, Ticks, COPY_TICKS_INFO, (ulong)D'2019.02.01' * 1000); // Took the ticks for the throw.
    }
      
    FirstRun = false;
  }
  else if (Pos < ArraySize(Ticks))
    Symb += Ticks[Pos++]; // Throw a tick
}


On such a symbol you can debug indicators even on weekends, when quotations are standing.

 
fxsaber:
The library has extended functionality because of certain events. An example of its use

compatibility with the old library is not broken? - I have several works on the old library Symbol.mqh , I wouldn't want to find what doesn't work.

 
Igor Makanu:

compatibility with the old library is not broken? - I have several works on the old library Symbol.mqh, I would not like to find what does not work later

Not broken.

 

fxsaber:

void ReverseTick( MqlTick &Tick )
{
  Tick.bid = ReversePrice(Tick.bid);
  Tick.ask = ReversePrice(Tick.ask);
  Tick.last = ReversePrice(Tick.last);
}


Shouldn't bid and ask be swapped?