Build, validate, and export trading code without guessing the next step.
Use this guide to move from strategy idea to platform-ready code for PineScript v6, NinjaScript NT8, and TradeLocker Studio.
Workflow
The practical build loop
Step 1: Describe the strategy
Start with the platform, indicator or strategy type, entry rules, exits, alerts, risk, visuals, and any screenshots or source code.
Step 2: Generate into the editor
Code streams into the IDE with syntax highlighting and the active platform context attached to the session.
Step 3: Validate before paste
Use the validation toolbar and Problems panel to catch compiler, platform API, repaint, and lifecycle issues before exporting.
Step 4: Save and export
Copy code, download platform files, open TradingView where supported, or save polished scripts to My Scripts.
Prompt examples
Start specific, then iterate from the editor.
- "Build an EMA 9/21 crossover strategy with ATR stop loss, ATR take profit, and buy/sell arrows."
- "Create a Bollinger Band squeeze detector that highlights low volatility and alerts on breakout."
- "Convert this PineScript indicator into a NinjaTrader 8 strategy with the same entry logic."
Platforms
Supported code targets
PineScript v6
TradingView indicators and strategies with Pine-focused compiler checks and one-click copy/download workflows.
NinjaScript NT8
NinjaTrader 8 C# indicators and strategies with lifecycle, namespace, Draw method, and strategy enablement guidance.
TradeLocker Studio
Python / Backtrader-style strategy code with TradeLocker-focused structure checks and export guidance.
NinjaTrader 8
Install and troubleshoot NT8 scripts
NinjaTrader compiles the entire custom scripts folder together, so one old broken file can hide a new valid strategy.
What the gate checks before you import
So you know what has already been ruled out when a file lands in your editor.
Every NinjaScript file is compiled with a real Roslyn C# compiler against the NinjaTrader 8 API surface before it is delivered — not a syntax lookalike. That is what catches a missing using, a Draw overload with the wrong number of arguments, a property NinjaTrader does not have, and a member declared on the wrong base class. Nothing is handed over until that compile reports zero errors.
Strategies get a second pass the compiler cannot do: they are replayed over real bars with a real order lifecycle. That is the check for the file that compiles perfectly and never places an order, or whose stop never moves — behaviour a clean build says nothing about.
What it does not replace: your own compile. Your bin\Custom folder builds as one unit, so an unrelated broken file of yours can still stop a valid new strategy from appearing. Press F5 and clear the Errors tab first — that is what the steps below are for.
Install a strategy in 4 steps
- Save the file into
Documents\NinjaTrader 8\bin\Custom\Strategies\. - Open NinjaScript Editor and press F5.
- Confirm the Errors tab is empty.
- Add it from Control Center, Strategies tab, choose account, enable it, then apply.
Not in the Strategies list
Usually caused by another broken file in bin\Custom.
Quick error decoder
CS0101duplicate class: search the wholebin\Customfolder (every subfolder) for the script name and keep one copy.CS0246type not found: re-paste the full file with using statements.CS0103missing name: a variable was renamed or removed.
Export actions
Tips and best practices
- Be explicit about platform, indicator versus strategy, timeframe assumptions, and risk rules.
- Paste exact compiler errors back into chat instead of paraphrasing them.
- Use My Scripts for finished code and sessions for active iteration.
- Attach chart screenshots or existing scripts when the visual behavior matters.
