FractalScript — The Language
Write and backtest your own indicators and bots in the terminal.
FractalScript is the platform’s scripting engine. If a built-in tool doesn’t do exactly what you want, you can build it yourself — with near-total Pine Script v5 compatibility and an AI co-pilot to write the code for you.
What it gives you
- Pine Script v5 compatibility — port or write strategies and indicators using a familiar language.
- AI Co-Pilot — Generate & Fix — Generate: describe a strategy in plain English and it writes valid FractalScript for you. Fix: paste broken or erroring code and it diagnoses and repairs the logic. You don’t have to know the language to build with it.
- Matrix math — multi-dimensional arrays for correlation, covariance and statistical models.
- Multi-timeframe auto-aggregation — call higher-timeframe data with
request.security, zero setup. - Full strategy support — backtesting, equity curves and trade introspection (see Strategy Report).
How to use it
Open the FractalScript editor in the terminal, write or generate a script, and run it — output draws directly on your chart. Build an indicator for analysis, or a full bot to backtest.
Full reference: FractalScript has its own complete documentation — syntax, the standard library, the AI tools and examples. Open the FractalScript docs →