Support and Resistance
Support and Resistance is an indicator drawn over the price chart.
core language
indicator "Support and Resistance"pane: priceinput lookback = 300input min_touches = 3found = support_resistance(lookback, touches: min_touches).filter(l => l.touches >= min_touches)strongest = found.sort_by(l => -l.strength)for level in strongest.keep_last(6):line from: (bar.index - 50, level.price), to: (bar.index, level.price), extend: right, color: if level.price > close then red.fade(40) else green.fade(40), width: 2label "{level.touches} touches", at: (bar.index, level.price), 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.
Support and Resistance is an indicator drawn over the price chart.
You can change 2 inputs: lookback (default 300) and min_touches (default 3).
It calculates found as support_resistance(lookback, touches: min_touches).filter(l => l.touches >= min_touches) and strongest as found.sort_by(l => -l.strength).
On each bar, it goes through each level in strongest.keep_last(6) and draws a line and labels "{level.touches} touches".