From theory to practice - page 104

 
Максим Дмитриев:

Why read the ticks at exponential intervals at all? It's just... nonsense. ))

Hmmm... Just think about it, Maxim! Create a histogram of time intervals between ticks, study it, read about "simple flow", find out how much the histogram you get differs from the exponential one and why, etc. etc.
 
Alexander_K2:

Can MQL's MPFs be generated uniformly from 0 to 1?

If so, take the natural logarithm of it at each program execution cycle, multiply by -1. This is a standard exponential MF generator. So you get 0.12, so you read a tick in 120 ms, the next value is 1.011, so in 1011 ms, and so on and so forth.

I add 1 and take the integer part to work on a scale of seconds, not milliseconds.

PS Whole part of course, not module - corrected.


That is, of the whole range from 0 to 1 you work only on the section tending towards zero, the first third to be exact,

two thirds are degenerated into the added one (if you take only the integer part and 2/3 of the scale, large 0.33333 according to the formula will be less than one).

in total we have a series of timings 111111111111111111111111111111111112111111111111111111141111111111111111111111111111111113111111111111111111111111111111116 so what?

ZS Is this correct?

 

If the sampling rate is at least 1 second, then you start the timer with 1 second.

Then in the call function itself you set the condition to process this timing as a tick or ignore it.

In the processing section, you store the timing in a static variable, or in a predefined global variable (do not confuse it with a global variable of the terminal, it is about something else). When you get to the condition you take the difference between current time and time of previous tick and compare this difference with the value calculated during the last run for the new timing (by formula, that you've explained), if the time is equal or better, you enter to new tick section, make calculation of new timing, write new time and get tick data and send them to history.

That is, simply, in the timer we already set the condition that allows us to decide if this time fits the new tick or not. That is the solution.

 
Alexander_K2:

Can MQL's IFs be generated uniformly from 0 to 1?

If so, take the natural logarithm of it at each program execution cycle, multiply by -1. This is a standard exponential MF generator. So you get 0.12, so you read a tick in 120 ms, the next value is 1.011, so in 1011 ms, and so on and so forth.

I add 1 and take the integer part to work on a scale of seconds, not milliseconds.

PS Whole part of course, not module - corrected.

PPS If there is no new tick in the current step - you don't read anything!!!!!!!!!!!!!!!!


to get numbers from 0.00 to 1.00, we need to divide the gpsh of the emkuel by 32768, and then round up to the second digit.

 
Nikolay Demko:

That is, out of the whole range from 0 to 1 you work only on the part tending towards zero, the first third to be exact,

two thirds are degenerated into the added one (well, if you take only the integer part and 2/3 of the scale, larger than 0.33333 according to the formula will be less than one).

in total we have a series of timings 111111111111111111111111111111111112111111111111111111141111111111111111111111111111111113111111111111111111111111111111116 so what?

ZS Is that correct?

Nah, it's a bit wrong. My DDE data is in 1 sec increments, so no degeneracy at all :)))))))))
 
Nikolay Demko:

If the sampling rate is at least 1 second, then you start the timer with 1 second.

Then in the call function itself you set the condition to process this timing as a tick or ignore it.

In the processing section, you store the timing in a static variable, or in a predefined global variable (do not confuse it with a global variable of the terminal, it is about something else). When you get to the condition you take the difference between current time and time of previous tick and compare this difference with the value calculated during the last run for the new timing (by formula, that you've explained), if the time is equal or better, you enter to new tick section, make calculation of new timing, write new time and get tick data and send them to history.

That is, simply, in the timer we already set the condition that allows us to decide if this time fits the new tick or not. That is the solution.

Complicated, isn't it? But in Kissimmee it is VERY easy. :)))))))))))))))))
 

Alexander_K2:

1. And immediately you were wrong. Our increments depend on each other and how! I don't know why - but, on the first day of my analysis, I understood that there is a dependence between two consecutive quotes, we obtain a vector from the current and the previous price. 2 degrees of freedom. There is and cannot be anything else in the increments than a t2 Student's distribution! But, gosh, it's kind of "unclean". In fact on the increments we have a probability density function = product of the t2-distribution and some kind of exponential distribution with a rather large lambda. What this exponential component means - can't figure it out yet. Working.

2. There is no Cauchy distribution and never has been.

3. 4. 5. We have exactly a non-Markovian process. And that's what we have to build on. And the Fokker-Planck equation, of course, does not fully describe the behaviour of the probability density function. It should contain an integral term. The result is an integro-differential equation.

1) No, I'm not wrong. I'm not claiming that the price increments are independent - that's probably wrong. I'm only arguing that if you want to judge their exact distribution from an empirical distribution constructed from a sample, you have to make some assumptions. In a matstat, these are usually independence and equal distribution. From this assumption, due to the Levy-Hinchin theorem, we get that the distribution must be of infinitely divisible, and the Student's distribution is only relevant when it coincides with Cauchy. If there is a dependence and/or an unequal distribution, the empirical distribution does not accurately characterise the distribution of returns. The consequence of this is, in particular, that the distribution built on the quotation history proves to be of little use in the future. That is, in short, you deny Markovianness but continue to use it implicitly.

2) Cauchy certainly exists and is sometimes, along with other infinitely divisible distributions, used to model prices (although it is hardly suitable for forex)

3) Non-Markovian processes are an extremely broad class. You need to narrow it down somehow - for that you consider some class of processes generalizing to diffusion. It is necessary to show somehow that your generalized equation has a solution - there may be problems here, since it is unlikely to be possible to use the apparatus of SRS. But I don't even understand whether your time is discrete or continuous. The Fokker-Planck equation is defined for continuous, while the moving average process is defined for discrete.

 
Alexander_K2:
It's a bit complicated, isn't it? It's VERY easy in Wissima. :)))))))))))))))))

112124113121222123221621222122611311321321223213111112211321232133121233121231322112131215113212223211231312211231161111114222211121221311321134224323

Your formula gave me a series of timings like this


 
Aleksey Nikolayev:

1) No, I am not wrong. I'm not claiming that price increments are independent - that's probably wrong. I'm only arguing that if you want to judge their exact distribution from an empirical distribution constructed from a sample, you have to make some assumptions. In a matstat, these are usually independence and equal distribution. From this assumption, due to the Levy-Hinchin theorem, we get that the distribution must be of infinitely divisible, and the Student's distribution is only relevant when it coincides with Cauchy. If there is a dependence and/or an unequal distribution, the empirical distribution does not accurately characterise the distribution of returns. The consequence of this is, in particular, that the distribution built on the quotation history proves to be of little use in the future. That is, in short, you deny Markovianness but continue to use it implicitly.

2) Cauchy certainly exists and is sometimes, along with other infinitely divisible distributions, used to model prices (although it is hardly suitable for forex)

3) Non-Markovian processes are an extremely broad class. You need to narrow it down somehow - you are looking at some class of processes generalising diffusion for this purpose. You need to somehow show that your generalised equation has a solution - there may be problems here, since it is unlikely that you can use the apparatus of SRU. But I don't even understand whether your time is discrete or continuous. The Fokker-Planck equation is defined for continuous, while the moving average process is defined for discrete.


!!!!!!!!!!!!!

1. And I argue that it is useful. If you take the increments for the same currency pair in a huge sample (at least 1,000,000 increments), for different time periods, you will see that the parameters of the increment distribution do not change from the word "at all".

2. The Cauchy distribution as a type exists, but in Forex it does not.

3. !!!!!!!!!!!!!! Yes, you're right - this is definitely a topic for a doctoral dissertation. Look, the equation itself is of course for continuous time, but numerically we solve it by finite difference methods with discrete time. No?

PS We are talking about increments between tick quotes, not between OPEN or CLOSE prices or the like.

 
Nikolay Demko:

112124113121222123221621222122611311321321223213111112211321232133121233121231322112131215113212223211231312211231161111114222211121221311321134224323

your formula gave me a series of timings like this


Very similar.