Indicator · Pine Script v5 · Own pane

Modified Mannarino Market Risk Indicator

by regalouisei· code credited to allanster

This indicator plots a market-risk reading in a separate pane.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code75
Settings12inputs
LicenceNone statedfile: MPL-2.0
Last update8 months ago25 Feb 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

75 lines of Pine Script v5 from pinescript/editors_picks/modified-mannarino-market-risk-indicator-mmmri-mmri.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

modified-mannarino-market-risk-indicator-mmmri-mmri.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © allanster

// MMRI Gregory Mannarino: https://www.mannarino-market-risk-indicator.com/
// MMRI = (USD Strength * USD Interest Rate) / 1.61

// MMMRI Nobody Special Finance: https://www.mannarino-market-risk-indicator.com/MMMRI/ 
// MMMRI = (Debt / GDP) * (USD Strength * USD Interest Rate) / 1.61

//@version=5
indicator("Modified Mannarino Market Risk Indicator")

i_fiat = input.symbol('TVC:DXY',         'USD Strength')
i_intr = input.symbol('TVC:US10Y',       '10 Year Yield')
i_dgmr = input.float (1.61,              'Denominator', minval = 0.01)
i_nsff = input.bool  (true,              'Use Modified MMRI')
i_dgdp = input.symbol('ECONOMICS:USGDG', 'Debt To GDP Ratio')
i_fctr = input.bool  (false,             'Use Custom Ratio Below')
i_debt = input.symbol('ECONOMICS:USGD',  'Debt')
i_tgdp = input.symbol('ECONOMICS:USGDP', 'GDP')
i_bars = input.bool  (true,              'Color Bars')
i_plot = input.bool  (true,              'Color Plot')
i_fill = input.bool  (true,              'Color Fills')
i_tabl = input.bool  (true,              'Show Values')

repaint(_symbol) => nz(request.security(_symbol, timeframe.period, close, ignore_invalid_symbol = true),
 request.security(_symbol, timeframe.isintraday ? 'D' : timeframe.period, close))

dollar = repaint(i_fiat)
intrst = repaint(i_intr)
usdebt = repaint(i_debt)
ustgdp = repaint(i_tgdp)
dbtgdp = repaint(i_dgdp)

mmriGM = (dollar * intrst) / i_dgmr
fctrNS = i_fctr ? usdebt / ustgdp : dbtgdp / 100  // use custom (usdebt / ustgdp) or (dbtgdp / 100)
mmriNS = fctrNS * mmriGM
pcntNS = fctrNS * 100

output = i_nsff ? mmriNS : mmriGM

// 0-50 slight risk, 50-100 low risk, 100-200 moderate risk, 200-300 high risk, 300+ extreme risk
colrSR = #00ffff, colrLR = #00ff00, colrMR = #ffff00, colrHR = #ff7f00, colrER = #ff0000

colors(_valu) =>
    colors =
     _valu <  050                 ? colrSR :
     _valu >= 050 and _valu < 100 ? colrLR :
     _valu >= 100 and _valu < 200 ? colrMR :
     _valu >= 200 and _valu < 300 ? colrHR : colrER

plot(output, 'Plot', i_plot ? colors(output) : #ffffff)

h0 = hline(0), h1 = hline(50), h2 = hline(100), h3 = hline(200), h4 = hline(300), h5 = hline(400)
fill(h5, h4, i_fill ? color.new(colrER, 90) : na)
fill(h4, h3, i_fill ? color.new(colrHR, 90) : na)
fill(h3, h2, i_fill ? color.new(colrMR, 90) : na)
fill(h2, h1, i_fill ? color.new(colrLR, 90) : na)
fill(h1, h0, i_fill ? color.new(colrSR, 90) : na)

barcolor(i_bars ? colors(output) : na)

if i_tabl
    coltxt = #ffffff, alignL = text.align_left, alignR = text.align_right, coltbl = #150042
    var table t = table.new(position.middle_right, 2, 5, coltbl, #7f7f7f, 2, #7f7f7f, 1)
    table.cell(t, 0, 0, 'MMRI:',                                  0, 0, coltxt,         alignR)
    table.cell(t, 1, 0, str.format('{0, number, 0.00}',  mmriGM), 0, 0, colors(mmriGM), alignL)
    table.cell(t, 0, 1, 'MMMRI:',                                 0, 0, coltxt,         alignR)
    table.cell(t, 1, 1, str.format('{0, number, 0.00}',  mmriNS), 0, 0, colors(mmriNS), alignL)
    table.cell(t, 0, 2, str.format('{0}:', i_fiat),               0, 0, coltxt,         alignR)
    table.cell(t, 1, 2, str.format('{0, number, 0.00}',  dollar), 0, 0, coltxt,         alignL)
    table.cell(t, 0, 3, str.format('{0}:', i_intr),               0, 0, coltxt,         alignR)
    table.cell(t, 1, 3, str.format('{0, number, 0.00}%', intrst), 0, 0, coltxt,         alignL)
    table.cell(t, 0, 4, 'Debt To GDP:',                           0, 0, coltxt,         alignR)
    table.cell(t, 1, 4, str.format('{0, number, 0.00}%', pcntNS), 0, 0, coltxt,         alignL)

Overview

Modified Mannarino Market Risk Indicator multiplies a selected USD-strength series by a yield series and divides by a denominator, defaulting to 1.61. An optional modified mode multiplies that result by a debt-to-GDP factor, using either a published ratio or custom debt and GDP series. The plot, zone fills, and optional price-bar colors mark five bands from slight through extreme risk. A table can show both formulas and the source values. It has no trade entries or exits.

Details

Published by

regalouisei on GitHub

Code credit

allanster, as written in the script's header

Type

Indicator, Pine Script v5

Draws

Separate pane below the chart

Category

Screeners & dashboards

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
USD StrengthsymbolTVC:DXYi_fiat
10 Year YieldsymbolTVC:US10Yi_intr
Denominatorfloat1.61i_dgmr
Use Modified MMRIbooltruei_nsff
Debt To GDP RatiosymbolECONOMICS:USGDGi_dgdp
Use Custom Ratio Belowboolfalsei_fctr
DebtsymbolECONOMICS:USGDi_debt
GDPsymbolECONOMICS:USGDPi_tgdp
Color Barsbooltruei_bars
Color Plotbooltruei_plot
Color Fillsbooltruei_fill
Show Valuesbooltruei_tabl
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

948 stars

This indicator measures the chart symbol’s percentage change from the opening price at the start of each US presidential term and plots those values as histogram columns in a separate pane. Columns are offset so each administration appears separately, with a s

Indicator v6 Screeners & dashboards
Updated 10 days ago · GPL-3.0 GitHub repository of Presidents Performance

This indicator scans a pasted list of symbols for RSI directional momentum and shows matching long and short signals in a table in a separate pane. The user chooses continuous break, continuous retracement, flip break, flip retracement, divergence, or hidden d

Indicator v6 Oscillators & momentumDivergence
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup - RSI Directional Momentum Scanner

Tables-001

by ricardosantos79
261 stars

This indicator builds a TradingView table in a separate pane and fills its cells with fixed placeholder text according to whether each row and column index is even or odd. Users set the table position, the number of rows and columns, and the background, frame,

Indicator v4 Screeners & dashboards
Updated 4 years ago · None stated GitHub repository of Tables-001
257 stars

Donald SPX - Options Trading is an indicator designed to assist SPX index option traders by tracking session benchmarks and multi-timeframe moving average data. It calculates a 200-period weighted moving average (WMA) and requests multi-timeframe bar data from

Indicator v5 Moving averagesScreeners & dashboards Repaints
Updated 6 weeks ago · None stated GitHub repository of Donald SPX - Options Trading

Index Member Distribution

by TradersPost
218 stars

Calculates and plots a weighted histogram of constituent returns for major market indices (NDX, SPX, DJIA, and RUT) in a separate pane. Each histogram bin reflects the summed weights of members within that percentage return bracket. The script renders vertical

Indicator v6 Screeners & dashboards
Updated 3 months ago · None stated GitHub repository of Index Member Distribution

KamaFama

by Mastaaa1987
141 stars

KamaFama is an indicator that translates a Freqtrade trading strategy into Pine Script for visualization. It combines Kaufman Adaptive Moving Average (KAMA), MAMA/FAMA calculations derived via Hilbert Transform, Williams %R, and correlation trend filters to ev

Indicator v6 Moving averagesOscillators & momentum
Updated 6 weeks ago · MIT GitHub repository of KamaFama

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers