Fractal Pitchfork
Fractal Pitchfork is an indicator drawn over the price chart.
state
indicator "Fractal Pitchfork"pane: pricestate points: list<tuple<int, price>> = []f = fractals(2)if f.up:points.push((bar.index - 2, high[2]))if f.down:points.push((bar.index - 2, low[2]))points = points.keep_last(3)if points.len == 3:pitchfork points: pointspolygon points: points, fill: blue.fade(90), border: bluearrow from: points.get(0), to: points.get(2), color: graySample data. Not a result. The real AlgoBarsX engine ran this exact script on made-up bars, and this replays what it drew and did. It shows no profit or loss, and it says nothing about how the script would do in a real market.
Replay of this script on 150 sample bars: 0 lines drawn.
Fractal Pitchfork is an indicator drawn over the price chart.
It remembers points from one bar to the next.
It calculates f as the fractals (periods 2) and points as points.keep_last(3).
On each bar, it checks whether f.up and, if so, adds (bar.index - 2, high[2]) to points.
On each bar, it checks whether f.down and, if so, adds (bar.index - 2, low[2]) to points.
On each bar, it checks whether the number of points is 3 and, if so, draws a pitchfork, draws a polygon and draws an arrow.