Skip to content
All library documents

Pyramiding Strategy Driven by External Buy and Sell Signals

Article TradingView scripts

Summary

This generic strategy takes an external source as its trading signal: positive values request long entries, negative values request shorts, and zero means no action. Repeated signals in the current direction add to the position according to the strategy’s configured order size. An opposite signal reverses direction by closing the existing position and opening a new one.

An optional cancel source can block new entries or close an existing position, depending on the selected behavior. A stop can be specified as a fixed amount or as a percentage of the chart asset’s price; the script closes positions when open profit falls beyond the chosen loss threshold. The document recommends sufficient pyramiding capacity and capital, but supplies no entry logic, backtest results, or evidence of profitability. Position growth, reversal behavior, and stop outcomes therefore depend on the connected signal, platform settings, and instrument.

Key ideas

  • Positive and negative source values direct long and short entries, while zero leaves the position unchanged.
  • Repeated same-direction signals add to a position using the configured order size.
  • An opposite signal closes the current position and opens in the other direction.
  • A cancel source can prevent entries or close positions according to the selected mode.
  • Stops use a fixed amount or a price percentage and act on open profit.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.