# Support and Resistance Finder 2.1 (TypeScript)

**Registry id:** `tradingbite.sr-finder-2.1`  
**Pine source:** `TradingBite/Support-Resistance-Finder-2.1.pine` (v6, read-only reference)

## Calculation mapping (chart timeframe)

| Pine | TypeScript |
|------|------------|
| `ta.atr` | Wilder ATR in `computeAtrSeries` |
| `ta.pivothigh` / `ta.pivotlow` | `pivotHighAtBar` / `pivotLowAtBar` on bar index |
| `var` S/R pools | `support` / `resistance` level arrays per simulation |
| `barstate.isconfirmed` block | one loop iteration per supplied candle |
| `barstate.islast` draw | draw selection on final bar of batch |
| `request.security` HTF | **not implemented** — `useMtf: true` → no outputs |

## Engine usage

```typescript
import { runIndicator } from "@/lib/indicators";
runIndicator("tradingbite.sr-finder-2.1", candles, { useMtf: false });
```

## Chart

Toolbar **S/R Finder** checkbox → `runIndicator` → `syncOverlayLineOutputs`.
