# Full language reference

> Where to find every Flowscript function, rule and error code, and the module catalog, in full.

These docs explain Flowscript by example. The full references are generated from the compiler and the module registry, so they're always current:

```cards
- [Language reference](https://ftw.trade/skills/ftw-flowscript/references/language.md): Every type, rule, prelude function, error code and warning.
- [Module catalog](https://ftw.trade/skills/ftw-flowscript/references/modules.md): Every module a strategy can import, with its reads, actions and examples.
- [Strategy guide](https://ftw.trade/skills/ftw-strategies/references/strategy-guide.md): Every read, order and setting on ftw.trade, with worked examples and pitfalls.
- [Flowscript for agents](https://ftw.trade/skills/ftw-flowscript): The skill AI agents read before writing Flowscript.
```

## Error codes

Errors are `FS0xxx` and stop a save; warnings are `FS09xx` and point at a line that probably doesn't do what it seems to:

| Code | Means |
|---|---|
| FS0901 | A condition that is never true (often a window that includes the bar it's compared with) |
| FS0902 | A `while` that buys at every bar, with no guard |
| FS0903 | A `const` nothing reads |
| FS0904 | A divide by zero |
| FS0905 | `bps(n)` used as a number, which is `n`, not `n / 10000` |

## Formatting

`ftw-trade fmt *.flow --write` formats Flowscript files the way the editor does.
