Pine Script v5 · Strategy
MVRV Z Score and MVRV Free Float Z-Score
A Pine Script v5 strategy built on Crossunder (Zscore, 0.1) and Crossover (Zscore, 7.0). It has 2 order rules, 1 entry among them, and trades long only with the default settings. Exits wait for a signal; there is no stop loss. Each trade commits 100 in cash and pays no commission. 5 settings; defaults include Calculation Method Standard, Market Cap Source Glassnode and Upper Line 7.0.
Generated from the script's code by a template: every clause is a fact read from the source. Not written by a person or a model, and not taken from the author's description.
- Does MVRV Z Score and MVRV Free Float Z-Score repaint?
- No
- No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
- How did MVRV Z Score and MVRV Free Float Z-Score do on BTCUSDT 1D with default settings?
- Not measured
- It closed no trades there from 26 Jan 2024 to 21 Oct 2026 with the default settings, so there is no result to report. Its entry conditions never all held on this data. It closed no trades on the other markets either. A backtest, not investment advice.
- Does MVRV Z Score and MVRV Free Float Z-Score run in Pine Script v6?
- No
- The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L37:C47: 'plot' has no 'transp' parameter in Pine Script v6. Use color.new(color, transparency) instead. The v6 version is shown for reference and is not offered as a download.
- Does MVRV Z Score and MVRV Free Float Z-Score use a stop loss?
- No
- Every exit waits for a signal; nothing limits a losing trade before it fires.
- Does MVRV Z Score and MVRV Free Float Z-Score run in Zeal Terminal?
- Yes
- It compiles in 19 ms and runs 1,000 bars in 63 ms, in the browser.
BTCUSDT · 1D · default settings
- Crossunder
- Crossover
- Winning trade
- Losing trade
- Equity
- Buy and hold
Needs GLASSNODE:BTC_MARKETCAP D data, not available: not a Binance spot market Needs CRYPTOCAP:BTC D data, not available: not a Binance spot market Needs COINMETRICS:BTC_MARKETCAPFF D data, not available: not a Binance spot market Needs COINMETRICS:BTC_MARKETCAPREAL D data, not available: not a Binance spot market Values that depend on it are empty on this chart.
- Net profit
- 0.00%
- $0.00
- Buy and hold
- +102.5%
- same period
- Closed trades
- 0
- 0 won · 0 lost
- Profitable
- 0.0%
- of closed trades
- Profit factor
- —
- gross profit ÷ gross loss
- Max drawdown
- 0.00%
- $0.00
One run with the author's default settings, $100 starting capital, commission as the script sets it. A single backtest says little about future results and is not a recommendation. Backtests are simulations on historical data and are not investment advice.
Review
What a careful reader of this script would point out, found by checking the source and the backtest.
-
Check
No stop loss
Every exit waits for a signal. Nothing limits a losing trade before the exit condition fires.
-
Check
No commission
The backtest assumes free trading. Results on any real exchange will be lower.
-
Note
No slippage
Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.
Settings
Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.
| Setting | Default | Type and range | Feeds |
|---|---|---|---|
| Strategy Mode | false | bool | entry Long close Long line 50 line 52 |
| Calculation MethodThe standard calculation uses the market cap while the free float version uses the free float market cap. | Standard | string · options ["Standard","Free Float"] | line 28 line 30 line 32 line 34 |
| Market Cap Source | Glassnode | string · options ["Glassnode","Coinmetrics"] | line 22 |
| Upper LineZ-Score value above which a sell signal is given, standard is 7. | 7.0 | float | UpperLine TakeProfit |
| Lower LineZ-Score value below which a buy signal is given, standard is 0.1. | 0.1 | float | LowerLine Long |
What it calculates
- CrossunderZscore, Lower Line (0.1)
Long · line 47 - CrossoverZscore, Upper Line (7.0)
TakeProfit · line 48
Signal flow
How price data and settings reach the orders. Each box is a name in the script, or several computed the same way; each arrow is a value one of them reads. Hover a box for its members.
Order rules
| Order | Fires when | By default | Line |
|---|---|---|---|
| Open Long long | Long and Strategymode | On | 51 |
| Close Long | TakeProfit and Strategymode | On | 53 |
Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.
Does it repaint?
No
No repainting patterns in the source.
- ClearHigher-timeframe data4 request.security call(s), none with lookahead on.
- ClearFuture-bar referencesNo negative history offsets such as close[-1].
- ClearIntrabar recalculationNo varip, calc_on_every_tick or realtime-only state. Orders are decided once per closed bar.
- ClearOrder timingOrders fill at the next bar's open, after the signal bar has closed.
The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.
Other markets
Not run on other markets: the script requests GLASSNODE:BTC_MARKETCAP D, CRYPTOCAP:BTC D, COINMETRICS:BTC_MARKETCAPFF D, COINMETRICS:BTC_MARKETCAPREAL D, and that data is not available here (not a Binance spot market; not a Binance spot market; not a Binance spot market; not a Binance spot market). Its results would rest on empty values.
Similar scripts
No other indicator or strategy here shares enough of its calculations.
Upgrade and export
Written in Pine Script v5. The clean-v5 step types the settings and moves when = into if blocks, which v6 requires; it is run before and after like any upgrade.
- No v6-only features. v6 is not needed to run this script.
Clean v5
VerifiedNothing to change.
Does it run in Pine Script v6?
No
The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L37:C47: 'plot' has no 'transp' parameter in Pine Script v6. Use color.new(color, transparency) instead. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.
⋯// © Powerscooter-//@version=5+//@version=6strategy("MVRV Z Score and MVRV Free Float Z-Score",shorttitle = "MVRV Z Score",precision=2,default_qty_type = strategy.cash, default_qty_value = 100, initial_capital = 100)⋯Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 19 ms | Yes 1,000 bars in 63 ms | Not measured |
| PineTS | Not tested | Not tested | Not measured |
“Matches TradingView” needs this script's own output exported from TradingView and compared bar by bar, which has not been done for this script. The engine is built on OpenPineScript, whose conformance results are in its conformance report.
Source
Copied verbatim from the author's published script, with its licence header intact. The author may have updated the original since this snapshot.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © Powerscooter//@version=5strategy("MVRV Z Score and MVRV Free Float Z-Score",shorttitle = "MVRV Z Score",precision=2,default_qty_type = strategy.cash, default_qty_value = 100, initial_capital = 100)//InputsStrategymode = input.bool(false,"Strategy Mode","Switches between indicator and strategy mode.")Calculation = input.string("Standard", "Calculation Method",options = ["Standard","Free Float"], tooltip = "The standard calculation uses the market cap while the free float version uses the free float market cap.")Source = input.string("Glassnode", "Market Cap Source",options = ["Glassnode","Coinmetrics"])Upper = input.float(7.0,"Upper Line",tooltip="Z-Score value above which a sell signal is given, standard is 7.")Lower = input.float(0.1,"Lower Line",tooltip="Z-Score value below which a buy signal is given, standard is 0.1.")//QueryMC1 = request.security("GLASSNODE:BTC_MARKETCAP","D",close)MC2 = request.security("CRYPTOCAP:BTC","D",close)MCF = request.security("COINMETRICS:BTC_MARKETCAPFF","D",close)MCR = request.security("COINMETRICS:BTC_MARKETCAPREAL","D",close)//Initialize varvar float MC = 0var MCA = array.new<float>()var float MVRV = 0var float Zscore = 0//Calculationsif Source=="Glassnode" MC := MC1else MC := MC2array.push(MCA,MC)StdDevA = array.stdev(MCA)if Calculation=="Standard" MVRV := MC/MCRif Calculation=="Free Float" MVRV := MCF/MCRif Calculation=="Standard" Zscore := (MC-MCR)/StdDevAif Calculation=="Free Float" Zscore := (MCF-MCR)/StdDevA//PlottingMVRVplot = plot(MVRV, "MVRV", color=color.blue,transp=40)Zplot = plot(Zscore, "Z-score",color=color.yellow,linewidth = 2)UpperLine = Zscore>=Upper?Upper:naLowerLine = Zscore<=Lower?Lower:na//Lower and UpperLine are undefined when Zscore isn't close to them so they don't affect panel scaling.UpperPlot = plot(UpperLine, transp=100, trackprice = true, color=color.red, display=display.all-display.status_line)LowerPlot = plot(LowerLine, transp=100, trackprice = true, color=color.green, display=display.all-display.status_line)fill(plot1=Zplot,plot2=UpperPlot,color=color.red, transp=30)fill(plot1=Zplot,plot2=LowerPlot,color=color.green, transp=30)//Order ConditionsLong = ta.crossunder(Zscore,Lower)TakeProfit = ta.crossover(Zscore,Upper)//Executionif Long and Strategymode strategy.entry("Long",strategy.long)if TakeProfit and Strategymode strategy.close("Long")