Ten classic strategies with their full Pine Script v5 code, and five trend strategies exported and judged by the Lab. Copy one into TradingView, then test it on data it has never seen in the free Lab.
Free scripts stay open for TradingView inspection and quick experiments.
Builder turns ideas into readable ArenaScript with private backtests and Pine export.
Operator reports show where a strategy survives, dies, sits in cash, or beats Buy & Hold and a 200-day filter.
The public exit remains TradingView; the free Lab is the validation before that exit.
//@version=5
strategy("RSI Mean Reversion", overlay=true, pyramiding=0, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1, process_orders_on_close=true, margin_long=0)
rsiLen = input.int(14)
rsiVal = ta.rsi(close, rsiLen)
if (ta.crossover(rsiVal, 30))
strategy.entry("Long", strategy.long)
if (ta.crossunder(rsiVal, 70))
strategy.close("Long")//@version=5
strategy("EMA Crossover 9/21", overlay=true, pyramiding=0, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1, process_orders_on_close=true, margin_long=0)
fast = ta.ema(close, 9)
slow = ta.ema(close, 21)
if (ta.crossover(fast, slow))
strategy.entry("Long", strategy.long)
if (ta.crossunder(fast, slow))
strategy.close("Long")//@version=5
strategy("EMA Ribbon", overlay=true)
ema1 = ta.ema(close, 8)
ema2 = ta.ema(close, 21)
ema3 = ta.ema(close, 55)
if (ema1 > ema2 and ema2 > ema3)
strategy.entry("Long", strategy.long)
if (ema1 < ema2)
strategy.close("Long")//@version=5
strategy("BB Bounce", overlay=true, pyramiding=0, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1, process_orders_on_close=true, margin_long=0)
length = input.int(20)
mult = input.float(2.0)
[middle, upper, lower] = ta.bb(close, length, mult)
if (close < lower)
strategy.entry("Long", strategy.long)
if (close > upper)
strategy.close("Long")//@version=5
// MACD 12/26/9 : long tant que la ligne MACD est au-dessus de sa signal, plat sinon.
// Le croisement haussier ouvre, le croisement baissier ferme : ces etats en sont la lecture.
strategy("MACD Momentum", overlay=true, pyramiding=0, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1, process_orders_on_close=true, margin_long=0)
[macdLine, signalLine, hist] = ta.macd(close, 12, 26, 9)
longSignal = macdLine > signalLine
exitSignal = macdLine < signalLine
if longSignal
strategy.entry("Long", strategy.long)
if exitSignal
strategy.close("Long")//@version=5
// SuperTrend (facteur 3, ATR 10) : long en tendance haussiere, plat sinon.
strategy("SuperTrend", overlay=true, pyramiding=0, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1, process_orders_on_close=true, margin_long=0)
// direction vaut -1 en hausse, +1 en baisse.
[supertrend, direction] = ta.supertrend(3.0, 10)
longSignal = direction < 0
exitSignal = direction > 0
if longSignal
strategy.entry("Long", strategy.long)
if exitSignal
strategy.close("Long")//@version=5
strategy("Stoch RSI", overlay=true)
rsi1 = ta.rsi(close, 14)
k = ta.sma(ta.stoch(rsi1, rsi1, rsi1, 14), 3)
d = ta.sma(k, 3)
if (ta.crossover(k, d) and k < 20)
strategy.entry("Long", strategy.long)
if (ta.crossunder(k, d) and k > 80)
strategy.close("Long")//@version=5
strategy("ATR Breakout", overlay=true)
atr = ta.atr(14)
upper = ta.highest(high, 20)
if (close > upper[1] and atr > ta.sma(atr, 20))
strategy.entry("Long", strategy.long)
strategy.exit("Exit", "Long", stop=close - atr * 2)//@version=5
strategy("VWAP Bounce", overlay=true)
vwapVal = ta.vwap(hlc3)
if (close > vwapVal and close[1] < vwapVal[1])
strategy.entry("Long", strategy.long)
if (close < vwapVal and close[1] > vwapVal[1])
strategy.close("Long")//@version=5
strategy("RSI + EMA Combo", overlay=true)
rsiVal = ta.rsi(close, 14)
ema50 = ta.ema(close, 50)
if (ta.crossover(rsiVal, 30) and close > ema50)
strategy.entry("Long", strategy.long)
if (rsiVal > 70 or close < ema50)
strategy.close("Long")//@version=5
strategy("Faber 10-Month Timing", overlay=true, pyramiding=0, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1, process_orders_on_close=true, margin_long=0)
smaVal = ta.sma(close, 10)
if (close > smaVal)
strategy.entry("Long", strategy.long)
if (close < smaVal)
strategy.close("Long")Original settings from the source, judged walk-forward (4 folds, 2019-2025, two markets never opened by the family, 10 bps fees). None beats buy-and-hold across several cycles. Each Pine is the Lab's TradingView-exact export of the judged rule (no inputs, trade log in Pine Logs).
Research on past public data, not a sealed proof and not investment advice. Method and limits: full article.
entry: ROC(12, 1M) > 0 · short: ROC(12, 1M) < 0 · size: vol_target 40% window 60entry: price > SMA(10, 1M) · exit: price < SMA(10, 1M) · monthlyentry: VOTE(DONCHIAN_TREND(5…360)) >= 5 of 9 · size: vol_target 25% window 90entry: price > SMA(200, 1d) · exit: price < SMA(200, 1d) · size: vol_target 40% window 360long: EMA(50) > EMA(200) · short: EMA(50) < EMA(200) · size: 100%Got a strategy that beats cash, Buy & Hold and a 200-day filter on a sealed holdout? Submit it. A YouTube B&H win in a bear is not enough.
Submit & Test Your ScriptBy submitting, you agree that your strategy may be analyzed to improve our AI systems.
The library separates reusable code from proof. A script that looks good on one chart has not been tested yet. Strategy Arena Lab can replay supported logic, search variants on training data and let the Rust CPU authority judge a sealed holdout.
Copy the Pine Script into TradingView for chart inspection, or check its supported subset before opening a local Lab proof. Strategy Arena performs research simulation and does not create broker automation.
It is a small collection, kept readable on purpose: eleven classic //@version=5 strategies (RSI mean reversion, EMA crossover, EMA ribbon, Bollinger bounce, MACD, SuperTrend, stochastic RSI, ATR breakout, VWAP, RSI + EMA, Faber 10 months) with their full code on this page, and five trend strategies from the research literature, exported by the Lab with their verdict. It is not a repository of thousands of scripts: for that, TradingView's public library of community scripts is the place to browse.
What it adds is the step after copying: Strategy Arena Lab, free for Windows and Linux, runs a supported script on data it has never seen and compares its trades with TradingView's. Common Pine questions: using [1] on ta.dmi, ta.macd and other tuples, Pine Script alternatives.
More tools: AI Chart Analysis | Backtesting Tool | Best Pine Script Strategies 2026 | Pine Script to Python Guide
A Pine strategy is only useful once you can see it on a live chart. Here is the exact order that avoids the usual traps.
The free web account is enough to plot a script and create a few alerts. Paid plans add more indicators, alerts and layouts — they are decided on TradingView and never change a Strategy Arena verdict. Strategy Arena is not a broker and places no real order.
A naive backtest almost always overstates a strategy. The Lab uses a sealed chronological holdout and uncertainty diagnostics to reduce overfitting before anything reaches a live chart.