Any trading strategy you've seen on youtube by your favourite Youtuber
can be turned into a backtestable pine script in under 30mins..
claude does the conversion, tradingview runs the test, and you find out fast whether the strategy actually holds up.
i ran this with
@MarciSilfrain measured move trend approach (320% return at the world trading championship).
the whole loop took about 40 minutes.
▫️ the workflow is simple:
find a trading strategy explained clearly on youtube. transcribe the rules..
you can either paste the youtube link to claude if you've got notebooklm-py wired in, or just type the rules out from the video
feed the entry, stop, and exit rules into claude
claude writes the pine script
paste it into tradingview's pine editor and run a backtest on whatever ticker and timeframe you want
read the results, tell claude what to improve, regenerate
▫️ the prompt that actually works:
i want to convert a trading strategy into Pine Script v5 for TradingView.
here are the rules:
entry: [paste rules]
stop loss: [paste rules]
exit / take profit: [paste rules]
position sizing: [paste rules]
timeframe: [intraday / daily / weekly]
write a complete, backtestable Pine Script v5 strategy. include strategy.entry, strategy.exit, alert conditions, and plot the key levels on the chart so i can verify the logic visually.
after the code, list the assumptions you made and flag anything ambiguous from the rules so i can correct it.
the "flag ambiguous" line is what saves you. most youtube strategies leave out edge cases.. gap opens, what counts as a "valid setup," etc. and claude asks instead of guessing wrong.
▫️ the verify loop
once the script compiles, don't just trust the green PnL number. load the strategy on 3-5 different tickers and timeframes and look at:
- the equity curve shape (smooth uptrend or wild swings)
- max drawdown vs. peak return
- trade count (too few = no statistical significance)
- what the trades look like on the chart (does each entry match the original rules visually?)
if any of those look off, tell claude what's wrong and have it fix the logic.
2-3 iterations usually gets you to a strategy you can actually evaluate.
▫️ direct tradingview connection (skip the copy-paste entirely)
if you've got the tradingview MCP wired into claude code, the whole loop runs in one prompt.
claude writes the pine script, injects it into your tradingview editor, compiles it, reads the errors, fixes them, and pulls the backtest results back into the conversation.
setup: paste this into claude code:
Install the TradingView MCP server. Clone
github.com/tradesdontlie/tra…, run npm install, add to my MCP config at ~/.claude/.mcp.json, and launch TradingView with the debug port.
then verify with:
Use tv_health_check to confirm TradingView is connected.
now you can just say "convert this strategy into pine script, test it on
$BTC 4h, and show me the equity curve"
and watch the whole thing run end to end.