Skip to content
All library documents

Indicator Voting and Risk-Based Position Sizing in a Long-Only Strategy

Article TradingView scripts

Summary

This strategy combines RSI, MACD histogram, short-versus-long EMA, Bollinger Bands and SuperTrend into a majority vote. Each enabled indicator contributes a buy, sell or neutral reading based on its rule; the combined signal is the side with more votes. When the buy vote wins, the script enters a long position if calculated quantity is positive. Position size is derived from a chosen risk percentage of tracked capital divided by the distance from price to a recent-low stop, with optional quantity rounding. A reward multiple sets the profit target, and the script submits stop and limit exits.

The source also plots price, stop and target and creates a buy alert. Despite computing sell votes, it contains no short-entry rule, so a sell majority does not open a short trade. The recent-high value is calculated but unused, and the description’s reference to ATR-based stop sizing does not match the code: ATR is used only for SuperTrend. No backtest results are provided, and the script’s rules and sizing assumptions require independent review.

Key ideas

  • Five technical indicators contribute votes to a combined directional signal.
  • Only a winning buy vote can open a position in the supplied code.
  • Quantity is based on risk capital divided by the distance to a recent-low stop.
  • A reward multiple determines the limit target, while the stop and target are submitted as exits.
  • The code provides no performance evidence and its sell signal does not trigger a short entry.

Tags

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