Backtesting Pine
Compare native Pine inputs, plots, signal consumption, and simulated execution separately.
Start with the indicator alone, then add the intended execution owner. This separates Pine calculation problems from SJS timing or order behavior.
Establish the calculation baseline
Use a short, known historical window and save source plus input defaults. Record the instrument, interval, bounds, timezone, and session settings. Inspect Fast/Slow plots and the raw named signal output.
Historical confirmed bars are different from a live candle that is still updating. A backtest does not by itself demonstrate how often a live signal can change before confirmation.
Add the signal reader
Use the SJS observer, then compare signal time with the frame that consumed it. In the shared runner, SJS executes before Pine, so strict same-frame equality is not a general solution for one-invocation-per-bar replay.
The freshness window must match the input interval and intended event lifetime. Keep the observer's decision policy fixed when comparing Pine input changes.
Add execution only after observing
If SJS owns orders, apply order and position guards to the validated event. If Pine owns order intents, verify the bridge mapping, source-time filtering, deduplication, and simulator semantics.
A full TradingView strategy tester is not reproduced. STX's historical fill model and result interpretation determine what the run establishes.
Compare one variable
Change one length or signal condition with the same bars and execution settings. Inspect the first changed signal, when SJS consumed it, the resulting request, and the eventual fill. Summary P&L alone cannot identify which of those stages changed.
Continue with debugging.