PPZ calculation - help to refine - page 11

 
Dserg:
There is another idea - it is more advantageous to search for the minimum value of the function with dimension of 4 and more, as in my case, by Monte Carlo method, rather than by stupid search, as it is now. Particularly strong gains are expected on a large number of bars.

Isn't it easier to perform optimization with sampling only those elements that will only participate and not all of them in a row like ...

        for(int FxIndex = 0; FxIndex < FCount; FxIndex++) {
                for(int NxIndex = FxIndex+1; NxIndex < FCount; NxIndex++) { 
                        for(int YxIndex = NxIndex+1; YxIndex < FCount; YxIndex++) { 
                                for(int ZxIndex = NxIndex+1; ZxIndex < FCount; ZxIndex++) { 
                                        if ((MathAbs(TimeBuf3[FxIndex]-TimeBuf3[NxIndex])>RangeBarsOfFractal)&&
                                                (MathAbs(TimeBuf3[NxIndex]-TimeBuf3[YxIndex])>RangeBarsOfFractal)&&
                                                (MathAbs(TimeBuf3[YxIndex]-TimeBuf3[ZxIndex])>RangeBarsOfFractal)){
                                                        PPZLevel = (TimeBuf2[FxIndex]+TimeBuf2[NxIndex]+TimeBuf2[YxIndex]+TimeBuf2[ZxIndex])/4.0;
                                                        PPZRange=(TimeBuf2[FxIndex]-Median)*(TimeBuf2[FxIndex]-Median)+(TimeBuf2[NxIndex]-Median)*(TimeBuf2[NxIndex]-Median)+
                                                                        (TimeBuf2[YxIndex]-Median)*(TimeBuf2[YxIndex]-Median)+(TimeBuf2[ZxIndex]-Median)*(TimeBuf2[ZxIndex]-Median);
                                                        //Print(FxIndex,":",PPZLevel,"  ",PPZRange);
                                                        if ((SqrRange<PPZRange)||(SqrRange==EMPTY_VALUE)) {
                                                                ayPPZLevel[0]=PPZLevel;
                                                                SqrRange=PPZRange;
                                                        }
 
Geronimo:
which is better?

In order to be guaranteed to drain the depot, both are suitable. Take your pick :)
 

Sketched out a preliminary code for the Monte Carlo calculations. Everything flies with the number of iterations up to 1e6. The problem is that I need a proper random number generator, the built-in one is useless. Found a package with external dll on the forum, I'll try it.

I can already see the pluses of such approach - Monte Carlo methods are almost insensitive to dimensional growth, so I can easily increase number of reference fractals up to 8. The speed of computation is not affected. Additionally, the search window can be seriously expanded, up to 1000-1500 bars, which allows plotting more serious levels.

I see the potential of the indicator and I want to improve it.

There are two main purposes for it:

- filter when opening a trade (not to buy into resistance and not to sell into support)

- targets for trades (takei)

 
"need a proper serious random generator" Look here, http://www.swin.edu.au/astronomy/pbourke/software/random/
Files:
randomlib.txt  7 kb
 

Screwed in the library. Everything works.

First results on the Eurobucks on the dailies, 500 bar window, 6 fractals, 100 bar forecast:

Is there a level or not, huh? Who sees what? Is it working or what?

 
Is there any way to objectively assess whether the levels are working or not?
 
Dserg:
Is there any way to objectively assess whether the levels are working or not?

You can check from history, but the present only the future will tell
 
Vinin:

You can check on history, but the present only the future will tell

I can see that. For example, I calculate levels on a window from 500 to 100 bars and want to estimate their performance from 0 to 100 bars. How? Ideally, I would like to get some coefficient or number. I have heard something about the overshoot coefficient, but I don't know what it is. I don't want to reinvent the wheel (with square wheels and tracked).
 
Dserg:

This is understandable. Here's an example, I calculate levels on a window from 500 to 100 bars, and I want to assess their performance from 0 to 100 bars. How? Ideally, I would like to get some coefficient or number. I have heard something about the overshoot coefficient, but I don't know what it is. I wouldn't like to reinvent the wheel (with square wheels and caterpillar tracks).

Bulashov has something on the subject
 

Finalised the indicator.

Current levels on the Eurobucks D1:

Reason: