OptiNod Academy
Backtests vs live trading — find the first trade that diverged
Match code, market, and execution settings first. Then compare signals, orders, fills, and costs to test possible causes instead of diagnosing an equity curve by appearance.
When two equity curves diverge, first check whether they describe the same experiment. Then find the first signal or fill that differs.
A backtest reconstructs trades from a dataset and a set of execution rules. Identical strategy inputs do not guarantee identical trades if the data window, market, or order settings differ. A gap between simulated and live results alone does not establish that the strategy has no edge or that the execution system is broken.
Start with the comparison conditions: source and version, inputs, exchange-qualified symbol, spot or derivative contract, standard candles, timeframe, session, date range, initial capital, position sizing, commission, and slippage. Distinguish the displayed chart timezone from the exchange session, and record the beginning of the dataset and any warmup period.
Once these match, trace signal detection, order creation, exchange acknowledgment, execution, and costs. Assuming that every backtest fills at the signal bar's close can send this investigation in the wrong direction. Timing, liquidity, costs, intrabar paths, and selection or information bias need separate checks.

The same signal can produce different order and fill times
By default, a TradingView strategy calculates at the bar's close. A new market order is not normally filled on the same tick that creates it: the broker emulator uses the next available tick, which is usually the next bar's open in a historical calculation. Options such as process_orders_on_close change this behavior. A simulated close fill is not automatically lookahead bias, but whether a real alert and order can obtain that price is a separate question. TradingView strategies documentation
When entry prices differ, align the signal bar and order creation time first. Check the simulated fill rule, order type, alert receipt, exchange acknowledgment, and average executed price. Gaps, trading interruptions, rejected orders, quantity rounding, and the wrong contract can also explain discrepancies. An entry-price difference alone cannot identify latency or slippage as its cause.
Comparison setup — Use the same standard 15-minute candles and compare signals evaluated at the close. Keep the default market-order emulator behavior. Define entry as the first available fill after that signal and fix a stop below the signal bar's low before running the comparison. This is a record-comparison exercise, not a trading recommendation. Exclude a trade from execution-quality comparison if its signal time, size, or stop rule differs.

Slippage needs a reference price and an order size
Slippage measures an executed price against a chosen reference. Signal price, the midpoint before submission, and the best bid or ask are different references. If a market buy consumes several ask levels, its average fill may be worse than the first displayed ask. Prices can also move favorably before an order arrives, so do not assume that every measured difference is adverse.
There is no universal number of basis points appropriate for every market. Collect samples by exchange, contract, time, and order value, and separate ordinary conditions from periods of reduced liquidity. Without order-book records, the contributions of market impact and communication delay may remain unresolved. Limit orders constrain price but introduce missed and partial fills.
Use observed costs for a baseline and more adverse costs for a stress scenario. Check whether changed fills also change subsequent trades. A fixed slippage setting is useful for sensitivity analysis; it does not reproduce a live order book.
Commission follows executed notional; funding follows holding conditions
Check the actual product, account tier, and maker or taker rules. Apply commission to each executed notional, including partial fills. Entry and exit values need not be equal, and fee-currency conversion should match the account statement.
For an illustrative assumption, a buy and a sell each worth $1,000 with a 0.05% fee on each execution cost $1 round trip. Repeating that identical round trip 100 times costs $100. The percentage of account equity depends on capital and position size. Multiplying trade count by a quoted round-trip fee does not by itself produce the account's percentage loss.
Perpetual funding can be paid or received depending on the product's settlement schedule, rate, position direction, and eligible position at settlement. It is not universally an identical charge every eight hours. Use the exchange's settlement entries and current product rules, and reconcile funding separately from trading fees. The trading costs guide extends this check.

Four prices do not reveal which exit was reached first
An OHLC bar does not preserve every price movement inside it. If both stop and target levels are reached in one bar, the possible first execution matters. Order activation time and partial fills also matter in actual trading.
Consider a hypothetical long entry at 100, stop at 98, and target at 103. A high of 104 and low of 97 do not establish which exit happened first. TradingView's default broker emulator uses a defined intrabar-path assumption; describing it as always choosing the stop first would be incorrect. Bar Magnifier can refine the simulation with available lower-timeframe data. Broker emulator and Bar Magnifier
Lower-timeframe bars still do not prove queue position, every tick, or the fills in a particular account. Flag ambiguous trades and compare more detailed data with order records. Keep missing coverage explicit. Nonstandard charts such as Heikin Ashi and Renko may contain synthetic prices, so establish a standard-candle baseline before comparing. Nonstandard chart data

Universe selection and information timing also need evidence
Building a historical universe from assets that survive today can differ from the choices actually available at the time. Check delistings, suspensions, new listings, and historical liquidity filters. Survivorship bias does not make every strategy profitable, but results that omit failed instruments should not be generalized to the entire historical market.
Future leakage occurs when a decision uses information unavailable at that decision time. Using the current price on an open bar is not itself seeing the future. Treating a later final value as if it were already known, or using full-period statistics in an earlier training step, is the problem. The lookahead and repainting guide examines higher-timeframe confirmation and pivot detection timing.
Feed revisions and changes to the dataset's starting point can also change a rerun. Preserve the data range and extraction time alongside source and inputs, so the experiment can be reconstructed. TradingView dataset variations

A symptom should select a test, not settle the diagnosis
Use this table to choose the next evidence to inspect. Begin with the first mismatch: later discrepancies may result from the balances and position sizes that already diverged.
| Observation | Candidate causes | Test or evidence | Limit |
|---|---|---|---|
| Signal bar or direction differs | Source, inputs, market, data, unconfirmed HTF values, realtime calculation | Fix versions and settings; compare contemporaneous signal records with a rerun | A rerun CSV cannot reconstruct every original realtime signal |
| Signals match but entry prices differ | Fill options, latency, quotes, order size or order type | Compare creation, receipt, acknowledgment and fill times with quotes | Without quotes and synchronized clocks, contributions may remain unresolved |
| A trade is missing live | Alert delivery, rejection, minimum size, an unfilled order, position limits | Link alert IDs and order IDs to rejection codes, quantities and balances | An alert or API acknowledgment does not prove execution |
| Same-bar exits produce opposite results | Intrabar path, activation time, gaps, partial fills | Compare lower-timeframe paths with actual executions | Shorter bars do not fully reproduce ticks or order queues |
| Trades look similar but net P&L differs | Commission, funding, conversion, size, accounting basis | Recalculate each execution and cost in the same currency | Frequency alone cannot establish costs as a percentage of equity |
| Past signals change after reload | Unconfirmed values, past plotting, feed revisions, history range | Compare before-and-after records, data, source and first detection times | A change alone does not prove deliberate deception or future leakage |
| Only the optimization interval performs well | Repeated selection, period-specific conditions, data leakage | Save attempted settings and selection criteria; evaluate the same procedure on a separate interval | A decline alone proves neither overfitting nor repainting |
Change one selected condition and compare the same first trade again. If the evidence is missing, leave the cause unresolved and collect the required records in the next observation. Walk-forward analysis explains validation of repeated selection. A worse later interval alone does not settle the cause.
Keep the records that let the next comparison explain more
Before a paper or live observation period, fix the comparison conditions and duration. Choose a period suited to the strategy's cycle and trade frequency, and do not alter the acceptance rule just because the early result looks favorable. Save signal IDs, bar opening and closing times, detection times, alert and order IDs, requested quantities, executions, and costs.
- Source version, inputs, exchange, contract, standard candles, timeframe, session, and dates match.
- Calculation timing, order creation and fill settings, capital, and sizing rules are recorded.
- Fees and funding reflect the applicable terms; slippage scenarios have a stated basis.
- Same-bar exit ambiguity, data gaps, and universe limitations remain visible.
- The first mismatched trade is connected across signal, order, execution, and cost records on one time basis.
A Strategy Tester CSV records that simulation's trades. Bar Replay helps inspect historical sequences. Neither alone proves that a signal existed in realtime at the claimed moment. Preserve contemporaneous observations separately from reruns. If a discrepancy remains unexplained, improve the evidence for that trade before increasing confidence in the equity curve.
For applying a strategy and matching costs and dates, follow the measured example in the TradingView backtest guide.