Hi everyone,
I've been struggling with getting the code for this right for a while now. I'm very new to coding so really am fumbling through it, but am hoping someone will be kind enough to quickly knock something up for me. Hopefully it's a simple task for someone who knows what they're doing!
In essence, I want to compare the position of fractals on a timeframe higher than that which my chart is currently displaying. For the purpose of describing this, let's call it H1 v D1. So with reference to the below image, when fractal 'b' prints on the D1 chart, it is higher than fractal 'a', therefore the condition is satisfied because the most recent upper fractal is higher than the previous upper fractal. When fractal 'c' then prints the condition is no longer satisfied as now the most recent upper fractal is less than the previous upper fractal 'b'. So the coding requires storing the values of the most recent fractal and of one fractal previous and then comparing them. And then continually updating those values as new fractals are formed. Where I fall down is achieving this from the H1 chart, but referring to the D1 chart with a reference to the higher timeframe in the code.
And that's about it. Thanks in advance to anyone willing to offer me the code. For the purpose of the indicator the higher timeframe could be user defined in the indicator settings to allow the user to attach the indicator to any timeframe chart and then specify whatever higher timeframe they wish for comparison of the latest fractal higher high, lower high, lower low or higher low pattern. There's not much point in me attaching my current code as I've messed it right up!
Thanks!
I've been struggling with getting the code for this right for a while now. I'm very new to coding so really am fumbling through it, but am hoping someone will be kind enough to quickly knock something up for me. Hopefully it's a simple task for someone who knows what they're doing!
In essence, I want to compare the position of fractals on a timeframe higher than that which my chart is currently displaying. For the purpose of describing this, let's call it H1 v D1. So with reference to the below image, when fractal 'b' prints on the D1 chart, it is higher than fractal 'a', therefore the condition is satisfied because the most recent upper fractal is higher than the previous upper fractal. When fractal 'c' then prints the condition is no longer satisfied as now the most recent upper fractal is less than the previous upper fractal 'b'. So the coding requires storing the values of the most recent fractal and of one fractal previous and then comparing them. And then continually updating those values as new fractals are formed. Where I fall down is achieving this from the H1 chart, but referring to the D1 chart with a reference to the higher timeframe in the code.
And that's about it. Thanks in advance to anyone willing to offer me the code. For the purpose of the indicator the higher timeframe could be user defined in the indicator settings to allow the user to attach the indicator to any timeframe chart and then specify whatever higher timeframe they wish for comparison of the latest fractal higher high, lower high, lower low or higher low pattern. There's not much point in me attaching my current code as I've messed it right up!
Thanks!

Attached Image