Generate An Indicator
Prompt Scribe Studio to create TradingView indicators with visuals, inputs, and alerts.
Use Scribe Studio to generate indicators when you want chart visuals, signal conditions, and alerts — anything that does not need Strategy Tester entries and exits.
Indicator Workflow
Start a new Scribe Studio chat. A fresh chat keeps the conversation focused on this indicator.
Describe the indicator you want. Use the template below as a starting point — paste it, fill in the brackets, and send. Each section gives Scribe Studio the details it needs to return a clean, working script on the first try.
Prompt templateCreate a Pine Script indicator for TradingView. Goal: [Describe in detail what the indicator should help you see.] Conditions: [The signal or visualization rules.] Visuals: [Plots, colors, labels, fills, backgrounds.] Inputs: [Settings I should be able to change.] Alerts: [Alert conditions and message format.] Safety: Use bar-close confirmation. Flag any repainting risks.Copy the generated code. Use the copy button on Scribe's code block.
Paste it into TradingView's Pine Editor. Open Pine Editor at the bottom of any chart, paste the script, save it with a clear name, and click Add to chart.
Wire up the alert (optional). Only relevant if you asked Scribe to include alerts. Right-click the chart, choose Add alert, and pick the indicator you just added. Select one of the alert conditions Scribe wrote and set the trigger frequency to Once Per Bar Close — this matches the bar-close confirmation baked into the script and prevents intrabar duplicate fires.
A Complete Walkthrough
Here is what one full indicator session looks like end-to-end.
1. The prompt
The opening prompt
Create a Pine Script indicator for TradingView.
Goal
I trade trends. I want a clean, at-a-glance way to see whether the broad trend is bullish or bearish on whatever chart I have open — and I want the read to flip when momentum actually shifts, not every time price wobbles.
Conditions
Use a fast EMA and a slow EMA over the close. When the fast EMA is above the slow EMA, the trend is bullish. When it is below, it is bearish. A cross between the two is the moment the regime flips.
Visuals
Plot both EMAs over price. Tint the chart background green when the trend is bullish and red when it is bearish, but keep the tint subtle so it does not overpower the candles.
Inputs
Let me adjust the fast and slow EMA lengths without touching the code. Default them to 20 and 50.
Alerts
Send me an alert each time the EMAs cross — one for the bullish cross, one for the bearish cross. Include the ticker and timeframe in the message so I can tell where the alert fired.
Safety
Only fire alerts on closed bars so I do not get whipsawed intrabar. Flag any repainting concerns in your reply.
2. Scribe's response
Scribe returns a complete script that addresses each section of the prompt.
//@version=6indicator("EMA Trend", overlay = true) fastLen = input.int(20, "Fast EMA length", minval = 1)slowLen = input.int(50, "Slow EMA length", minval = 1) fastEma = ta.ema(close, fastLen)slowEma = ta.ema(close, slowLen) plot(fastEma, "Fast EMA", color = color.new(color.aqua, 0), linewidth = 2)plot(slowEma, "Slow EMA", color = color.new(color.orange, 0), linewidth = 2) isBull = fastEma > slowEmabgcolor(isBull ? color.new(color.green, 90) : color.new(color.red, 90)) bullCross = ta.crossover(fastEma, slowEma)bearCross = ta.crossunder(fastEma, slowEma) bullMsg = "Bullish EMA cross on {{ticker}} {{interval}}"bearMsg = "Bearish EMA cross on {{ticker}} {{interval}}" alertcondition(bullCross, "Bullish EMA cross", bullMsg)alertcondition(bearCross, "Bearish EMA cross", bearMsg) With the code in hand, the next step is to run it in TradingView. Open the Pine Editor at the bottom of any chart, paste the script in, and click Add to chart to load the indicator.


3. A follow-up refinement
After running the indicator for a few sessions, you decide to make two changes: switch the EMA colors to something with more visual identity, and add volume confirmation to the alerts so you only get pinged on crosses that have real participation behind them. Reuse the template structure for the refinement.
The refinement prompt
Update the current script.
Goal
The background is coloring on every tiny EMA cross, even when nothing is really moving. I only want it colored when there is real participation behind the trend.
Conditions
Add a 20-period volume average. Only fire the alerts when current volume is above that average, so the crosses I get pinged on represent real participation. Keep the background coloring continuous based on the EMA regime.
Visuals
Switch the EMA colors. I want the fast EMA in bright orange and the slow EMA in red.
Inputs
Let me adjust the volume average length too. Default it to 20.
Alerts
Add "with volume" to the alert messages so I can tell these crosses apart from the un-filtered ones.
Safety
Keep the bar-close confirmation. Return the full updated script.
4. The iterated code
//@version=6indicator("EMA Trend", overlay = true) fastLen = input.int(20, "Fast EMA length", minval = 1)slowLen = input.int(50, "Slow EMA length", minval = 1)volLen = input.int(20, "Volume average length", minval = 1) fastEma = ta.ema(close, fastLen)slowEma = ta.ema(close, slowLen)volAvg = ta.sma(volume, volLen) plot(fastEma, "Fast EMA", color = color.new(color.orange, 0), linewidth = 2)plot(slowEma, "Slow EMA", color = color.new(color.red, 0), linewidth = 2) isBull = fastEma > slowEmavolConfirmed = volume > volAvg bgcolor(isBull ? color.new(color.green, 88) : color.new(color.red, 88)) bullCross = ta.crossover(fastEma, slowEma) and volConfirmedbearCross = ta.crossunder(fastEma, slowEma) and volConfirmed bullMsg = "Bullish EMA cross with volume on {{ticker}} {{interval}}"bearMsg = "Bearish EMA cross with volume on {{ticker}} {{interval}}" alertcondition(bullCross, "Bullish EMA cross", bullMsg)alertcondition(bearCross, "Bearish EMA cross", bearMsg) 5. Final result
Here's the iterated EMA Trend indicator running on a live chart, with the fast EMA in orange and the slow EMA in red against a dark background. The chart tints green when the fast EMA sits above the slow EMA — a bullish regime — and red when it sits below, and the alerts only fire on crosses where current volume sits above its 20-period average.

After You Generate The Indicator
Before trusting any generated script, work down this list:
- Does it compile in TradingView's Pine Editor?
- Does it actually appear on the chart?
- Are the visuals readable against your normal theme?
- Are the inputs useful — and are the defaults sensible?
- Do the alert conditions appear in TradingView's alert dialog?
- Does it behave consistently across multiple symbols and timeframes?
If anything is off, paste the issue back into the same chat. Scribe will revise the script without losing the context of everything you have already asked for.