PPZ calculation - help to refine

 

Hi all.

I wrote an indicator to automatically calculate PPZ using three fractals. The basic idea: we take a window of N bars and determine the levels where 3 fractals are located at the shortest distance. The indicator plots 4 such levels. The problem is in the speed. The indicator uses blunt overshooting, nothing just comes to mind. Now that the bar window is 100-300, it's not a problem in principle. But now I'm thinking about adding a 4th fractal and I realize I need to change the calculation algorithm. What are your thoughts? Imho, the tool already builds interesting levels. I am attaching the code and a picture with explanations.


Files:
 

Improved the indicator, now the levels are searched by 4 fractals.

At 150 bars the calculation takes up to 30 seconds, do not be alarmed. It is categorically not recommended to set more than 200 bars.

In this case levels are much stronger and correct. It looks like this thing really works!


Files:
 

Eurobucks the other day:


 

It's a great indicator.

I get an error:

2010.02.22 15:46:17 Dsergf-wPA_v2.0 EURUSD,M15: invalid integer number as parameter 1 for SetIndexEmptyValue function


PS

It would be very nice to specify the timeframe from which the levels are built.

 

Reposted the indicators.

Strange that it worked for me, there was of course an error

 

Eurobucks M15

No comments.


 

No, it seems to be working, but the error message is a bit confusing.

 

I have corrected the error.

It's no problem to set the timeframe - I'll do it tomorrow, I don't have time right now.

The bad thing is that it's so slow, I'd like to make the window wider, but I have to seriously optimize the algorithm, and I haven't figured out how to do that yet. :-(

 
Optimised the algorithm, it is safe to put in 300 bars
Files:
 

I think there is a small mistake in the code :



if(k!=j && k!=j && MathAbs(Ind0[i]-Ind0[k])>minBars && MathAbs(Ind0[k]-Ind0[j])>minBars) {


you need to correct one j by i


 

Yeah, a mistake. Doesn't affect the result, but needs to be fixed.

Re-downloaded indicator version 2.3

Reason: