Examples
Tested example programs of the language, by topic: indicators, strategies, modules, drawing, requests and limits.
The programs in this section are original examples written for this documentation from textbook formulas. Each one is compiled with the real checker and run on synthetic seeded market data when the documentation is built, so an example that stops working is found before you are.
- Getting started: Simple moving average
- Series and bars: EMA pair with cross marks, RSI written out, Inside bars, Bars since a high
- Technical indicators: ATR channel, Bollinger bands, MACD, Donchian channel, ...
- Drawing and marks: RSI zones, Swing pivots, Status table, Recent range drawing, ...
- Sizing and trade results: Loss limit before entry, Trade tally
- Time, timeframes and sessions: Window of the day, Bars in a day, Weekday mornings, Earlier days and weeks, ...
- Arrays, maps and matrices: Rolling median band, Volume by weekday, Up and down transitions, Array read with brackets, ...
- Text and the log: Logged crossings, Levels from text, Stopped on purpose
- Data and requests: Higher timeframe average, Daily pivot levels
- Calls that keep a state: Session highs, One state for each call
- Lazy operators: Lazy operators, Guarded read, Read past the end of an array
- Orders, strategies and alerts: Cross alert, Moving average crossover strategy, RSI reversion strategy, Donchian breakout strategy, ...
- The language: User functions
- Types in shadow mode: Records and enums, Zone with a record
- Modules: Module: running statistics, Importing a module
- Determinism and limits: Seeded random numbers, Reading earlier bars, A window beyond the history, A window inside the history, ...