Page 1 of 1

Fractal engulfing candle

Posted: Tue Feb 07, 2023 3:28 pm
by Moonboy_Morty
Hi all,

I'm watching the video now about the fractal engulfing candle. And I just can't wrap my head around one thing.

In order to check if there has been a lower low or higher high in the last 10 days, you write:

swingHigh = high == ta.highest(high, 10) or high[1] == ta.highest(high, 10)
swingLow = low == ta.lowest(low, 10) or low[1] == ta.lowest(low, 10)

Why is the sign here == instead of => or =<?

We want to see whether in the last 10 days, any candle was equal or higher than the current high or equal or lower to the current low. Not whether its exactly the same as the current high or the current low.

Got totally frustrated after this video cause I followed all the logic everything makes perfect sense and then one thing happens that doesn't make any sense and I get internal errors haha.

Thanks! :zen:

Re: Fractal engulfing candle

Posted: Wed Feb 08, 2023 7:53 pm
by processingclouds
Hey,

Yes, the check should be >= and <= ,

as using == will only work if at some point in the 10 bars the highs are equal which is more rare.