Flowscript
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:
Language referenceEvery type, rule, prelude function, error code and warning.→Module catalogEvery module a strategy can import, with its reads, actions and examples.→Strategy guideEvery read, order and setting on ftw.trade, with worked examples and pitfalls.→Flowscript for agentsThe 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.