# Guides

> Task-oriented explanations of the ideas most Flowscope scripts rely on, from subscriptions and handlers to repainting.

The getting-started pages show you the shape of a script. The guides go one level deeper: each one takes a single idea, explains how the language treats it, and walks through complete scripts you can paste into the editor and run against a live market.

You do not have to read them in order. If you are new to Flowscope Script, start with data and update events, then missing values and repainting, because those three pages explain behaviour that every indicator depends on. Pick up the others when a script needs them.

```cards
[Build and verify a script](/docs/scripting/guides/build-and-verify) Check data, warm-up, signal timing and runtime with a short, repeatable workflow.
[Data and update events](/docs/scripting/guides/data-and-events) Subscribe to candles, flow, liquidations and trades, and decide which handler should react to each event.
[User-defined types](/docs/scripting/guides/user-defined-types) Group related values into your own records so state, function results and alert payloads stay readable.
[Functions](/docs/scripting/guides/functions) Extract repeated calculations into typed functions, return several values at once and reuse stateful analysis safely.
[Lambdas and reducers](/docs/scripting/guides/lambdas-and-reducers) Transform, filter and fold collections with short pure lambdas instead of hand-written loops.
[Pattern matching](/docs/scripting/guides/pattern-matching) Replace chains of if and else with match arms over values, ranges, guards and null.
[Colors and gradients](/docs/scripting/guides/colors-and-gradients) Build readable palettes, transparency, conditional colors and value-driven color scales.
[Custom axes and charts](/docs/scripting/guides/custom-axes-and-charts) Draw bar charts, curves, tables and heatmaps in windows whose x-axis is an index or a category instead of time.
[Inputs and visuals](/docs/scripting/guides/inputs-and-visuals) Give users a small, well-organised settings panel and outputs that stay legible on a busy chart.
[Missing values](/docs/scripting/guides/missing-values) Understand how null flows through arithmetic, comparisons and plots, and when a fallback is honest.
[Multiple timeframes](/docs/scripting/guides/multiple-timeframes) Combine subscriptions on different timeframes and venues without drawing levels one period late.
[Repainting](/docs/scripting/guides/repainting) Choose deliberately between forming and confirmed values so signals mean what they promise.
```

## How the guides are written

Every guide follows the same conventions:

- Code blocks that start with `script "..."` are complete scripts. They compile on their own and use the chart's market unless they say otherwise.
- Shorter fragments omit the header and declarations that are not relevant to the point being made.
- Examples lean on Flowscope's own data: aggregated markets (`exchange: "all"`), size-band flow from Bar Stats, liquidations, funding and the Hyperliquid position maps. They work just as well on a single venue.

> [!TIP]
> When you need an exact signature, a default value or the meaning of an error code, go to the [language reference](/docs/scripting/reference), the [built-in catalog](/docs/scripting/reference/catalog) or the [diagnostics list](/docs/scripting/reference/diagnostics). The guides explain why; the reference states what.

## Related pages

- [Performance](/docs/scripting/performance) explains how to keep scripts responsive once they grow.
- [Strategies](/docs/scripting/strategies) builds on the same handlers to run backtests and paper trading.
- [Examples](/docs/scripting/examples) collects larger scripts that combine several guides at once.
