OPEN-SOURCE SCRIPT

Structural SVM Ranker [LuxAlgo]

23 011
The Structural SVM Ranker [LuxAlgo] indicator is a market structure tool that utilizes a linear Support Vector Machine (SVM) algorithm to classify and rank structural breaks based on volume, momentum, and price magnitude. By assigning a score from 0 to 100 to every Break of Structure (BOS) and Change of Character (CHoCH), it aims to help traders differentiate between high-conviction structural shifts and low-probability price action.

🔶 USAGE

The indicator identifies key pivot highs and lows to map out the market structure. When price closes beyond these levels, a structural break is identified and assigned a score based on the quality of the move.

  • BOS (Break of Structure): Represented by solid lines, these indicate a continuation of the current local trend.
  • CHoCH (Change of Character): Represented by dashed lines, these indicate a potential reversal in the trend direction.
  • SVM Score: Displayed on labels and the dashboard. A higher score suggests the break occurred with significant relative volume, strong RSI momentum, and a meaningful price distance beyond the pivot level.


Traders can use the SVM score to filter trade quality. For example, a "CHoCH" with a score above 70 indicates a high-conviction reversal backed by volume and momentum, whereas a score below 30 might suggest a "fakeout" or a weak structural shift.

🔶 DETAILS

The core of the script is a linear classification logic inspired by Support Vector Machines. It takes three primary features into account to determine the "strength" of a break:

  1. Relative Volume: Compares current volume to its 20-period average to ensure the break is supported by market participation.
  2. RSI Momentum: Measures the distance of the RSI from its midpoint (50) to confirm trend strength.
  3. Break Distance: Measures how far the price closed beyond the structural level, normalized by the Average True Range (ATR).


These features are multiplied by user-defined weights and then passed through a Sigmoid function to produce a normalized score between 0 and 100.

🔶 SETTINGS

🔹 Market Structure

  • Pivot Lookback: Determines the number of bars required to confirm a pivot high or low.
  • Show BOS/CHoCH: Toggles the visibility of structural break lines and labels.


🔹 SVM Ranking Parameters

  • Relative Volume Weight: Adjusts the influence of volume on the final score.
  • RSI Momentum Weight: Adjusts the influence of RSI deviation from 50 on the final score.
  • Break Distance Weight: Adjusts the influence of the price distance beyond the pivot (relative to ATR).
  • ATR Length: The period used for the ATR normalization of the break distance.


🔹 Dashboard

  • Dashboard: Toggles the visibility of the real-time ranking table.
  • Position: Moves the dashboard to different corners of the chart (Top Right, Bottom Right, Bottom Left).
  • Size: Adjusts the scale of the dashboard text.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.