Machine learning in trading: theory, models, practice and algo-trading - page 2638

 
Aleksey Vyazmikin #:

Yes, I agree that there is not enough data, which is why I take as much history as possible. Of course, the more examples, the more confident the result, in theory, but what is there is there.

I just need a tool with an accurate metric to assess the trend/distribution/type of waves over time to identify any trend within them. What are these trends, for example:

- If there was a positive outcome after a pattern for a long time, a negative outcome is more likely when a new pattern emerges;

- The outcome is equally distributed across all sections of the sample (how do you divide into sections correctly?);

- If there has been a negative pattern outcome for a long time, a positive outcome is more likely to occur;

- If there was no pattern for a long time, positive/negative outcome is more likely when it appears.

Basically something like this. This is a statistical interval, but it should be at intervals of history. The question for me is what is the best way to slice these intervals (measure at different intervals, make a shift) to make correct estimate and express preferably by some generalized coefficient.

The simplest solution is a statistic that is calculated in some series of tests. In trading it is usually mentioned in the context of the search for the dependence of a trade result on the previous one. If any dependence/seriality is noticeable, you can try to study its structure. Here, it probably makes sense to look at Markov chains and use as metrics some functions of their probability matrices.

For slicing history intervals, I usually use a large zigzag. It's probably not optimal, but it's fairly simple and relatively objective.

 
Aleksey Nikolayev #:

The simplest thing you can think of is a statistic that counts in some kind of series test. In trading it is usually referred to in the context of finding the dependence of the result of a trade on the result of a previous trade. If any dependence/seriality is noticeable, one can try to study its structure. Here, it probably makes sense to look at Markov chains and use as metrics some functions of their probability matrices.

A little more about Markov chains in this context.

If we are just talking about seriality, we can introduce two states + and - which denote the quality of pattern realization. Accordingly, there are four possible ways of moving from one pattern to the next: "+"->"-", "+"->"+", "-"->"+", "-"->"-". The transitions correspond to four probabilities (of which only two are independent), which form the probability matrix of this chain.

If we are talking about series length, the states will have to be more complicated. For example, they can be pairs (+,n) and(-,n), where in addition to the quality of pattern realization, there is n - number of the pattern in the series containing it. We get a potentially infinite number of states, but the possible transitions (with non-zero probability) are also four: (+,n)->(+,n+1), (+,n)->(-,1), (-,n)->(+,1), (-,n)->(-,n+1). It will also turn out four probabilities (with two independent ones). The difference is that now the dependence of these probabilities on the series length n appears (or not). We can try to express this dependence through some coefficient and use it as the required metric.

 

Good afternoon! Shalom! Nairamdal!

You're all great mathematicians, I see.

Then we can do it.

 
Why aren't you studying market integrity?
 
Saas'sparents never managed to get him used to pooping only in designated areas.
 
Alexander Ivanov #:
Why don't you study market integrity?
Why don't you study market diference? Why don't you study market dispersion? Why aren't you studying market spectrality? Why do you.......
Are you talking nonsense?
 
What are we actually forecasting?

We all know that the market is a complex process, complex from the word 'complex'. The market is created by many participants with different goals, sizes of pockets, different trends...

For example, let's build a simple sine wave trend that the price follows(in our model), let's call it a "trend".

par(mar=c(2,2,2,2))
my.sin <- function(ve,a,f,p)    a*sin(f*ve+p)
trend <- my.sin(ve = 1:100,a = 1,f = 0.05,p = 1)+100
plot(trend,t="l")

A simple price model, easy to understand and easy to predict.

Now let's imagine that some strong market buyer entered "our market" and made strong investments in "our market" for some time.

layout(1:2, heights = c(10,3))
plot(trend,t="l",lty=2) 
lines(trend+buy)
plot(buy,t="l",col=3,lwd=2)

as you can see our beautiful model is a bit broken...

Now let's imagine that at the price of say 99.2 someone put a big limit and bought everything he was given

buy_limit <- trend
for(i in seq_along(trend)) if(buy_limit[i]<=99.2)  buy_limit[i] <- 99.2
layout(1:1)
plot(trend,t="l")
lines(buy_limit+buy,lty=2)
segments(10,99.2,100,99.2,lty=2,col=3)

So we get such a curve of the price model, but closer to reality

plot(trend,t="l",col=8,lty=2)
lines(buy_limit + buy ,t="l")

Also for even greater realism we will add noise, for example trading of small or market makers

noise <- rnorm(100,sd = 0.05)
plot(trend,t="l",col=8,lty=2)
lines(buy_limit+buy+noise)


That's how you can look at the market as a complicated process.

Now it is interesting to reflect. When we forecast the price, what exactly are we forecasting? the trend? the market buyer? the limit buyer? the noise? :) and should we predict it all together?

 
mytarmailS #:
What are we actually forecasting?
25 again :) the basics of econometrics have gone. Not to go around in circles: you can only forecast cycles and seasonal components in a time series
 
Maxim Dmitrievsky #:
25 again :) the basics of econometrics have gone. Not to go around in circles: you can only predict cycles and seasonal components in a time series
No, it's not that simple.
 
mytarmailS #:
Nah, it's not that simple.
It's not easy to isolate them, but otherwise, what's the point of complicating things?