BTC NVM Ratio - Onchain Analysis
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © MJShahsavar

//@version=5
indicator("NVM Ratio",  timeframe = "W")
R = input.symbol("BTC_MARKETCAP", "Symbol")
r = request.security(R, 'D', close)
S=input.symbol("BTC_ACTIVEADDRESSES", "Symbol")
s = request.security(S, 'D', close)
A= math.log10 (r)
b= s*s
B= math.log10 (b)
C= A/B
D = ta.sma(C, 7)
E= ta.sma(C, 100)
plot (D, color = D>= E ? color.red : color.blue, linewidth=1)
plot (E, color = D >= E ? color.red : color.blue, linewidth=3)
