Fractals - page 19

 

Fractal based indicators

Fractals and Fractal based indicators are based on high/low prices.

Does anyone know if it is possible to change this to OPEN prices?

If not please let me know.

Thanks.

TEAMTRADER

Files:
document1.pdf  30 kb
 

Fractals with choosable price ...

Try this one

Set the PriceHighand PriceLowto 1 (default is 2 for high and 3 for low). Also, to have the same fractals period as the built in fractals indicator to 5. Here is an example when it uses open prices instead of high and low (period is 25 in this example)

TEAMTRADER:
Fractals and Fractal based indicators are based on high/low prices.

Does anyone know if it is possible to change this to OPEN prices?

If not please let me know.

Thanks.

TEAMTRADER
 

Thanks

Thank you.

I've done the amendment as you suggested above and it works well, thanks.

Is there any way to get the fractal to 'recognise' on the immediate following candle rather than the second following candle?

I've looked at the code and I've copied and pasted below the part that may be relevant. If this is understood? I presume a buffer is to stop something happening immediately - but in this case I need it to happen/show immediately.

Thanks again.

TEAMTRADER

buffers

double v1[];

double v2[];

double val1;

double val2;

int i;

int init()

{

IndicatorBuffers(2);

 

...

I presume a buffer is to stop something happening immediately...

No, buffers in mql do not do that

In mql buffers are special arrays, and if they are also a "drawing" buffer, whatever is placed in them is also drawn on the chart. There is no delay in drawing (as soon as the calculating loop is done, whatever is in the drawing buffer is drawn, and it happens on each and every tick). The delay in drawing fractals is due to the nature of fractal calculation : the built in fractal that you are trying to use will draw a fractal only after 2 bars. The one that I posted is not doing so, but the current fractal (peak) is a subject of change if it is drawn on a bar that is less than half-1 bars from the current bar

TEAMTRADER:
Thank you.

I've done the amendment as you suggested above and it works well, thanks.

Is there any way to get the fractal to 'recognise' on the immediate following candle rather than the second following candle?

I've looked at the code and I've copied and pasted below the part that may be relevant. If this is understood? I presume a buffer is to stop something happening immediately - but in this case I need it to happen/show immediately.

Thanks again.

TEAMTRADER

buffers

double v1[];

double v2[];

double val1;

double val2;

int i;

int init()

{

IndicatorBuffers(2);
 
mladen:
Try this one

Set the PriceHighand PriceLowto 1 (default is 2 for high and 3 for low). Also, to have the same fractals period as the built in fractals indicator to 5. Here is an example when it uses open prices instead of high and low (period is 25 in this example)

This tiny Indy is simply beautiful, it may use in the place of Zigzag, could you please make a multi-timeframe version ? (e.g., h1 h4 d1).

Another point is how to call this indy for other function, like in Vilka indicator, it uses the default Fractals, how about use this one?

Thanks.

 

...

jeandl

Here you go Also, in it you will find how it can be called via iCustom() (this indicator is a standalone indicator - it calls itself to do the calculation and using very similar method you can use a iCustom() call from any other code to retrieve values of this indicator)

In general, if you call this one, use this form :

iCustom(symbol,timeFrame,"Fractals - adjustable periods & price & mtf","",FractalPeriod,PriceHigh,PriceLow,UpperArrowDisplacement,LowerArrowDisplacement,0,shift);[/PHP]

and if you want to use the previous version, use this form (one (the first one) parameter less)

[PHP]iCustom(symbol,timeFrame,"Fractals - adjustable periods & price",FractalPeriod,PriceHigh,PriceLow,UpperArrowDisplacement,LowerArrowDisplacement,0,shift);
jeandl:
This tiny Indy is simply beautiful, it may use in the place of Zigzag, could you please make a multi-timeframe version ? (e.g., h1 h4 d1).

Another point is how to call this indy for other function, like in Vilka indicator, it uses the default Fractals, how about use this one?

Thanks.
 

Voila, very efficient, highly appreciated.

 

mladen and Fractals Adjustable Period

The signal dots in the indicator "Fractals - adjustable period & price" keep moving, similar to the ZigZag indicator. Other Fractal indicators give fixed signals that do not move. I'm sure there is a difference but I don't understand why.

 

...

It was intentionally made that way. Last dot in the "adjustable period" version moves if newer highest high or lowest low for the desired period is found. If you want to avoid that, simply change the main loop from this :

for(i=limit; i>=0; i--)

[/PHP]

to this :

[PHP] for(i=limit; i>=half; i--)

and it will work as you expect it (but it will do the same thing as the built in fracytals - the dot will apper at half calculating bars back in the past only - the idea was to have an "early warning" of possible new fractals forming the way the "adjustable period" was made).

michaelB:
The signal dots in the indicator "Fractals - adjustable period & price" keep moving, similar to the ZigZag indicator. Other Fractal indicators give fixed signals that do not move. I'm sure there is a difference but I don't understand why.
 
mladen:
jeandl Here you go

Hi, Mladen,

Thanks for the MTF version.

My idea is to show multiple fractals on the same chart. Here I tried to do that, but my mql4 level is only limited to copy and past, minor modification, I made the following to show, for example, on H1 and H4, but, it showed up some messy dots on H4, could you please correct it?

Modifications: 1, to save source, set limited scan bars; 2, change arrowdisplacement; 3, add a high TF fractal function.

I think the problem is the High TF bars counting, but don't know how to fix it. I could not understand what your code in the MTF version how accomplished it.

Reason: