Effective prompting is key to getting the best results from Quant. Follow these tips to generate high-quality Pine Script® code efficiently.
Start Simple
Say what you want to build in plain language.
Examples:
- “A RSI oscillator with signals.”
- “An order block detector with breakout signals.”
This gets you moving fast and gives the agent something concrete to scaffold.
Be Specific About the “Result”
Tell Quant what “done” looks like:
- Expected indicator behavior under specific scenarios
- How the indicator should look like, with explicit mention of plot/label/line styles, colors, linewidth…etc
- Tell Quant if the indicator should appear on the chart, or in its own pane
You can use images to provide a more direct answer about what the output should look like.
Break Big Work Into Small Steps
Asking Quant to build a complex indicator/strategy/toolkit in a single shot will generally lead to poor results.
Instead of “build the whole toolkit,” do:
- “Start with element A.”
- “Add element B”
- “Add element C”
- “Add alerts”
Incremental prompts reduce bugs, and provide checkpoints you can comeback to.
Ask the Agent to Plan When It’s Complex
If you’re not sure about the indicator architecture:
“Break this indicator into steps and propose a plan to achieve it”
Then implement step-by-step.
Iterate with Targeted Follow-ups
After the first output, request one change per message:
- “Add moving average to x.”
- “Add alert on condition x.”
- “Add tooltip to these inputs…”
This keeps iterations clean and predictable.