same shape between price and your indicator? - page 2

 

Interesting zzuegg,

I had a different idea: you look at the sign of the change of the indicator, and you also look at the sign of the change of the close price. if these are equal, you assign a 1, else you assign a -1. This gives you a "percentage of equality of change" on a window: add the -1's and the 1's and divide the sum by the window length to get a percentage (value between 0 & 1). It also allows for a difference in values between indicator and price. So you could say that right now there is a perfect fit if the price has made a V shape and your indicator has done the same. This tells you in real time how good the fit is. I have code for that if you are interested.

The next step would be to use this information and work the other way around: as an input for the window function of the indicator you use the +1 and -1 values over a window. I am thinking maybe with some sort of logistic regression you could create a model that as output gives you the required window length for an indicator. So you could take that function, feed it the +1's and -1's and as an output the function gives you the required window length for your indicator.

What do you guys think?

 
MrH:

Interesting zzuegg,

I had a different idea: you look at the sign of the change of the indicator, and you also look at the sign of the change of the close price. if these are equal, you assign a 1, else you assign a -1. This gives you a "percentage of equality of change" on a window: add the -1's and the 1's and divide the sum by the window length to get a percentage (value between 0 & 1). It also allows for a difference in values between indicator and price. So you could say that right now there is a perfect fit if the price has made a V shape and your indicator has done the same. This tells you in real time how good the fit is. I have code for that if you are interested.

The next step would be to use this information and work the other way around: as an input for the window function of the indicator you use the +1 and -1 values over a window. I am thinking maybe with some sort of logistic regression you could create a model that as output gives you the required window length for an indicator. So you could take that function, feed it the +1's and -1's and as an output the function gives you the required window length for your indicator.

What do you guys think?

Thats basically the same idea. However by changing the indicator to 'correct' the issues you will get a totally different indicator. (to read out divergences should not be possible anymore)

It strongly depends what you want that the indicator shows.

 
zzuegg:

Thats basically the same idea. However by changing the indicator to 'correct' the issues you will get a totally different indicator. (to read out divergences should not be possible anymore)

It strongly depends what you want that the indicator shows.


right, my idea is to create a new, better fitting indicator that still has some of the smoothing/normalization properties of the original. I want to create a derivative of price that is more easily tradable than price itself.
 

Regarding smoothing: use gaussian filtration or jurik smoothing. for me they have the best lag/smooth ratio.

Normalization, well, i do not like normalized data. For me, if not normalized trough the original formula (WPR ecc.) normalization removes only information without adding readability. (At least if you don't want apply neural nets).

For me, price is price, and any indicator removes informations. (do not understand me wrong, i use indicators, but always in combinations with the price)

 
zzuegg:

Regarding smoothing: use gaussian filtration or jurik smoothing. for me they have the best lag/smooth ratio.

I'd never heard of Jurik Smoothing so I googled it. And then I found out that the "AllAverages" indicator I downloaded from this site has a JSmooth filter in it, although trying to understand what it is doing from the code is non-trivial to say the least.
 

And then there are other contenders, Jurik Moving Average (JMA) and Precision Lagless Average, both of which are pay money and undisclosed algorithm indicators. I'm unsure how Jurik Smoothing relates to JMA.

Perhaps the most interesting thing about the Jurik Smoothing from the AllAverages_v2.5 file is ...

// MA_Method=20: JSmooth - Smoothing by Mark Jurik
double JSmooth(double price,int per,double pow,int bar)
{
   double beta = 0.45*(per-1)/(0.45*(per-1)+2);
   double alpha = MathPow(beta,pow);
   if(bar == 2) {tmp[bar][4] = price; tmp[bar][0] = price; tmp[bar][2] = price;}
   else 
   if(bar > 2) 
   {
        tmp[bar][0] = (1-alpha)*price + alpha*tmp[bar-1][0];
        tmp[bar][1] = (price - tmp[bar][0])*(1-beta) + beta*tmp[bar-1][1];
        tmp[bar][2] = tmp[bar][0] + tmp[bar][1];
        tmp[bar][3] = (tmp[bar][2] - tmp[bar-1][4])*MathPow((1-alpha),2) + MathPow(alpha,2)*tmp[bar-1][3];
        tmp[bar][4] = tmp[bar-1][4] + tmp[bar][3]; 
   }
   return(tmp[bar][4]);
}

My reading of this code suggests that it does not draw bars 0 and 1 at all :-(

I'm not sure how this can be considered as low lag (but of course it will look good when drawn on a historical chart)

 
dabbler:

And then there are other contenders, Jurik Moving Average (JMA) and Precision Lagless Average, both of which are pay money and undisclosed algorithm indicators. I'm unsure how Jurik Smoothing relates to JMA.

Perhaps the most interesting thing about the Jurik Smoothing from the AllAverages_v2.5 file is ...

My reading of this code suggests that it does not draw bars 0 and 1 at all :-(

I'm not sure how this can be considered as low lag (but of course it will look good when drawn on a historical chart)


AFAIK jurik filter is free. It's part of the smoothing algos in the mql5 codebase.

If have a jurik filter from trendlaboratory's. I have search and seen that you have to pay a membership for that, but i can remember that this wasn't the day i got it. Well, i will not post the indi, since i don't know about it's licensing.

Jurik filter is indeed very hard to understand, i have never revealed it's internal working. However, mine does not repaint on bar 1. (Bar 0 of course since it is close price based)


Jurik filter: (changes color on slope)

Gaussian filter: (changes colors on slope + dots for acceleration)

They have both advantages. I personally use mostly the gaussian because i know what it does :D

 

ok but getting back on topic: what methods do you use to deal with the non-stationarity of the market?

Do you adapt your look-back windows or not?

 
MrH:

ok but getting back on topic: what methods do you use to deal with the non-stationarity of the market?

Do you adapt your look-back windows or not?

Hm, i could be totally of roads, but shouldn't a simple % based oscillator give you a stationary view of the data?


 

If you do a ADF-test for the presence of unit root on the first difference you will see that it has a p value below .05, so taking a first difference makes it stationary.

I guess I should have said: do you adapt your indicators to the non-periodicity of the market. Because % or first difference can be stationary, they are still not periodic.

That is the main question here: why use constant look-back lengths of indicators if the input data of that indicator is not periodic.

Reason: