
Most traders spend hours hunting for the perfect indicator on TradingView's public library. They download garbage built by randos, tweak settings they don't understand, get burned, and repeat. The dirty secret? Building your own takes less time than finding a good one someone else made — and you'll actually understand what it does.
Here's how to do it with Claude and Pine Script, even if you've never written a line of code.
What Is Pine Script (Fast Version)
Pine Script is TradingView's built-in coding language for creating custom indicators and strategies. It runs directly in the browser — no installs, no servers, no nonsense.
Why Build Instead of Borrow
When you use someone else's indicator, you're trusting their logic blindly. When you build your own, you know exactly what condition triggers the signal. That's not a small difference — that's the difference between conviction and hope.
Claude accelerates this. You describe what you want in plain English. Claude writes the code. You test it. You own it.
The 3 Prompts That Actually Work
1. RSI Divergence Detector
RSI divergence is one of the most reliable reversal signals in crypto. Here's the prompt:
Write a Pine Script v5 indicator for TradingView that detects bullish and bearish RSI divergence on Bitcoin. Use a 14-period RSI. Mark bullish divergence when price makes a lower low but RSI makes a higher low. Mark bearish divergence when price makes a higher high but RSI makes a lower high. Plot triangle signals below and above the bars respectively. Add alerts for both conditions. Include comments explaining each section.
Claude will generate a full script, usually 60-80 lines. It will include the indicator() declaration, RSI calculation, pivot detection logic, and plotshape calls for the triangles.
2. Bollinger Band Squeeze
The squeeze catches low-volatility setups right before explosive moves. This prompt gets you there:
Write a Pine Script v5 indicator that detects a Bollinger Band squeeze on BTC/USD. Define a squeeze as when the Bollinger Bands (20-period, 2 std dev) are inside the Keltner Channels (20-period, 1.5 ATR multiplier). Color the histogram bars red during a squeeze and green when the squeeze releases. Add a label when the squeeze first releases. Make it work on any timeframe.
This is the LazyBear squeeze logic, rebuilt from scratch with your parameters. You'll understand every piece of it.
3. Whale Volume Spike Alert
Whale activity shows up in volume before it shows up in price. Use this:
Write a Pine Script v5 indicator that flags unusual volume spikes on BTC. Define a spike as current volume being more than 2.5 standard deviations above the 20-period average volume. When a spike occurs, color that bar orange and plot a volume label showing the exact volume amount in shorthand (e.g. 1.2K, 3.4M). Add a TradingView alert condition called "Whale Volume Spike". Keep the code clean and commented.
Claude handles the standard deviation math, the label formatting, and the alert condition block automatically.
How to Get It Into TradingView
- Copy Claude's full output — everything from
//@version=5to the last line - Open TradingView and pull up a BTC chart
- Click Pine Script Editor at the bottom of the screen
- Delete whatever's in there (usually a default script)
- Paste your code
- Hit Add to chart
If it loads without errors, you'll see it appear on your chart immediately. Set your alerts from the Alerts menu using the condition name you specified in the prompt.
When Claude Gets It Wrong (It Will)
Claude occasionally mixes Pine Script v4 and v5 syntax. The most common errors:
study() instead of indicator() — v4 syntax. Replace study( with indicator(.
barssince() not found — Claude sometimes invents function names. Replace with ta.barssince(). Most built-in functions in v5 need the ta. prefix: ta.rsi(), ta.ema(), ta.atr().
Type mismatch errors — Usually a float vs series float issue. Paste the exact TradingView error message back into Claude and say: "I got this error in Pine Script v5. Fix it." Claude corrects itself 90% of the time on the first retry.
One habit that saves time: end every prompt with "Make sure all syntax is compatible with Pine Script v5 and use ta. prefixes for built-in functions." This cuts error rates significantly.
What This Workflow Actually Costs You
An hour. Seriously. Thirty minutes to generate and debug each indicator, maybe less once you've done it twice. Claude Pro runs $20/month. TradingView's free tier works for this. You're building custom tools for the cost of a lunch.
The Part Everyone Skips
The indicator is not the edge — knowing when to trust it is.
RSI divergence fails in strong trends. The squeeze fires false signals in choppy markets. Whale volume spikes happen at tops and bottoms, and you won't always know which one you're looking at until after.
Build the tool. Study when it works. Study harder when it doesn't. That process — not the code itself — is where the actual edge lives.
Follow BitBrainers — we build the tools, then tell you when they lie.
No comments:
New comments are not allowed.