Step 1: Modifying existing fractal indicator to account for EQUAL highs and lows
An up fractal occurs when there is a low point with one HIGHER or EQUAL low candles on each side of it.
A down fractal occurs when there is a high point with one LOWER or EQUAL low candles on each side of it.
The reason for the need to create the simple fractal indicator from scratch is because the default fractals indicator doesn’t account for candles besides with EQUAL highs and lows.
As you can see in the above example, there should be a fractal where I placed the red arrow based on our custom fractal indicator, because the candle in front has the same high.
In the event of a case of equal highs, I want the fractal to be drawn on the first candle instead of the next one or third one (in rare cases).
2. Display fractals in another timeframe on the current timeframe.
For 1m timeframe display fractals on the 5m timeframe
For 5m timeframe display fractals on the 15m timeframe
For 15m timeframe display fractals on the 1h timeframe
For 1h timeframe display fractals on the 4h timeframe
For 4h timeframe display fractals on the D timeframe
For D timeframe display fractals on the W timeframe
For W timeframe display fractals on the M timeframe
For M timeframe display fractals on the 3M timeframe
For 3M timeframe display fractals on the 12M timeframe
Existing code for basic fractal indicator
//@version=3
study("Fractals - Custom Periods", overlay=true)
fractalPeriods = input(title="Fractal Periods", defval=2, minval=1, type=integer)
bullFractal = pivothigh(fractalPeriods, fractalPeriods)
bearFractal = pivotlow(fractalPeriods, fractalPeriods)
plotchar(bullFractal?true:na, title="Bull Fractal", location=[login to view URL], offset=-fractalPeriods, color=black, transp=0, size=[login to view URL], char='▴')
plotchar(bearFractal?true:na, title="Bear Fractal", location=[login to view URL], offset=-fractalPeriods, color=black, transp=0, size=[login to view URL], char="▾")
hi there, i read your requirements and can do this fast and output will be reliable, bug-free, warning-free, smooth.
also can add a simple time frame change to code if you like to see other higher-tf fractals in lower time frame. this will charge extra like 30SGD. you can see same idea in my resume jobs or start a chat to send a file.