TradingView Strategy Properties Explained — Part 2

Wait 5 sec.

TradingView Strategy Properties Explained — Part 2NVIDIA CorporationBATS:NVDATrendAdvantage📊 TradingView Strategy Properties Explained: Execution and Trading Conditions — Part 2 In Part 1 we covered the settings that decide how big your trades are: Initial Capital, Base Currency, Order Size and Pyramiding. Part 2 covers the settings that decide how realistic those trades are: how prices move inside a bar, when and at what price orders fill, what each trade costs, and how much you can borrow. They can be found under Detalization and Execution, and Broker Emulator. These settings do not change the strategy's code, but they can change when signals are recognized, when orders are generated and filled, and ultimately the backtest results. Understanding these settings is therefore essential for evaluating a strategy correctly. In the discussion below, the term “Tick” will be used extensively and is defined as follows: Tick: The smallest price increment by which an instrument can move. Its value is predetermined for each instrument by the exchange or market and is reflected in TradingView’s minimum tick size. ________________________________________ 🔍 1. Bar Detalization What it does On historical bars, TradingView only knows four prices: open, high, low and close. It does not know the order in which they happened. Bar detalization controls how much detail the backtest gets about the price path inside each bar. In the Bar Detalization setting, the numbers refer to the amount of intrabar detail TradingView uses to reconstruct price movement within each chart bar. •4 ticks per bar — Default: The broker emulator uses the historical bar's open, high, low and close as four assumed price points to simulate order fills. •High (Premium and Ultimate plans): TradingView uses lower-timeframe price data to reconstruct price movement within the chart bar in greater detail. For example, on a 1-hour chart, High Bar Detalization uses 10-minute intrabar data. The open, high, low and close of each 10-minute bar provide four simulated price points, resulting in approximately 24 simulated ticks per hourly bar. This gives the broker emulator more information about how price moved within the bar. These are simulated price points derived from historical OHLC data, not actual market ticks. Why it matters It can change the way historical orders are filled, particularly when several orders could have been triggered during the same bar. For example, suppose a daily bar contains both the price at which a stop-loss could have been triggered and the price at which a profit target could have been reached. The sequence of those events may matter. Bar detalization can provide more detailed intrabar information to determine the order of events. When to use it Consider using Bar Detalization when: •Your strategy uses stop or limit orders. •Your strategy can enter and exit within the same bar. •Intrabar price movement is important to your strategy. •You want a more detailed historical execution model. Common mistake Bar detalization does not mean that TradingView is using complete tick-by-tick historical data. It provides a more detailed view using lower-timeframe data, but it does not eliminate all limitations of historical backtesting. ________________________________________ ⚙️ 2. Script Execution What it does Controls when the strategy recalculates. On bar close is always enabled. The other options add extra calculations on top of it. •On bar close (always on): The script runs once at the close of each bar. •On order fill: the script runs one extra time immediately after any fill. •On realtime bar tick: The script runs on every live tick. This has no effect on history. Live behavior can then differ from what you see after reloading the chart, which makes backtest and live results harder to compare. •On history bar tick (Premium and Ultimate plans, standard candles only): The script runs on each simulated tick of historical bars. This provides more granular historical recalculation, allowing the strategy to evaluate developing price information within a bar. However, it does not eliminate all sources of look-ahead bias or other limitations of historical backtesting. Keep the default On bar close unless your strategy's logic specifically needs one of the extra options. If you enable On realtime bar tick, do not expect the historical report to match what happened live. Why it matters Changing the execution setting can change when a strategy recognizes a signal and therefore when an order can be generated. For example, a strategy that only evaluates conditions at the close of a bar may react differently from one that can recalculate during the bar. This can result in different entries, exits, and overall performance. When to use it Use the execution setting that matches the way your strategy is intended to operate. Use On order fill when a decision depends on the fill itself, such as sizing a trailing stop from the actual entry price. If your strategy is designed around confirmed bar closes, calculating on bar close is generally appropriate. If your strategy is specifically designed to respond to intrabar price changes, an intrabar execution setting may be more appropriate. Common mistake Do not enable more frequent recalculation simply because it produces better historical results. The execution setting should reflect how you intend the strategy to operate in real trading, not how to maximize the backtest. ________________________________________ 💰 3. Commission What it does Commission represents the transaction costs charged when trades are executed. TradingView allows commission to be specified according to the available commission models, such as a percentage of trade value, fixed cash amount, or per contract. Why it matters Commission reduces the strategy’s net profit. The effect can be particularly large for strategies that trade frequently. For example, a strategy that generates hundreds of trades can be significantly affected by even a relatively small commission. When to use it Use a commission assumption that reasonably reflects the costs you expect to incur when trading the instrument. If you are comparing strategies rather than modelling a specific broker, use the same commission assumption for all strategies so that the comparison remains consistent. Common mistake Do not leave commission at zero unless you intentionally want to examine results before transaction costs. A strategy that is profitable before commission may become unprofitable after realistic trading costs are included. Also remember that commission and slippage are different: •Commission is a trading cost charged by the broker or exchange. •Slippage represents a difference between the expected and actual execution price. ________________________________________ 📈 4. Long Leverage What it does Long Leverage determines how much long exposure the strategy can take relative to its available capital. For example, with $10,000 of equity and 2× long leverage, the strategy can potentially control up to $20,000 of long exposure, subject to the strategy's order-sizing rules (see Part 1). Why it matters Higher leverage allows the strategy to take larger long positions relative to its available capital. This can increase both potential returns and potential losses. Importantly, setting Long Leverage to 0 does not simply disable long trades. In our tests, it stopped the strategy from placing any trades at all, long or short. When to use it Use a leverage value that reflects the amount of leverage you could realistically use when trading the instrument. •1× — unleveraged long exposure •Greater than 1× — leveraged long exposure •0 — no trades at all (not a way to disable one direction) If losses push your equity below the required margin, the emulator triggers a margin call and liquidates part of the position. Check the Capital efficiency section of the strategy report for the number of margin calls. If it is above zero, the equity curve reflects forced liquidations, in addition to your strategy’s own exit rules. Common mistake Do not assume that setting leverage to 2× automatically makes every trade twice as large. Leverage determines the maximum available exposure. The actual position size still depends on the strategy's order-sizing settings. ________________________________________ 📉 5. Short Leverage What it does Short Leverage determines how much short exposure the strategy can take relative to its available capital. It works in the same general way as Long Leverage, but applies to short positions. Why it matters Higher leverage allows larger short positions relative to available capital, increasing both potential gains and potential losses from short trades. As with Long Leverage, setting Short Leverage to 0 stopped all trading in our tests, not just short trades. When to use it Use a value that reflects the leverage realistically available for short selling the instrument. •1× — unleveraged short exposure •Greater than 1× — leveraged short exposure •0 — no trades at all (not a way to disable one direction) For a strategy that trades both directions, the long and short leverage settings can be set independently. Also, margin calls work the same way for short positions. Common mistake Do not confuse leverage with position sizing. For example, setting Short Leverage to 2× does not necessarily mean that every short trade will use 2× exposure. It establishes the available leverage, while the strategy's order-sizing rules determine the actual position size. Likewise, setting one side to 0 is not a way to trade in one direction only. In our tests, it prevented all trades. To restrict a strategy to one direction, use the strategy’s own direction settings instead. ________________________________________ 📌 6. Slippage What it does Slippage models the difference between the expected execution price and the actual simulated execution price. It is normally specified in ticks. For example, if a market order would theoretically execute at $100.00 but the configured slippage causes a two-tick adverse adjustment, the simulated execution price will be less favorable. Why it matters Slippage reduces the performance of trades by making entries and exits less favorable. Its effect becomes increasingly important for: •Short-term strategies •High-frequency strategies •Strategies with small expected profits per trade •Instruments with significant bid-ask spreads or variable liquidity When to use it Use a slippage assumption that is reasonably consistent with the instrument, timeframe, and type of trading you are modelling. It is particularly important to include slippage when evaluating whether a strategy’s edge is large enough to survive real-world execution costs. Common mistake Do not confuse ticks with percentages. A given number of ticks can represent a very different percentage price movement for different instruments. Also, do not use an extremely large slippage value simply to make a strategy appear conservative. The assumption should have a reasonable connection to the market being tested. ________________________________________ 🎯 7. Limit Order Execution What it does This setting controls how TradingView determines whether historical limit orders are filled. There are two options: •Requested price: The order fills as soon as price reaches the limit price. •Requested price and 1 tick beyond: Price must trade at least one tick past the limit price. If your strategy uses limit orders, consider testing it with “Requested price and 1 tick beyond” for a more conservative assessment. If performance deteriorates significantly under this setting, the strategy may be sensitive to the assumptions used to simulate limit-order fills. This sensitivity is worth investigating before concluding that the strategy’s edge is robust. Strategies that use only market orders are not affected by this setting. Why it matters This can have a significant effect on strategies that rely heavily on limit orders. Consider a buy limit order at $100. If the historical price only touches $100, should the backtest assume that the order definitely filled? Or should the price move below $100 by a certain amount before the fill is considered sufficiently reliable? The selected setting affects that assumption. When to use it Pay particular attention to this setting when your strategy: •Uses many limit orders. •Depends on precise entry prices. •Places limit orders close to the current market price. •Has a relatively small profit target. A more conservative assumption can help prevent overly optimistic historical fills. Common mistake Do not assume that every historical touch of a limit price guarantees a real-world fill. In actual markets, execution depends on factors such as liquidity, order-book conditions, and your position in the queue. ________________________________________ ⏱️ 8. Order Execution Delay What it does Order Execution Delay introduces a delay between the time a strategy generates an order and the time the order is simulated as being executed. Why it matters Without an execution delay, a strategy can sometimes assume that an order is executed very quickly after a signal. Adding a delay can produce a more conservative result by allowing price to move before the simulated trade is filled. For example: Signal → Order generated → Delay → Order executed The longer the delay, the more opportunity there is for the market price to move before execution. Keep the default delay “One Tick” unless you can actually trade at the close, for example with market-on-close orders. If you turn the delay off and your results improve a lot, part of your edge may be the gap between one bar's close and the next bar's open. You may not be able to capture that in live trading. When to use it Consider using an execution delay when: •Your strategy operates on short timeframes. •Signals require time to generate and transmit an order. •You want to test how sensitive the strategy is to slower execution. •Immediate execution would be unrealistic for your trading setup. Common mistake Do not add a large delay simply because it improves or worsens strategy performance. The purpose is to model a realistic execution constraint, not to penalize the strategy artificially. A realistic delay can legitimately reduce strategy performance. That is not a problem—it may be an important finding about the strategy's sensitivity to execution speed. ________________________________________ 🧩 Putting the Settings Together These properties should not be viewed independently. For example, a strategy can have: •Realistic commission •Realistic slippage •Conservative limit-order assumptions •Appropriate execution timing •Bar Detalization enabled and therefore produce a very different result from the same strategy tested with zero commission, zero slippage, immediate execution, and optimistic limit-order fills. The objective is not to make the backtest look worse. The objective is to make the assumptions as realistic and transparent as possible. A practical approach When testing a strategy, consider the following sequence: 1. Start with realistic trading costs Set commission and slippage based on the market and trading style. 2. Match execution to the strategy Choose execution settings that reflect how the strategy is intended to operate. 3. Pay attention to intrabar behavior Use Bar Detalization when the sequence of events inside a bar can affect your results. 4. Be conservative with limit orders If your strategy depends heavily on limit-order fills, test whether its performance survives more conservative assumptions. 5. Test execution sensitivity Where appropriate, introduce a realistic execution delay and see whether the strategy’s edge remains. A robust strategy should ideally remain reasonably attractive when realistic execution assumptions are applied—not only under ideal historical fills. ________________________________________ 🧪 NVDA Example Demonstrating How Changing the Inputs Under Detalization and Execution, and Broker Emulator Changes Strategy Results (Chart Displayed Above) The test (Illustrative comparison: the settings are examples for demonstrating execution sensitivity, not recommended configurations for trading NVDA) •Strategy: RSI long-only with Breach-then-Cross-Back (14, 30, 70) •Symbol: NVDA, 30-minute chart, January 2020 to December 2025 •Initial capital $100,000, 50% of equity per trade The above settings were the same for all scenarios. Three settings for the Detalization and Execution, and Broker Emulator A: Ideal Bar Detalization: Default (4 ticks per bar) Script Execution: On bar close Commission: 0 Slippage: 0 Limit Order Execution: Requested price Order Execution Delay: None B: Realistic Bar Detalization: Default (4 ticks per bar) Script Execution: On bar close Commission: 0.05% Slippage: 2 ticks Limit Order Execution: Requested price and 1 tick beyond Order Execution Delay: Default (one tick) C: Conservative Bar Detalization: High Script Execution: On bar close + on history bar tick Commission: 0.10% Slippage: 5 ticks Limit Order Execution: Requested price and 1 tick beyond Order Execution Delay: Default (one tick) The Ideal scenario represents a frictionless environment: no commission, no slippage, no execution delay, and execution at the requested price. It therefore provides a useful theoretical reference, but it should not automatically be interpreted as a realistic expectation. The Realistic scenario introduces moderate trading costs and execution imperfections. The trade signals remain essentially the same, but the entry and exit prices are less favorable. The result is a lower equity curve, demonstrating the cumulative impact of commissions, slippage, and execution assumptions. The Conservative scenario combines higher trading costs with more demanding execution settings, including higher bar detalization and historical bar-tick execution. Detalization and Execution settings affect how the strategy is calculated, while Broker Emulator settings affect how orders are filled. Together, they can change execution timing, entry and exit prices, and trade outcomes. Therefore, execution assumptions, not just trading costs, can materially affect backtest results. The size of the effect depends on the strategy and the market data. Results (98 trades in each case as reported in the List of Trades in the Strategy Report) •Ideal: +$248,519 net profit, profit factor 2.70, win rate 72.45%, maximum drawdown $51,956 (19.12%) •Realistic: +$219,868 net profit, profit factor 2.59, win rate 72.45%, maximum drawdown $44,852 (19.22%) •Conservative: +$91,733 net profit, profit factor 1.74, win rate 69.39%, maximum drawdown $33,189 (26.19%) Note: TradingView calculates maximum drawdown in monetary and percentage terms separately; the two maximum values do not necessarily correspond to the same equity decline. Lesson 1: Trading costs and execution assumptions reduce overall performance (A → B) Both scenarios contain 98 trades, with largely overlapping calendar dates. However, their recorded execution timestamps and prices differ. The Realistic scenario also includes commissions totaling approximately $8,952. Together, these differences are associated with a reduction in net profit of approximately $28,651. Lesson 2: Some settings change the trades themselves (B → C) Scenario C also has 98 trades, but every one fills earlier than in B. About half land on the same bar as the Ideal fill, and the rest trigger from one bar to nearly four days earlier. This is because with intrabar recalculation the RSI condition can be met during a bar even when it is not met at that bar’s close. Three winners became losers. Conservative commissions total approximately $13,257, only about $4,305 more than in Realistic, yet net profit falls by approximately $128,135. The additional commissions alone cannot explain this difference; changes in execution and trade outcomes also contribute. Key Insights •Avoid judging a strategy on zero-cost settings especially when a large number of trades are generated. Add realistic commission and slippage. •Slippage is set in ticks, so it has a larger impact on low-priced stocks. On split-adjusted historical prices, it can be overstated. •Settings such as intrabar recalculation and bar detalization do more than add caution. They change when, and sometimes whether, trades occur. •When comparing backtests, always check the Properties tab first. Two strategies with identical code can produce very different results depending on the Properties settings. ________________________________________ A Note to Strategy Publishers When you publish a TradingView strategy, its Strategy Report is published with it. The report is not a private backtest; it is part of what users see when they evaluate the script, and many will read it as representative of the strategy, even if you intended it only as an example configuration. The Properties behind the report therefore deserve the same attention as the script's inputs and description. Before publishing, check that: •Initial Capital, Order Size and Pyramiding are realistic for an average trader, and each trade allocates a sustainable share of equity. •Commission and Slippage reflect the instrument you tested. If you use zero costs, justify it in the description. •Long and Short Leverage are realistic, and the report shows no margin calls you haven't explained. •Bar detalization, Script execution, Limit order execution and Order execution delay match how the strategy is meant to trade. •TradingView’s publishing rules recommend more than 100 trades in most cases, and shorter timeframes generally need more for meaningful evaluation. Finally, make sure the default Properties in your script's code match the settings used for the report, and explain them in the description. Users who add the script to their own chart start from those code defaults, not from your chart's settings. References TradingView Help Center: •Strategy properties •Bar detalization •Script executions •Script publishing rules •Strategy publishing rules Pine Script User Manual: •Strategies TradingView Strategy Properties — Educational Reference — TrendAdvantage