Test a TradingView Pine strategy elsewhere
EA Trade TesterDemo labHow we testAll guidesFor AI agents
You can test a TradingView strategy outside TradingView by dropping its .pine file on our home page. We read
the Pine code as text: we never run or compile it, and we cannot run it inside TradingView. What our test cannot do: it does not reproduce
TradingView's own backtest. It rebuilds the rules in our engine and tests that copy on our prices, so a rule that uses something our
engine cannot express is reported as not testable by rebuild.
Which Pine faults does the first read flag?
| What we find | What it means |
|---|---|
indicator() or study() with no strategy() | the script draws signals but places no trades; tell us which signals you trade on and we rebuild those entry rules |
request.security(..., lookahead = barmerge.lookahead_on) | on history, the higher-timeframe value comes from a bar that had not closed yet: the backtest sees prices it could not have known |
calc_on_every_tick = true or calc_on_order_fills = true | the strategy recalculates inside the bar, so TradingView's backtest and live fills can differ |
strategy.entry with no strategy.exit, strategy.close or stop | trades end only on a reverse signal, so one bad move has no limit |
| a quantity multiplied after trades | martingale sizing: a shape that can wipe an account |
Why test a Pine strategy somewhere else at all?
TradingView's Strategy Tester is quick and visual, and it runs your exact script, which we never do. An outside test adds what the script's own settings decide: our recorded spreads by the hour, commission and overnight fees, a second run with extra costs, up to up to 16 years of prices for 8 symbols in three periods that never overlap, every calendar year, and the luck bar for the number of versions you tried.
What should I send with the script?
The input values you trade with, the symbol and timeframe, and roughly how many versions you tried. If you exported TradingView's "List of trades", upload that too: the record check reads it separately and tells you whether those trades could be luck.
What happens after the first read?
We write the strategy's rules out as a plain-English rule card. You read it and correct anything we got wrong, and only then is the copy tested. The lab trades every signal at a fixed 0.01 lot, so a strategy that scales its position size is tested on its signals alone, and the sizing is reported as a code fault when it grows after losses.
Related pages
- Does my EA repaint or look ahead?
- Free forex EA tester online
- MQL5 / MQL4 EA code checker
- EA costs: spread, commission and swap
- All EA testing guides
- EA Trade Tester home: test your EA, bot, indicator or report
Questions people ask
Do you run my Pine script?
No. It is read as text, its rules are written out as a rule card for you to check, and our own rebuilt copy is tested.
Can you test a script that uses request.security?
Often yes, if the higher timeframe is one our engine builds from 15-minute bars. With lookahead on, we test the honest version and say so.
Will my result match TradingView's backtest?
Rarely exactly: different prices, costs and a fixed 0.01 lot. The lab lists where our rebuild differs from your script.
Is this financial advice?
No. It describes a test of a rebuilt copy. Not financial advice.