Ai Chat
Pine Script Tips
How to get the best results from the AI Pine Script generator.
Writing effective prompts
The quality of AI-generated Pine Script depends heavily on how you describe what you want.
Good prompt examples
Specific and clear:
"Write a Pine Script indicator that shows a 20 EMA and 50 EMA. When the 20 crosses above the 50, plot a green arrow below the bar. When it crosses below, plot a red arrow above."
Includes visual preferences:
"Create a volume-weighted RSI indicator. Display it in a separate pane as a histogram. Color bars green when above 50, red when below."
Common patterns
The AI understands most standard indicator patterns:
- Moving averages (SMA, EMA, WMA)
- Oscillators (RSI, MACD, Stochastic)
- Bands (Bollinger, Keltner)
- Volume indicators
- Custom price patterns
Importing into TradingView
- Copy the generated Pine Script code
- Open TradingView Chart
- Open Pine Script Editor (bottom panel)
- Paste the code
- Click Add to chart