Making strategies
Generate a strategy from plain language or convert an indicator, then run it on the chart.
Ask Quant for a strategy in the chat. The difference from an indicator is the script itself: a strategy is Pine Script® with a strategy(...) declaration instead of indicator(...), which means it can place simulated entries and exits and produce a backtest. Quant plots it on the active chart like any other script.
Describe the strategy
Tell Quant the trade logic in plain language: what triggers an entry, what closes the position, and any risk rules (stop loss, take profit). The more concrete the conditions ("enter long when the 20 EMA crosses above the 50 EMA" rather than "buy on momentum"), the closer the first draft will be.
Review and run
Open Code to review the script, then click Run (after you sign in). The strategy executes over the chart's history.
Read the backtest
The chart marks entries and exits, and a Backtest Summary strip appears below with net profit, trade count, win rate, max drawdown, and profit factor. How to read all of it (the summary strip, the full viewer, inputs, and saving runs) is covered in Strategies.
Convert an indicator into a strategy
If the editor already holds an indicator, you have two routes:
- Click the Backtest button in the toolbar. Quant rewrites the script with entries and exits while keeping the original concept.
- Ask in the chat: "convert this into a strategy that goes long on the buy signals", which is useful when you want to control exactly how signals map to trades.
The toolbar Backtest action only appears when the editor holds indicator code (not already a strategy).
Tune it without re-generating
Once a strategy runs, you rarely need Quant for parameter changes. Open the settings gear in the toolbar:
- Inputs: the script's
input.*parameters (lengths, thresholds, toggles). Changes re-run the backtest immediately. - Properties: the simulation itself (initial capital, order size, pyramiding, commission, slippage, and margin).
Use the chat when you want to change the logic; use inputs and properties when you want to change the numbers.
Fix errors
Fix with Quant addresses syntax and runtime errors. Runtime errors are the ones to watch with strategies: they surface only after the script runs over history or hits new bars, and appear as a message at the bottom of the chart.
Backtest results depend on the data they run on. Re-run the strategy on the exact symbol and timeframe you intend to use it with. Results from another market or interval don't transfer.