> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperprop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Porting from Pine Script

> Map TradingView Pine Script concepts to Hyperprop Script.

Hyperprop Script runs your whole calculation once per update instead of once
per bar. Pine's per-bar drawing changes (create, move, delete) collapse into
one question: **what should be visible right now?** Compute that final state
once and return it.

| Pine | Hyperprop Script |
| - | - |
| `input.int(14, "Length")` | `input.int('Length', 14, { min, max })` |
| `ta.sma / ema / rma / stdev / atr / rsi / linreg` | `hp.` equivalents. Note `hp.atr(bars, length)`. |
| `ta.pivothigh(high, l, r)` | `hp.pivothigh(highs, l, r)`. Value at the **pivot bar**, not the confirmation bar. |
| `ta.crossover / crossunder` | `hp.crossover / crossunder`, returning `boolean[]` |
| `close[3]` | `closes[i - 3]` inside your own loop |
| `var x = …` with per-bar updates | a sequential `for` loop over bars inside `compute` |
| `plot(..., style=plot.style_histogram)` | `{ values, style: 'histogram' }` |
| `box.new / label.new / line.new` | push to `boxes` / `labels` / `lines` |
| `plotshape` | push to `markers` |
| `bgcolor` and session boxes | push to `bg` |
| `fill(p1, p2)` | not supported. Plot both boundaries, or use per-segment boxes. |
| `plotcandle` / `barcolor` | not supported |
| `request.security(sym, "D", close)` | `const d = request.bars('1D', { symbol })` at the top level, then `d.close` or `d.align(series)` |
| `lookahead_on` / the developing bar | `request.bars(tf, { developing: true })` |
| `table.new(position.top_right, …)` | return `tables: [{ position: 'top-right', cells }]` |
| `table.cell(..., text_halign=text.align_center)` | cell `{ text, align: 'center' }`, or `align` on the table |
| `syminfo.mintick` / `syminfo.pointvalue` | `chart.tickSize` / `chart.pointValue` |
| `timeframe.period` | `chart.timeframe` |
| `alertcondition` | not supported. Price alerts are a separate terminal feature. |
| `xloc.bar_time` timestamps | bar indices. Use indices past the last bar for future x. |

## Example: previous day's close

Pine:

```js theme={null}
dailyClose = request.security(syminfo.tickerid, "D", close[1], lookahead=barmerge.lookahead_on)
plot(dailyClose)
```

Hyperprop Script:

```js theme={null}
const daily = request.bars('D');

function compute() {
  if (daily.status !== 'ready') return { plots: [] };
  return { plots: [{ title: 'Prev daily close', values: daily.close }] };
}
```

By default, each chart bar sees the last **closed** daily bar, so this already
gives the previous day's close without lookahead. See
[Other timeframes](https://docs.hyperprop.com/indicators/other-timeframes.md).


## Related topics

- [Limits](https://docs.hyperprop.com/indicators/limits.md)
- [Other timeframes](https://docs.hyperprop.com/indicators/other-timeframes.md)
- [Custom indicators](https://docs.hyperprop.com/indicators/overview.md)
- [Examples](https://docs.hyperprop.com/indicators/examples.md)
- [Changelog](https://docs.hyperprop.com/changelog.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.