# Coming from TradingView

## What is the same

A Pine indicator maps to an `fg.Indicator` and a Pine strategy to an `fg.Strategy`. The names differ more than the ideas: outputs replace `plot`, settings replace `input`, and the `ta` module carries the indicators you know.

## What is different

- **Forge works on whole arrays.** A Pine script runs once per bar and `close[1]` is the previous bar. A Forge `calculate` fills arrays, and a strategy's `compute` returns signals for every bar at once.
- **Closed bars only.** Pine recalculates the forming bar on every tick, so a value can change before the bar ends. Forge decides on closed bars.
- **No look-ahead switch.** A higher-timeframe series is visible only after its own bar has closed.
- **Missing values are NaN,** and `fg.nz` and `fg.isna` replace `nz` and `na`.

The [traps page](https://oathra.dev/docs/porting/pine/traps) lists the mistakes that cost the most.

## Where to start

Read [From Pine](https://oathra.dev/docs/porting/pine/overview) first, then [repainting and look-ahead](https://oathra.dev/docs/concepts/repainting-and-look-ahead), which names repainting as Pine does. Then write [your first indicator](https://oathra.dev/docs/get-started/draw-your-first-indicator).

> **Tip.** Signed in, the assistant on this page ports a snippet for you. Paste it and ask for the Forge version. See [Set up your AI tool](https://oathra.dev/docs/get-started/add-your-ai-tool).

## Pine names, in Forge

- //@version=6 becomes FORGE_API = 1 on the first lines
- strategy("Name") becomes class Name(fg.Strategy) with meta = fg.Meta(title="Name")
- strategy(calc_on_order_fills=) becomes on_fill(self, ctx, fill) runs after each fill
- var becomes An attribute set in setup(self, ctx)
- barstate.isfirst becomes setup(self, ctx) and on_end(self, ctx, reason)

[All 37 names](https://oathra.dev/docs/porting/pine/to-forge)

10 things in Pine have no Forge form. [See the list.](https://oathra.dev/docs/porting/pine/to-forge#no-forge-form)
