Our Masha! - page 8

 
Neutron >> :

It seems logical - by doing it optimally at every step, we go all the way in an optimal way.

Yeah, that's why I didn't notice right away, but only after a while. Well, it can't be that simple.

--------------------------------

Let's talk about this.


When I was a student, I dealt with regression, in general, I did a scientific work related to clustering.

I had to find all sorts of bodies beautifully and represent them as simple geometric shapes as close in shape as possible.

The source material was an article on regression circles, ellipses to be exact, written in our university newsletter.


There was an amazingly beautiful formula in the article, by which the above-mentioned regression circle was derived.

So I started to write a program and found it all cool and tested, but it gave me a rubbish output, and a complete one at that.

I started to check everything, including the work of mathematical functions -- standard.


So I got to the proverbial formula, by hook or by crook, and checked it.

It turned out, the author had done such a thing -

summ(i)(dy * dz) = 0   -->   summ(i)(dy) * summ(i)(dz) = 0

Everything was shortened and published. And I spent 3 days of my student's time on it.


No offence. Sorry if I was wrong.

 
LeoV >> :

Well, how about an MA that will go ahead of the market and predict - how to make it? .....))))

Even elementary trained perceptrons are able to draw the "MA" for N bars ahead and quite easily without any re-drawing. It is not exactly a "waving", but the so called "fair price" or the oscillator fair value calculated for N bars ahead.


I don't remember in which thread I posted an oscillator where two values were plotted: the standard AC in real time and the fair value for it 7 bars ahead.


In principle, the maths is not complicated.

 
Vinin писал(а) >>
When calculating first values Mashka behaves unstable. I implemented the variant with a limited number of bars to be calculated and the computer hangs. I removed the limitation and everything is OK. If anyone has downloaded the indicator from the deleted post. I am sorry for that.

Vinin , have another look at the two-parameter job. It looks like you can fine tune the muving parameters in this case.

 
Neutron писал(а) >>

Vinin , have another look at the two-parameter job. It looks like you can fine tune the muving parameters in this case.

Very high sensitivity to coefficients.

At least it is closer to the row. In other words, we should adjust coefficients.

In this case w1=0.05, w2=0.0001

Files:
 

Could there be an error in the formula? It's supposed to fit in the row... Let me double-check the recursive expression. It doesn't make sense.

 

the starting point is very important for recurrence ratios, if the slightest glitch = inaccuracy, this error accumulates. Vinin this is the reason why I wrote my rather complicated initialization in Kalman.

You can check if everything is correct by comparing the current values at different start points.

 
Prival писал(а) >>

the starting point is very important for recurrence ratios, if the slightest glitch = inaccuracy, this error accumulates. Vinin this is the reason why I wrote my, rather complicated initialisation in Kalman.

Checked the recurrence relation, it's error free - everything should work! I think, Vinin, you have an inaccuracy in your code. I didn't bother to look into it, just threw in my code. Here is the result:

As you can see, there is no drift, everything is OK, the muving is glued to the quote and it doesn't drift.

Prival, I didn't do any "fine" binding to the start point, I just put the first two values equal to the quoted price in these counts. The filter is stable and there is no anomalous sensitivity to coefficient values. Range of their variation, from 0 to 1. Moreover, w1 is responsible for smoothness of MAsha, w2 - for profitability of TS based on it.

The code is attached. You can experiment.

P.S. Vinin, did you encode this recursion?

In my formula, that two pages earlier, I have an error in my calculations. You may correct it if it is wrong.

Files:
 
Neutron писал(а) >>

Checked the recurrence ratio, it's error free - everything should work! I think, Vinin, you have an inaccuracy in your code. I didn't look into it, just threw in my code. Here is the result:

As you can see, there is no drift, everything is OK, the muving is glued to the quote and it doesn't drift.

Prival, I didn't do any "fine" binding to the start point, I just put the first two values equal to the quoted price in these counts. The filter is stable and there is no anomalous sensitivity to coefficient values. Range of their variation, from 0 to 1. Moreover, w1 is responsible for smoothness of MAsha, w2 - for profitability of TS based on it.

The code is attached. One can experiment.

Here is a picture that explains the initialization error

The code Neutron suggested, the difference is that one starts with 5000 bars, the other with 50.

Neutron the difference in the codes (from Vinin) is that your indicator redraws (I think). Make it non redrawable and it will show up (especially the offset will be visible).

 
Prival писал(а) >>

Here is a picture explaining the initialisation error that occurs

The code that Neutron suggested, the difference is one starts at 5000 bar, the other at 50.

Neutron the difference in the codes is that your indicator redraws (I think). Make it non redrawing and it will show.

Yes, since when it will re-draw? Look at the recursive expression in the code. There are opening prices everywhere and if they don't change (and they cannot change), then the filter cannot physically redraw itself with arrival of a new bar!

As for the difference in rendering depending on a start point, it must be so because the filter is recursive and therefore has infinite impulse something there (KIH, or something), i.e. all past muv values are taken into account, and at N=50 and 5000, they are different.

 
Neutron писал(а) >>

Yes, from when will it be redrawn? Look at the recursive expression in the code. There are opening prices everywhere and if they don't change (and they can't), then the filter can't redraw itself with a new bar!

You just do it and program it the way Vinin did. You are right not to take your word for it. Just do it and you will see. Maybe you will get rid of one more illusion.

Reason: