From theory to practice - page 194

 
Evgeniy Kazeikin:

can all this be solved with mql5 ?

I think so.

There is no problem with the basic algorithm. There will be problems with additional requirements:

- saving of current calculation parameters, with subsequent recovery in case of power failures, etc.

- Adaptation to different tick-flows from different brokerage companies (the program should analyze tick-flow, its statistics and offer the user the best method of reading quotes from the total flow).

- etc.

But, these are such professional things that I don't need, but need for sales. About that - a little later and in another thread.

 

After sleepless nights I came to the conclusion that EMA as presented in Wikipedia and MQL does not make the slightest sense and has nothing to do with the distribution of the price itself or with the distribution of increments.

PS This week so far +10% to deposit (total for 3 incomplete weeks +120%)

 

Here it was easy:

This is where it was VERY hard:


A EURJPY trade is now open:

 

I'm kind of starting to understand what you're talking about. There is a period of time from which the ticks will always draw a reference distribution. This segment can be taken from last month, the month before, or even further, it doesn't matter, the distributions of ticks in it will be the same. Right?

If so, you don't need ema, wma and others. Let's assume that this ideal time frame is 2 hours and 39 minutes. Then you open an M1 chart and apply an SMA with period 159 ( = 2*60+39) to it. The sma will draw a trajectory of the centre of this distribution. But it will not give any information where the price will go in the future. The trajectory can also stop and reverse at any moment.
But the price should constantly wander around the centre of this distribution, you can try to trade the strongest deviations from it. But beware of trends, the price will follow them and will not return to the level of the distribution centre, which is necessary to close without losing.

 
Alexander_K2:

After sleepless nights I came to the conclusion that EMA as presented in Wikipedia and MQL does not make the slightest sense and has nothing to do with the distribution of the price itself or with the distribution of increments.

PS This week so far +10% to deposit (total for 3 incomplete weeks +120%)

No point in arguing about wikipedia, but here is an example of possible work with increments (first difference) and EMA (though linear) from first to fourth degree with leverage 1.

Forum on Trading, Automated Trading Systems and Strategy Tests

Difference calculus, examples.

Aleksey Panfilov, 2018.01.31 20:21

Here is another example of using price increment as new information. In it, the increment is read explicitly as a difference.

1*Y1-1*Y2-2*Y2+3*Y3-1*Y4 =0

1*Y1-1*Y2-3*Y2+6*Y3-4*Y4 + 1*Y5 =0

1*Y1-1*Y2-4*Y2+10*Y3-10*Y4 + 5*Y5 -1*Y6=0

1*Y1-1*Y2-5*Y2+15*Y3-20*Y4 + 15*Y5 -6*Y6 + 1*Y7=0

1*Y1-1*Y2-6*Y2+21*Y3-35*Y4 + 35*Y5 -21*Y6 + 7*Y7 -1*Y8=0


2*Y2=1*Y1-1*Y2+3*Y3-1*Y4

3*Y2=1*Y1-1*Y2+6*Y3-4*Y4 + 1*Y5

4*Y2=1*Y1-1*Y2+10*Y3-10*Y4 + 5*Y5 -1*Y6

5*Y2=1*Y1-1*Y2+15*Y3-20*Y4 + 15*Y5 -6*Y6 + 1*Y7

6*Y2=1*Y1-1*Y2+21*Y3-35*Y4 + 35*Y5 -21*Y6 + 7*Y7 -1*Y8

      a1_Buffer[i]=(open[i]-open[i+1]   +3*a1_Buffer[i+1 ]   -1*a1_Buffer[i+2 ]  )/2;
      a2_Buffer[i]=(open[i]-open[i+1]   +6*a2_Buffer[i+1 ]   -4*a2_Buffer[i+2 ]   +1*a2_Buffer[i+3 ]  )/3;
      a3_Buffer[i]=(open[i]-open[i+1]   +10*a3_Buffer[i+1 ]  -10*a3_Buffer[i+2 ]  +5*a3_Buffer[i+3 ]  -1*a3_Buffer[i+4 ])/4;
      a4_Buffer[i]=(open[i]-open[i+1]   +15*a4_Buffer[i+1 ]  -20*a4_Buffer[i+2 ]  +15*a4_Buffer[i+3 ]  -6*a4_Buffer[i+4 ]  +1*a4_Buffer[i+5 ])/5;
      a5_Buffer[i]=(open[i]-open[i+1]   +21*a5_Buffer[i+1 ]  -35*a5_Buffer[i+2 ]  +35*a5_Buffer[i+3 ]  -21*a5_Buffer[i+4 ]  +7*a5_Buffer[i+5 ]  -1*a5_Buffer[i+6 ])/6;
In the figure you can see that the line (red) constructed conventionally by a polynomial of the fifth degree (by the number of connected points) has also started to hold firmly near the graph.


We have, as it were, at the expense of the polynomial of the fourth degree on the first differences (price increments) increased (by the number of points) the degree to the fifth.

Is this it, the regularization?




Is it possible, in this way, to use both the second and nth differences, and the EMA from the first to the fourth degree? It would be curious to make a general scheme of processes in similar examples.

 
Dr. Trader:

I'm sort of starting to understand what you're talking about. There is a time segment from which the ticks will always draw a reference distribution. This segment can be taken from last month, the month before, or even further, it doesn't matter, the distributions of ticks in it will be the same. Right?

If so, you don't need ema, wma and others. Let's assume that this ideal time frame is 2 hours and 39 minutes. Then you open an M1 chart and apply an SMA with period 159 ( = 2*60+39) to it. The sma will draw a trajectory of the centre of this distribution. But it will not give any information where the price will go in the future. The trajectory can also stop and reverse at any moment.
But the price should constantly wander around the centre of this distribution, you can try to trade the strongest deviations from it. But beware of trends, the price will follow the trend and will not return to the level of the distribution centre, which is necessary at least to close without incurring losses.

Doc, I knew you were a genius.

You got it right. That's exactly right!

This reference distribution needs to:

1... isolate it by converting the original quote stream to a benchmark. You need by all means to get the intensity of the tick stream to have a distribution at least remotely resembling the Poisson distribution. You have taken an important step in this direction, but have given up moving forward... Without solving this key problem, all endeavours in the field of neural networks and forecasts are simply pointless. Well, at least you understand that!!!

2. After this transformation of the quote stream, you have to calculate a certain time window to observe this reference distribution in order to see it almost completely. With no less than 99% confidence level.

ALL.

 
Aleksey Panfilov:

There is no point in arguing about wikipedia, but here is an example of possible work with increment (first difference) and EMA (though linear) from first to fourth degree with leverage 1.


Is it possible to use both the second and n-difference and EMA from the first to the fourth degree in this way? It would be curious to make a general scheme of processes in similar examples.

See. Alexey - everything you do is good. But also not good, nevertheless.

You know what's missing from your formulas?

TIME!!!

That's when you understand the relationship of estimated polynomials or EMA to the current time, then the physical meaning of all the formulas will be clear and this thing can be used for forecasting.

Not so far. I do not see this correlation. Maybe I'm blind? Maybe... Old age is not a joy...

 
Alexander_K2:

You see. Alexei - everything you do is good. But it's not good, either.

You know what's missing from your formulas?

TIME!!!

That's when you understand the relationship of estimated polynomials or EMA to the current time, then the physical meaning of all the formulas will be clear and this thing can be used for forecasting.

Not so far. I do not see this correlation. Maybe I'm blind? Maybe... Old age is no fun...

I agree, TIME is always in short supply. :)

 
Alexander_K2:

You see. Alexei - everything you do is good. But it's not good, either.

You know what's missing from your formulas?

TIME!!!

That's when you understand the relationship of estimated polynomials or EMA to the current time, then the exact physical meaning of all the formulas will be clear and this thing can be used for forecasting.

Not so far. I do not see this correlation. Maybe I'm blind? Maybe... Old age is no fun...

Sorry I can't shut up anymore..... I hope you read it carefully and try to understand what I said. The whole problem with your work is that you look at a quote purely statistically. as a time unsteady series etc. And trying to apply some theory that supposedly describes some laws. BUT considering quotes as a statistical variable and not understanding the basic principles of the market, the fundamental formations of prices, the actions of players on one side or the other, in certain markets.... If you don't do it, you'll continue to sink into your theory, introducing more and more conditions or mini-concerns, which will continue to drive you around the bush, but you won't win, unfortunately. And only because you look at the quotient as a non-stationary time series and no more...... There are no laws in price itself.... Or rather there are, but they are laws of the result of the impact on the price. That is, the impact occurred, the price changed, a law, a pattern or a condition was formed. And in order to make money, you need to be able to calculate this impact and know in which direction it occurred.

Seriously, you're basically doing an interesting theory, but you're applying it to the wrong data and in the wrong way, it seems to me..... Don't be discouraged....!!!!

 
Mihail Marchukajtes:

Sorry I can't keep quiet any longer..... I hope you read carefully and try to understand what I said. The whole problem with your work is that you are looking at a quote purely statistically. as a time non-stationary series etc. And trying to apply some theory that supposedly describes some laws. BUT considering quotes as a statistical variable and not understanding the basic principles of the market, the fundamental formations of prices, the actions of players on one side or the other, in certain markets.... If you don't do it, you'll continue to sink into your theory, introducing more and more conditions or mini-concerns, which will continue to drive you around the bush, but you won't win, unfortunately. And only because you look at the quotient as a non-stationary time series and no more...... There are no laws in price itself.... Or rather there are, but they are laws of the result of the impact on the price. That is, the impact occurred, the price changed, a law, a pattern or a condition was formed. And in order to make money, you need to be able to calculate this impact and know in which direction it occurred.

Seriously, you're basically doing an interesting theory, but you're applying it to the wrong data and in the wrong way, it seems to me..... Don't be discouraged....!!!!

Michael, I appreciate your literary talent - always rampantly emotional.

But, you see, the thing is - I find it difficult to reach the hearts of the old-timers of this forum with their theories. It's almost impossible - I am aware of that. I myself am physically unable to turn away from my path to the Grail.

Therefore, I first of all am now writing for the WORDERS who don't have any theories.

The Grail is there, guys!!! I've already caught it - and I even know what it looks like! :)))

Only awareness of my age prevents me now, in front of my colleagues at work, to start tap dancing.

Reason: