# F6 — Indicator framework extensions (implementation)

**Baseline audit:** `5f1117b`  
**Status:** Framework-extension stage in progress — **not** F6 complete, **not** `v0.11.0`.

Authority: [PHASE-F6-SCOPE.md](../phases/PHASE-F6-SCOPE.md), [TRADINGBITE-INDICATOR-INVENTORY.md](./TRADINGBITE-INDICATOR-INVENTORY.md)

## Single registry

All indicators remain on `IndicatorDefinition` + `registerIndicator` / `runIndicator` / `runIndicatorInstances`. No second framework.

## Output model

| Kind | Placement | Render status |
| ---- | --------- | ------------- |
| `line` | `overlay` / `panel` | Synced via `syncIndicatorChartOutputs` |
| `marker` | `overlay` | Candle series `setMarkers` |
| `histogram` | `panel` | Dedicated pane (index ≥ `CHART_PANE_INDICATOR_START`) |
| `label` | `overlay` | `IndicatorAnnotationLayer` canvas (time/price anchored) |
| `box` | `overlay` | `IndicatorAnnotationLayer` canvas (time/price anchored) |

Structural events: `IndicatorStructuralEvent` on calculation results (F7 evaluation, not drawn).

## Pane architecture

- Price pane: `CHART_PANE_PRICE` (0)  
- Volume pane: `CHART_PANE_VOLUME` (1) — F5  
- Indicator panes: from `CHART_PANE_INDICATOR_START` (2)

## Indicator instance model

- Stable `instanceId` (UUID or legacy slot id)  
- Scoped by `symbol` + `timeframe`  
- Persistence: `localStorage` key `tradingbite:indicator-instances:v1:{symbol}:{timeframe}`  
- Chart toolbar SMA / S/R checkboxes use legacy slot ids (`legacy-slot::…`) until New Indicators product UI ships.

Hooks / API: `useIndicatorInstances`, `createIndicatorInstance`, `upsertLegacySlotInstance`, `runIndicatorInstances` (namespaced `instanceId::seriesId`).

## MTF

- Types: `lib/indicators/mtf/types.ts`  
- Completed-bar alignment: `alignMtfCompletedToChartBars`  
- Client provider: `createClientMtfCandleProvider` → existing `/api/candles` or `/api/warehouse/candles`  
- Framework: `resolveMtfCandlesForInstances` + `IndicatorDefinition.mtfTimeframes()`  
- S/R HTF pivots: `expandHtfPivotsToChartBars` (web HTF default **D**, not Pine **W**)  
- **Remaining:** live forming-HTF parity, multi-series MTF for Command Center, Pine **W** timeframe support.

## Alert readiness

- Definitions may declare `alertConditions` metadata.  
- Compatible with `IndicatorAlertReference.instanceId` + `outputId` (F5 types).  
- F7 engine **not** built in this stage.

## Chart appearance (requirement)

Chart appearance: `lib/chart/chart-appearance.ts` (dark/light presets, custom color merge), `useChartAppearance`, localStorage preference, runtime apply via `applyChartAppearanceToRuntime`, volume colors via `toVolumeSeriesData(..., appearance)`. Drawing canvas colors not yet theme-aware.

## Known limitations

- Live MTF forming-bar semantics incomplete (completed HTF from API only).  
- Pine weekly (`W`) not in platform timeframes.  
- No new TradingBite Pine ports in the framework-only commit(s).
