Random Flow Theory and FOREX - page 19

 

lna01

"...In particular, the arbitrariness of the choice of linear regression length is already in question at this stage..."

I agree. But I think this question can be answered. We should investigate the "lifetime of the models". It seems to me that it (time) should determine the depth of linear regression. That is where the art begins, because the criterion for model divergence, and the model itself and its parameters can be adjusted as needed + run through history + collect statistics. And only then can we draw any conclusions. I want to quote Yurixx, who very accurately noted "In fact, there are no studies that provide statistics on the life expectancy of models. Moreover there are no data on the amount of information (=lag time) needed to recognise the model. Even those who introduce and use these models prefer not to conduct or publish such studies. Apparently it is believed that if the strategy has a positive mo, then the model is still recognised before the probabilities align."

By getting the answer to the lifetime of the model and the time needed to recognise it you will be 1 step away from creating a TS.

Mathemat

"...Now you need to replace a*x+b with something more meaningful that actually removes the trend..."

Of course you can, but the only question is at what degree of polynomial to stop. You can also approximate it with splines, even more accurately.

All the same, it seems to me we should opt for a straight line for the following reasons. 1. MOJ=zero. 2. Many people often noticed that the price seems to oscillate in relation to some level. The straight line seems to be closer to the level than the parabola. When we are able to make all the necessary tools for flow analysis, we may come back to this question and see if it is better. But let's deal with the straight line first, so we have something to compare it with.

I really want to detrend the process and analyse its residuals. As CANDID said !!! There is always a straight line equation (trend). You just have to answer the question of how much depth to build it to.

Today I was modelling the quote flow, I took GBPUSD M1 for 23.11.2007. Here is the chart (Fig. 1)

Fig. 1

Fig. 2

RMS, correlation time and natural frequency were taken from ACF.

And substituted into equations

The results are shown on the graph. The red line is the model. The blue line is the quotes after subtracting the trend.

Fig.3

Description of various models can be found here. P.279. Tikhonov V.I. "Nonlinear transformations of random processes." -M.; Radio and Communication, 1986.

I recommend those who are interested and want to research the market to find this book. Here is a phrase from it.

Page 21. "The concepts of envelope, phase and instantaneous frequency are formally applicable to any random process. .... These concepts are used for approximate solutions to specific radio engineering problems and are therefore hardly ever encountered in mathematical works on random processes."

In particular, the model I used is a model describing behaviour of an oscillating circuit after a random process has been applied to it. The ACF of the process is

Fig.4

And now for dessert :-). Find 10 differences between Fig.4 and Fig.2.

P.S. The trend is always present; I can build a straight line in any timeframe, for any quotes. The only question is how long it lives!

P.P.S. And there is always a flat, the question is only frequency, amplitude and damping coefficients

 
rsi:
Prival:

rsi try to answer the question "...probabilistic ..." on the probability of what does Better neural network tune?

...So (to answer the question posed), the network (each of its outputs) is tuned to the probability of matching the input vector to the decision (output) in the most plausible way possible.


I would build it exactly the other way round. First, I would define the output (what the network is tuned to), and then I would think about the input.

And I think Batter gave a hint: "Positions close when the probability of heading in the opposite direction increases." The way I would build a neural network, Batter may have gone that way. 1. There is an excellent indicator called ZigZag. I use it to find critical points on quotations, points where there is a change in course direction. 2. I look for a set of indicators and their parameters at the input of the National Operator, which allows with a certain probability to reach such points (more likely, the areas), the better with probability 1 :-).

I am going this way, only I don't want to simply look through all possible indicators and their parameters at the NS input, to hit these points (recognize). I want to input the "market behavior" models incorporated in the Kalman filter. Having previously examined these models for adequacy, lifetime and time needed for their detection. Most likely there will be 3 types of models when classifying them by lifetime. Small, medium and large. Then we will have 3 in 1.

But whether it will be NS in its classical sense, I do not think.

Here is one of the inputs. This is a modification of the indicator often discussed in this thread.

 

Build a chart of bars whose breakdown is based on ticks, not time !!! Mathemat 's great idea expressed in another thread.

I just want to reflect it here as well with explanations. The source stream is a tick stream. Any transformation of it into bars is a non-linear transformation but we are forced to work with them because we can only reliably reconstruct its history on minutes.

The proposed construction reduces the non-stationary flow that we are trying to analyze to a flow whose intensity equals const. On the first page it was said about IP - momentum function of the first order is one of its most important characteristics. It will be another price series with different characteristics, but the result can indeed be interesting. For example, it is very interesting how ATR will behave on this series, and other standard indicators as well. What will be the AKF and spectrum of this series.

If someone has an archive of ticks. Let at least a week share. Please give this archive to komposter. He is a wizard, he can handle it. Or post it here with explanations for currency and time interval. Graphs to build and will certainly post.

P.P.S. Maybe the market lives in a different time dimension and 1 second is 1 tick.

 

Archive of ticks since 2000 by year and month: http://ratedata.gaincapital.com/

The idea of tickframes (as opposed to timeframes) has been discussed here many times and for a long time. Its authorship is evidently of popular opinion, because even KGB cannot find out the person who has questioned it for the first time. There was a wish expressed, that MT5 would give an opportunity to have tickframes in a standard set of tools of price charts displaying. Maybe the developers will do it. On the fxclub forum Northwind has published very interesting materials containing researches of tickframes distributions as well: http://forum.fxclub.org/showthread.php?t=32864 and http://forum.fxclub.org/showthread.php?t=32942

And there is no doubt that the market has its time.

 

Yes, the idea has been discussed for a long time, and I am familiar with these Northwind studies. I just pointed it out not in the context of trading, but in the context of the distribution function and the very different nature of the process in general.

It is in the wild non-stationarity of tick lags (that is the real reason for fat tails and other nastiness), while the ticks themselves have a very clear discrete FR in amplitude (actually - two sharp +-1 peaks with amplitudes almost equal even in a strong trend; the contribution of other ticks withlarger amplitudes is insignificant). We are very fond of discussing the price component of the market, but rarely think about the time component.

As for the ticks archive, be careful, because the density of ticks flow may significantly differ in different dealers. And is this archive really necessary for the indicator? The data on tick volumes is quite enough.

P.S. Of course, the data on tick volumes is not enough. But if we have tick volumes of minutes, it is already quite enough to draw "almost equivolume" bars.

 

Prival asked and I answered.

As for the distribution, I don't see what the problem is. It takes 10 lines of code to build bars of equal size, and it takes the same amount of effort to build a distribution function for them. The whole event can be implemented in a very compact script. What prevents you from doing that?

And what does the tick stream density have to do with it? Why bring time into it again if it is supposed to spoil the whole picture? Besides, for the constant volume bars higher density will only lead to more of them on the same time interval. So what? What does the timeframe have to do with it if the idea is to get away from timeframes? And finally, what do different dealers have to do with it? Exactly because they are different ! If the methodology works for some dealers and not for others - rubbish.

In short, if it is interesting to see, then you need to look, rather than make up excuses. If it were in my area of interest, I would have done it all long ago.

 
Prival, found an indicator that may come in handy. It has the author's address.
Files:
 
rsi:
Prival, found an indicator, might come in handy, the author's address is there.

Thank you. I looked it up, the name is nice. But unfortunately it's not Kalman filter, if I understood the code correctly, it's degenerated case, so called alpha-betta filter. A real (correct) filter has to compute these coefficients by itself and produces adaptation to input stream + it (the filter) is multidimensional.

Here is one of possible algorithms, so called S modification of Kalman filter


p/s/though this line is not a bad idea, it may come in handy. Thanks again.

return((iHigh(NULL,0,shift)+iLow(NULL,0,shift)+iClose(NULL,0,shift)+iClose(NULL,0,shift))/4);
 

Prival, do you have a working version of this filter written in Mathcad environment? If yes, please post it, with necessary explanations, in format no newer than Mathcad2001 Worksheet. As I understand, the code must have one input, one output and several adjustable parameters. Let's see what the beast is all about!

 
Neutron:

Prival, do you have a working version of this filter written in Mathcad environment? If yes, please post it, with necessary explanations, in format no newer than Mathcad2001 Worksheet. As I understand, the code must have one input, one output and several adjustable parameters. Let's see what the beast is all about!

Here it is, it's one of my working versions. Only so far not everything is as smooth as I want it to be. As for the adjustable parameters, there aren't any in the usual sense. The Kalman filter is tuned by nesting (setting) using three matrices. The 1st is matrix F, which contains a model of the process being filtered in the program, which is the flow velocity + its acceleration V(k)+a(k). The 2nd matrix is the model excitation noise Dx. And the 3rd matrix is the variance of the measurement noise, in the program the degenerate case D_score=const.

In the process, the filter adjusts itself to give more credence to the measurement or the model.

I'm struggling with measurement noise at the moment, maybe rsi was right that there is no measurement noise. But then questions arise with the filter divergence criterion. How do you determine if the input stream is no longer consistent with the nested model.


there are two files in the archive, one for matcad 14 and one for version 11, but it was fighting
Files:
kalman.zip  116 kb
Reason: