OPEN-SOURCE SCRIPT

Money Flow based probability

82
Money Flow based probability

This indicator provides a comprehensive correlation and momentum analysis between your main asset and up to three selected correlated assets. It combines correlation, trend, momentum, and overbought/oversold signals into a single, easy-to-read table directly on your chart.

  1. Correlated Asset Selection:
    You can select up to three correlated assets (e.g., indices, currencies, bonds) to compare with your main chart symbol. Each asset can be toggled on or off.

  2. Correlation Calculation:
    The indicator uses the native Pine Script
    Pine Script®
    ta.correlation
    function to measure the statistical relationship between the closing prices of your asset and each selected pair over a user-defined period.

  3. Technical Analysis Integration:
    For each asset (including the main one), the indicator calculates:
    Trend direction using EMA (Exponential Moving Average) – optional
    Momentum using MACD – optional
    Overbought/oversold status using RSI – optional
  4. Probability Scoring:
    A weighted scoring system combines correlation, trend, MACD, RSI, and trend exhaustion signals to produce buy and sell probabilities for the main asset.

  5. Visual Table Output:
    A customizable table is displayed on the chart, showing:
    Asset name
    Correlation (as a percentage, -100% to +100%)
    Trend (Bullish/Bearish)
    MACD status (Bullish/Bearish)
    RSI value and status
    Buy/Sell probability (with fixed-width formatting for stability)
  6. User Customization:
    You can adjust:
    • Table size, color, and position
    • Correlation period
    • EMA, MACD, and RSI parameters
    • Which assets to display


This indicator is ideal for traders who want to quickly assess the influence of major correlated markets and technical signals on their trading instrument, all in a single glance.

---

Example: Correlation Calculation
Pine Script®
corrCurrentAsset1 = ta.correlation(close, asset1Data, correlationPeriod)


Example: Table Output (Buy/Sell %)
Pine Script®
buyStr = f_formatPercent(buyProbability) + "%" sellStr = f_formatPercent(sellProbability) + "%" cellStr = buyStr + " / " + sellStr

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.