Add and Backtest a Pine Script Strategy in TradeJS
This walkthrough shows how to add a Pine strategy to TradeJS as a normal first-class strategy module. The complete AdaptiveMomentumRibbon implementation is split into focused chapters so you can load and follow only the task you are working on.
If you need the TypeScript-only path, see TypeScript strategy with StrategyAPI.
Follow the implementation path
- Create the module, Pine source, and configuration — folder layout,
.pinesource, and typed strategy configuration. - Build entry figures — translate Pine plots into TradeJS chart lines and points.
- Implement the runtime bridge — run Pine, read plots, and emit TradeJS decisions.
- Register, backtest, and validate — entrypoint, adapters, manifest, plugin wiring, grid, and checks.
Each chapter links to the previous and next step. The original guide URL remains this overview, so bookmarks and search results continue to lead into the complete workflow.