Fractal based indicators- coding

 

Fractals are based on highs and lows.

Does anyone know how to change fractal based indicators to OPEN prices?

The bit of code that I think needs amending is below. But not being a coder does not help!

Thanks to anyone who can help.

Regards

TEAMTRADER

val1 = iFractals(NULL, 0, MODE_UPPER,i);

if (val1 > 0)

v1=High;

else

v1 = v1;

val2 = iFractals(NULL, 0, MODE_LOWER,i);

if (val2 > 0)

v2=Low;

else

v2 = v2;

 

...

TEAMTRADER

The answer to that was posted here : https://www.mql5.com/en/forum/173009/page13

TEAMTRADER:
Fractals are based on highs and lows.

Does anyone know how to change fractal based indicators to OPEN prices?

The bit of code that I think needs amending is below. But not being a coder does not help!

Thanks to anyone who can help.

Regards

TEAMTRADER

val1 = iFractals(NULL, 0, MODE_UPPER,i);

if (val1 > 0)

v1=High;

else

v1 = v1;

val2 = iFractals(NULL, 0, MODE_LOWER,i);

if (val2 > 0)

v2=Low;

else

v2 = v2;
 

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.

Thanks again.

TEAMTRADER

buffers

double v1[];

double v2[];

double val1;

double val2;

int i;

int init()

{

IndicatorBuffers(2);

Reason: