OPEN-SOURCE SCRIPT

Parsifal.STMT.PositioningScore

467
Parsifal.STMT.PositioningScore
Overview
STMT.PositioningScore is a composite indicator designed to capture short- to medium-term market dynamics. It synthesizes momentum, trend, flow, and oscillator signals into a single normalized score — the MT_Score — from which two practical positioning outputs are derived: POS_cons (conservative positioning) and POS_agg (aggressive positioning).

Concept

The indicator is built in three logical layers:

• Score construction — Multiple sub-modules collect and combine evidence of bullish or bearish market bias. Each module focuses on a specific dimension of market behavior (momentum, trend structure, price flow, oscillator levels, and their respective slopes). The outputs are standardized and then synthesized into short-term and medium-term swing-state scores (ST_Score and MT_Score).

• Directional derivatives — The rate of change (first derivative) and curvature (second derivative) of the MT_Score are computed and normalized. These metrics reveal whether bullish or bearish momentum is currently accelerating or decelerating.

• Positioning signals — The MT_Score together with its derivatives is used to generate:
  • • POS_agg: a direct, more aggressive long/flat/short positioning signal
  • • POS_cons: a more nuanced, conservative positioning guide featuring differentiated action states such as “add”, “hold”, and “reduce”.



Internal Modules

The ST-, MT-Scores and Positioning indicators constitute internal-modules, that utilize raw price data, recent market behavior, and classical technical indicators to evaluate the character, direction, and strength of the prevailing swing state.

ST_ and MT_Scores

The current swing state of the instrument is represented on two time horizons by two composite scores: the ST_Score (short-term) and the MT_Score (medium-term). Both are aggregated from the outputs of the sub-modules listed below and normalized to the range [-1, +1]. Positive values reflect an overall bullish swing state; negative values reflect bearish conditions.

POS_agg and POS_cons Positioning indicators

Together with their rates of change and curvature, the ST- and MT-Scores capture not only the dominant swing direction but also its current momentum dynamics. These components form the basis for generating the two positioning indicators:

• POS_agg: an aggressive signal taking discrete values of -1 (short), 0 (neutral), and +1 (long)
• POS_cons: a conservative, graded signal (visualized through colors) that recommends more refined actions (“add”, “hold”, “reduce/exit”) depending on whether the position is long or short.

The submodules underling the ST-, MT-Scores and Positioning indicators

ST-, MT-Scores and Positioning indicators depend on a range of additional submodules:

SwingFast

Captures short-term momentum using RSI and Stochastic indicators. It generates asymmetric upside and downside swing signals based on RSI level, RSI trend relative to its EMA, Stochastic %D, and StochRSI. The module outputs a fast-oscillating swing score together with its 9-period EMA.

SwingFlow

Examines intrabar and interbar price action via open/high/low/close geometry. It quantifies overshoot (bearish pressure), undershoot (bullish pressure), directional extension, relative high/low positioning, and the overall net flow balance. Outputs consist of a smoothed flow sum, its EMA, and the slope of the flow.

SwingTrend

Constructs a trend score from standardized deviations of price from its 21-, 50-, and 200-period EMAs, pairwise EMA spreads, the TEMA–EMA spread, as well as RSI level and slope. All components are z-scored over a rolling 400-bar window, and the final result is further smoothed.

SwingScore

Integrates sign-based directional assessments of RSI level and trend, the SwingFast swing score, TEMA–EMA price direction, flow slope, and TEMA momentum — combined with z-scored price–EMA deviations and EMA slopes.

Slopes

A confirmation module that measures directional agreement by counting consistent slopes across multiple inputs: RSI EMA slope, flow slope, TEMA price slope, Stochastic slope, StochRSI slope, EMA21 and EMA50 slopes, SwingScore slope, SwingFast EMA slope, and the position of price relative to EMA5. The total count indicates the degree of short-term directional consensus.

Outputs and how to use them

MT_Score (Medium-Term Score)

The main output of the indicator, displayed as a solid amber line oscillating between -1 and +1. It represents the strength and direction of the current medium-term swing or trend. Values close to +1 or -1 indicate overheated / overextended market conditions — typically toppish near +1 and bottomish near -1.

How to read and use the MT-Score:

• A positive MT_Score indicates a bullish market state; a negative value indicates a bearish state.
• A rising line suggests strengthening bullish momentum or weakening bearish pressure; a falling line indicates the opposite.
• Historically extreme high or low values signal overbought or oversold conditions.
• Extreme readings followed by a reversal in curvature often mark the beginning of mean-reversion moves.

Positioning Outputs

POS_cons — Conservative Positioning Action (histogram)

POS_cons is a graded signal derived from the combination of the MT_Score level, its normalized slope (rate of change), and its normalized curvature. It offers actionable recommendations for managing existing positions and is visualized as a color-coded histogram that extends upward (long-position actions) or downward (short-position actions) from the zero line.

How to read and use the POS_cons

The color-coded histogram recommends the following actions:

• Upward bar, green: Add to Long Position
• Upward bar, yellow: Hold Long Position
• Upward bar, red: Reduce or Exit Long Position

• Downward bar, red: Add to Short Position
• Downward bar, yellow: Hold Short Position
• Downward bar, green: Reduce or Exit Short Position

These guidelines represent a recommended starting point. Traders may adjust them according to specific chart patterns or broader market context (using the MT_Score for refinement), although such adaptations are not detailed further here.

POS_agg — Aggressive, Direct Positioning Signal (shaded fill zones)

POS_agg is displayed as horizontal shaded fill zones at the top and bottom of the POS_cons histogram: green fills at the top for bullish positioning and red fills at the bottom for bearish positioning.

How to read and use POS_agg:

• Green fill at top of the histogram → consider a long position (enter or hold)
• No fill zone (neither top nor bottom) → neutral / no clear directional bias
• Red fill zone at the bottom of the histogram → consider a short position (enter or hold)
As with POS_cons, the MT_Score can be used to provide additional context or to fine-tune decisions based on POS_agg.

To increase signal reliability, it is recommended to combine this indicator with complementary filters — particularly those based on market structure or other non-lagging information sources.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.