From theory to practice - page 270

 

Me and Novaja have done a little research.

The tics come into the terminal at some random intervals. Alexander wrote that it's important to know what kind of distribution it is. I took the tick history from mt5, so I can work with millisecond accuracy.


The distribution of pauses between ticks itself looks like this

"Approximately" is because the graph is averaged. Dilling distorts the real time of ticks. Either round them up to ~10 milliseconds, or cyclically change their generation rate. Before averaging, this graph (0-100ms window) looks like this

I saw these same peaks on Alexander's graphs, now it is clearer where they are coming from.


As a result it turned out that the averaged frequency graph can be described using the sum of Gamma and Cauchy distributions. The first parameter of gamma distribution for some dealings can be selected as an integer number and Gamma distribution becomes its special case - Erlang distribution.


This is a chart from another dealing:

black line - distribution as it is received from the tick history
red - average
purple is what is obtained using the formula from gamma+coshi.

It doesn't look perfect, but it also looks good on a logarithmic scale, and the top and tail generally coincide.


The tail of distribution coincides well on tens of seconds



The formula:

gamma(4e+00, 2.8e+01) * 5e-01 + cauchy(0e+00, 7.37e+02) * 2e+00 * 5e-01

This is a formula for a particular dealing, all have slightly different parameters and coefficients.

In general, the function looks something like this
function(k, Θ, γ, c){
gamma(k, Θ) * c + cauchy(x0=0, γ) * 2 * (1-c)
}

parameter c is from 0 to 1

 
Reminds me of the universal redox formula I discovered in 1973.
 

does it have an effect?

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

fxsaber, 2018.03.27 21:06

Running EA in "All ticks" mode on MQ-Demo

void OnTick()
{
  static int i = 0;
  
  if (i < 2)
  {
    MqlTick Tick;
    
    if (SymbolInfoTick(_Symbol, Tick))
      Print(Tick.time_msc);
      
    i++;
  }
  else
    ExpertRemove();
}


Result

Si-6.18,M1 (MetaQuotes-Demo): every tick generating
Si-6.18,M1: testing of Experts\fxsaber\LimitsSlippage.ex5 from 2018.03.25 00:00 to 2018.03.27 00:00 started
2018.03.26 10:00:00   1522058400378
2018.03.26 10:00:00   1522058400013
2018.03.26 10:00:00   ExpertRemove() function called

Time of the first generated tick is longer than the second - bug.


 
Kirill Belousov:

Does it have an effect?

No, this error seems to occur only in the tester, on ticks generated from ohlc.
I took the tick history from MT5 (View-Symbols, ticks tab), it has nothing to do with that.

 
Dr. Trader:

Novaja:

Thank you very much for this kind of research.

This is the kind of thing worthy to be framed as an article with an honorarium for it.

Respectfully,

A_K2.

 
All right then, Brothers. We've seen the theory here more than once. But where's the practice???? What's the point of theory if you can't put it into practice?
 

The most important practical conclusions can be drawn from this study:

1. We should learn to "discard" ticks belonging to the Cauchy distribution and work only with those belonging to the Gamma distribution (in our discrete case, the Erlang distribution)

2. If this is done, then the solution of the problem should be as follows:.

Now I work in a moving exponential time window, and in it I count real ticks and trading intensity, and it should be vice versa - to work with the moving volume of tick selection and count for how long thistick volume"gathered", and only then to find the intensity.

Dr. Trader andNovaja, you are really doing a great job.

 
Mihail Marchukajtes:
All right, fellas. We've seen the theory here more than once. But where's the practice???? What's the point of theory if you can't put it into practice?

To hell with practice!!! People are really making great discoveries here!!!

 
Alexander_K2:

To hell with practice!!! People are really making great discoveries here!!!

Worthless for any discovery if it has no practical application. Except in physics it might be, or in astrology. But such discoveries are not needed in the market. What is the point of them? And the name of the branch makes it obligatory to practice the obtained results. Isn't it?

 
Working on ticks in the range of milliseconds, it is unlikely to be used. In this short interval ping will play a significant role, and DC does not approve such deals and does not pay out on them. IMHO