amv-dev / yata

Yet Another Technical Analysis library [for Rust]
Apache License 2.0
321 stars 49 forks source link

Fractal Indicator #31

Open JoeTonDev opened 1 year ago

JoeTonDev commented 1 year ago

The formulas for fractals are: Bearish Fractal= ​High(N)>High(N−2) and High(N)>High(N−1) and High(N)>High(N+1) and High(N)>High(N+2) ​ Bullish Fractal= ​Low(N)<Low(N−2) and Low(N)<Low(N−1) and Low(N)<Low(N+1) and Low(N)<Low(N+2) ​ where: N=High/low of the current price bar N−2=High/low of price bar two periods to the left of N N−1=High/low of price bar one period to the left of N N+1=High/low of price bar one period to the right of N N+2=High/low of price bar two periods to the right of N