Making a Python trading system for MT. - page 15

 
Maxim Dmitrievsky:

Well, I don't apply any of that, so I'm just observing what's going on.

I just have some vague thoughts.

I don't know where it will go either, or if it will go at all. It's only done to understand the process, nothing more.

 
Yuriy Asaulenko:

I don't know where it will go either, or if it will go at all. It is only for understanding the process, nothing more.

What I do know is that if you build a generalized model on the same data, it's better.

not necessarily linear, of course.

https://docs.pymc.io/notebooks/GLM.html

(Generalized) Linear and Hierarchical Linear Models in PyMC3 — PyMC3 3.6 documentation
  • docs.pymc.io
Lets generate some data with known slope and intercept and fit a simple linear GLM. The function can be used to generate the output variable y_est and coefficients of the specified linear model. Since there are a couple of general linear models that are being used over and over again (Normally distributed noise, logistic regression etc), the...
 
Maxim Dmitrievsky:

I know for a fact that if you build a generalised model on the same data, it's better.

Not necessarily linear, of course.

https://docs.pymc.io/notebooks/GLM.html

All tomorrow.

 

Read the latest posts in the thread carefully.

What can I say... Yuri, dubeya, nevertheless does important research worthy of the theme "From Theory to Practice-2".

So, he argues that traders trading in channels stupidly choose the measure of the central trend incorrectly (MA that has already bored everyone) and get into heavy tails of distributions that literally crush their strategies. If we calculate this measure correctly, we will find out that in the moving window, we are always inside a normal distribution and have the coveted Grail.

Let's look at CLOSE M1 on the EURUSD pair for 2018.

The top chart is the channel relative to the moving median (time window=24 hours). There are indeed some heavy tails there.

Bottom chart - cumulative sum of increments in window=24 hours, i.e. actually price in the moving time window.

We wonder whether the price, as the sum of many independent or weakly independent CBs, belongs to a normal distribution.

We look at the distribution of the sums of the increments over the year:

Statistics:


Yes, indeed, in the limit, prices in the sliding window =24 hours form almost a Gaussian distribution.

It is logical to assume that the best estimate at this point in time, for the current price distribution is also a normal distribution relative to the moving expectation, and that what we take as a heavy tail is not a tail at all, but a value within no more than 6 sigma, belonging to the emerging Gaussian distribution.

I think that yes - Yuri is right.

Conclusions: relative to the non-lagged measure of central tendency we will always be inside the normal distribution. In fact - inside the grail. And if polynomial regression lines are this measure, which I need to check again and again, that's it - the problem is solved.

Thank you for your attention.

 
Alexander_K2:

Read the latest posts in the thread carefully.

What can I say... Yuri, dubeya, nevertheless does important research worthy of the theme "From Theory to Practice-2".

So, he argues that traders trading in channels stupidly choose the measure of the central trend incorrectly (MA that has already bored everyone) and get into heavy tails of distributions that literally crush their strategies. If we calculate this measure correctly, we will find out that in the moving window, we are always inside a normal distribution and have the coveted Grail.

Let's look at the CLOSE M1 on the EURUSD pair for 2018.

The top chart is the channel relative to the moving median (time window=24 hours). There are indeed some heavy tails there.

Bottom chart - cumulative sum of increments in window=24 hours, i.e. actually price in the moving time window.

We wonder whether the price, as the sum of many independent or weakly independent CBs, belongs to a normal distribution.

We look at the distribution of the sums of the increments over the year:

Statistics:


Yes, indeed, in the limit, prices in the sliding window =24 hours form almost a Gaussian distribution.

It is logical to assume that the best estimate at this point in time, for the current price distribution is also a normal distribution relative to the moving expectation, and that what we take as a heavy tail is not a tail at all, but a value within no more than 6 sigma, belonging to the emerging Gaussian distribution.

I think that yes - Yuri is right.

Conclusions: relative to the non-lagged measure of central tendency we will always be inside the normal distribution. In fact - inside the grail. And if polynomial regression lines are this measure, which I need to check again and again, that's it - the problem is solved.

Thank you for your attention.

It looks nice on the graph!

 
Evgeniy Chumakov:

About averages.

You can calculate the average for each symbol in a currency pair. If you add up the averages (eur + usd) and divide by two = price average.

Where I'm going with this? .... I don't know.

p.s. Yuri sorry for getting into the topic.

how is this ? and what is the USD average going to be measured in ?

in idea the same as the EUR average since you put them on the same graph in the same ordinate - so that's what they are measured in ?

 
Maxim Kuznetsov:

How does it measure the USD average?

it is supposed to be the same as the EUR average since you put them on the same graph on the same ordinate - is that how they are measured?

I do not understand your question.

 
Evgeniy Chumakov:

I do not understand the question.

how did you get the "EUR/USD average", the "USD average" and how did they all have the same unit of measurement?

--

ps/ the above chart simply looks like a pair of higher terms from a power series expansion, but with self-made terms misleading

 
Alexander_K2:

Conclusions: relative to a non-lagged measure of the central tendency we will always be inside the normal distribution. In fact - inside the grail. And if this measure is polynomial regression lines, which we need to check again and again, then the problem is solved.

Generally speaking, polynomial regression (PR) is not such a measure, and your hopes for it are in vain. We can indeed get a normal distribution with PR, but only as a set of multiple BP realizations on small samples and PR line lengths. On long samples, PR is no longer able to reconstruct the BP line (what do you want from a 3-4 order curve?)).

The only hope is some kind of approximation of the reg. line by some kind of filter - Kalman, tracking or predicting. I don't know if I'm going to do that, as the normality check turned out as a test of a piece of software intended for other purposes. Especially since I've written several times in Tip that tails are not a property of BP, but a consequence of data processing techniques, which, imho, is already obvious from general considerations. You can't hear anything but yourself there.))

In general, I suppose that already knowing a priori about normality and taking it into account, you can try to do without the exact reg. line in TS.)

Good luck in TA #2).

 
Yuriy Asaulenko:


There will be no TP#2 - there will be a "Battle of the Traders" tournament from February 1. Me and Automat will be there. Would you like to participate?

Actually, my TS still has some weaknesses, of course. One of them is the estimation of the CT measure. Now I use a smart WMA, but there is no limit to perfection :) That's why I paid attention to your research - it's interesting.

So... What else is there to discuss? We discussed everything we need a year ago :)