Automation
Pyramiding vs Position Reversal in TradingView: How Strategy Orders Change Exposure
Understand same-direction strategy entries, position reversals, transaction quantities, pyramiding limits and broker execution risks.
On this page+

Pyramiding and position reversal describe different ways a strategy changes its exposure. Pyramiding permits successive entries in the same direction under the relevant Pine strategy settings. Reversal changes the direction of a position, for example from long to short. A chart can display both behaviours through entry markers, but the actual order quantity and resulting position are not necessarily the same number. This guide explains why that difference matters for simulated research, alert interpretation and automated brokerage execution.
Same-direction entries and aggregate exposure
Suppose a fictional strategy buys one futures contract and later adds one more while the first remains open. Its aggregate position becomes long two contracts. Another same-direction addition increases exposure further if permitted by the script and its settings. Pyramiding can be used to express a scale-in approach, but it does not require that the existing trade be profitable. The logic controlling when to add is a separate design decision. Every addition changes aggregate exposure and may change the average entry price, collateral requirement and loss if the market moves against the position.
What the pyramiding setting controls
TradingView's strategy pyramiding property limits successive same-direction entries made using strategy.entry() under the documented model. A setting of one normally permits one entry in a direction before a position must close or reverse; a higher value can permit additional entries. It is not a universal cap on every possible order function. In particular, strategy.order() is not constrained in the same way, and order placement behaviour can introduce nuances when multiple price-based orders are pending. Read the documentation and test the actual script. A property name alone is insufficient evidence of maximum live exposure.
Reversal changes the signed position
Consider a strategy holding long two contracts that requests a new short position of one contract. Under the standard automatic reversal behaviour of strategy.entry(), an opposite-direction entry can generate a transaction for three contracts: two to close the existing long and one to establish the new short. The target position is short one, but the transaction is a sale of three. These are hypothetical quantities, not TradeLuma instructions. A receiving system that interprets the sale of three as a desired short position of three will produce a different result from the strategy's intended state.
The difference between order quantity and position size
A strategy notification may contain an order action, transaction quantity and a reported market position. Each field describes a different aspect of the event. A sell can reduce an existing long, close it, establish a short or add to an existing short, depending on the initial position and quantity. Interpret the signed position before and after the event and check the script's message contract. Do not assume that every sell means open a short or that every buy means enter a long. An automation provider may deliberately restrict which of these state transitions it supports.
Protective exits with multiple entries
A strategy with several same-direction entries can manage exits using different entry identifiers, or can apply a combined exit rule, depending on its design. Review whether a partial exit affects one simulated entry, the whole aggregate position or a reserved quantity under the script's order rules. After an additional entry, a protective order that covers only the original quantity may leave the added exposure unprotected in a live account. A chart illustration of successive entries does not establish the correctness of working broker orders. Compare actual open quantity with the protective instructions after each change.
Why backtest assumptions matter
An emulator models how orders fill from available chart data and its configured assumptions. A live reversal may encounter partial fills, rejected orders or a different price, and multiple entries can be separated by different execution delays. Review commission, slippage, session boundaries and available data resolution in a backtest. Measure maximum aggregate exposure and drawdown rather than relying solely on a cumulative profit chart. A script that appears to handle several simultaneous entries neatly in simulation may still require careful investigation of order sequencing and actual broker capabilities before any live use.
Avoid overlapping instructions in automation
A reversal can be represented as one transaction or as separate closing and opening operations, depending on the platform and supported broker workflow. If the first operation is incomplete, a subsequent instruction may increase unwanted exposure. Similarly, a scale-in instruction that arrives twice can exceed the intended number of contracts. A safe workflow needs defined quantity semantics, validation, order status tracking and reconciliation. Never assume that a simulated position becomes the broker's real position simply because an alert arrived. The broker's position is the relevant source when deciding whether another order is needed.
A structured paper-test sequence
Use fictional quantities to test a flat-to-long entry, a same-direction addition, a partial reduction, a full close and an opposite-direction signal. Capture the intended signed position, simulated transaction size, received alert, permitted order and resulting paper position for each event. Include a rejected order and an incomplete fill to see whether the workflow reports a mismatch instead of silently treating the simulated state as accurate. Test only the transitions that the intended system actually supports. A successful paper test demonstrates specific observed behaviour, not that all future live orders will execute identically.
Commercial strategy compatibility is product-specific
TradeLuma offers market-specific strategy and automation products and has a financial interest in those services. Pyramiding and reversal are general Pine Script concepts; their presence in TradingView does not imply that every TradeLuma commercial strategy or broker integration supports them. Follow the documented quantity rules, allowed positions and alert configuration for the selected product. Do not enable additional entries or alter direction handling merely because a platform setting is available. Evaluate whether total exposure fits an independently established risk budget, including potential gaps and costs. This article is educational and contains no promise of trading returns.
Frequently asked questions
What is pyramiding in TradingView?+
Successive entries in the same direction, subject to the relevant strategy settings and order functions.
Does pyramiding require a winning trade?+
No. The script's entry logic determines when an addition occurs.
Does pyramiding control strategy.order()?+
Not in the same manner as strategy.entry(); inspect the relevant function and pending order behaviour.
What happens if long two reverses to short one?+
An automatic strategy.entry reversal can generate a sale of three contracts to reach short one.
Does a reversal alert confirm the broker changed direction?+
No. Verify actual order fills and the signed broker position.
Does every TradeLuma strategy support pyramiding or reversal?+
Do not assume that. Consult the product's documented settings and supported execution workflow.
Execution workflow
See how controlled automation is structured.
Explore TradeLuma's execution flow, live and paper modes, broker controls, monitoring, and reconciliation.
See how TradeLuma works →Continue learning
Related guides.

Invalid Tick Size: Why Your Automated Futures Orders Get Rejected
Identify invalid futures price increments, round limit and stop prices intentionally, and troubleshoot rejected TradingView-to-broker orders.

Why TradingView Stops Sending Alerts: Understanding Alert Frequency Limits
Understand TradingView's 15-trigger-per-three-minute rule, watchlist limits, burst detection, debugging and safe order reconciliation before restarting automation.

Why Your TradingView Alert Fired but No Broker Order Appeared
Trace webhook delivery, validation, broker acknowledgement and fills without blindly retrying live orders.
