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

 
Roman:

Thank you, now I know what the reason is.
The system timer step is still a multiple of 15.625

Added.
But I changed the system timer period of the wine api function timeBeginPeriod(1)
i.e. the system timer is now incremented to 1 millisecond.
And the system timer step should be 1 millisecond, right?
Why does the counter in the comment still freeze?
https://rsdn.org/forum/winapi/4159851.1
 
And on Linux under Wine, the counter in the comment runs without hiccups, even with EventSetMillisecondTimer(1);
But the load on the processor grows up to 40%, with eight threads of processor.
In general, closed the subject, off topic ))
 
Roman:
And on Linux under Wine, the counter in the comment runs without hiccups, even with EventSetMillisecondTimer(1);
But the CPU load increases up to 40%, with eight CPU threads.

That's what I'm talking about...
Why 64 times per second?
I think so that you can display all kinds of information on the screen. That's enough frequency. There's no sense in displaying it more often, and it would be too expensive.
I wonder ifOnChartEvent, OnCalculate and OnTick are triggered 64 times per second as well. - I think so, yes.

 
Nikolai Semko:

That's what I'm talking about...
Why 64 times per second?
I think so that you can display all kinds of information on the screen. That's enough frequency. There's no sense in displaying it more often, and it would be too expensive.
I wonder if OnChartEvent, OnCalculate and OnTick are generated 64 times per second too.

The point here was not in the load, but in the capabilities of the OnTimer() handler
It turns out that Windows limits these capabilities, while Linux doesn't.

Question, OnChartEvent, OnCalculate and OnTick are generated no more than 64 times per second too?
Probably better to wait for an answer from the developer.

 
Roman:

To the question, are OnChartEvent, OnCalculate and OnTick also generated no more than 64 times per second?
Probably better to wait for an answer from the developer.

Checked OnChartEvent with the mouse.
I got the maximum frequency of 124 hertz. No more. I wonder why it's not 128.

 
Nikolai Semko:

Checked the OnChartEvent with the mouse.
The maximum frequency is 124 hertz. No more than that. It's strange why it's not 128.

Changed the algorithm a bit. Didn't take into account that comment eats much time. I got 127 Hz.
It's already logical. The error of 1 Hz can already be explained by the program itself, so it is a bit off 128.

So the maximum frequency of OnChartEvent is 128 Hz.

 
Is it possible to get a synthetic spread using MQL5?
There is a spread on synthetics in the terminal itself.
 
Aidas Geguzis:
Is it possible to get a synthetic spread using MQL5?
There is a spread on synthetics in the terminal itself.

For third-party programs, the custom symbols are minimally different from the original ones. So there should be no obstacles.

 
If a custom instrument is created through the terminal interface and the custom symbol has a negative value
In the interface of the custom symbol you must Allow negative prices.
If you do not specify this setting, the history is not calculated for the created symbol and the chart is displayed only from the current moment.
For a long time I could not understand the reason why the history is not calculated, as the journal does not show the warning that negative prices should be enabled.
It would be nice to have such a warning in the log.
 

Adding one-to-one ticks (in particular from EURUSD on MQ Demo) to an empty new custom symbol gives error 5310 (not immediately, but in a loop from an arbitrary date).

input int Limit = 10000;
input datetime Start = D'2020.06.01';

int fillArray(ulong &_start)
{
  MqlTick array[];
  int size = CopyTicks(_Symbol, array, COPY_TICKS_ALL, _start, Limit);
  if(size > 0)
  {
    _start = array[size - 1].time_msc + 1;
    if(CustomTicksAdd(symbolName, array) == -1)
    {
      Print("Error:", GetLastError());
      return -1;
    }
  }
  return size;
}

...
{
  ulong startMsc = (ulong)Start * 1000;
  while(fillArray(startMsc) > 0);
}

What's wrong? How do I know which specific ticks are being scolded? Output arrays to log - no chronology violation there.