OPEN-SOURCE SCRIPT
Bitcoin Macro Fair Value [Structural]

//version=6
indicator("Bitcoin Macro Fair Value [Structural]", overlay=true)
// --- Model Coefficients (Derived from Python Analysis 2019-2025) ---
intercept = input.float(3.156434, "Intercept")
c_m2 = input.float(0.132827, "Real M2 Coef")
c_corp = input.float(0.742593, "Corp Spread Coef")
c_hy = input.float(-0.617968, "HY Spread Coef")
c_dxy = input.float(0.009772, "DXY Coef")
c_real30 = input.float(0.713311, "Real 30Y Coef")
c_be30 = input.float(-1.059273, "Breakeven 30Y Coef")
c_slope = input.float(0.402220, "Slope 10Y-2Y Coef")
// --- Data Fetching ---
m2 = request.security("FRED:M2SL", "M", close)
cpi = request.security("FRED:CPIAUCSL", "M", close)
real_m2 = m2 / cpi
corp = request.security("FRED:BAMLC0A0CM", "D", close)
hy = request.security("FRED:BAMLH0A0HYM2", "D", close)
dxy = request.security("TVC:DXY", "D", close)
real30 = request.security("FRED:DFII30", "D", close)
nom30 = request.security("FRED:DGS30", "D", close)
be30 = nom30 - real30
nom10 = request.security("FRED:DGS10", "D", close)
nom2 = request.security("FRED:DGS2", "D", close)
slope = nom10 - nom2
// --- Calculation ---
log_fv = intercept + (c_m2 * real_m2) + (c_corp * corp) + (c_hy * hy) + (c_dxy * dxy) + (c_real30 * real30) + (c_be30 * be30) + (c_slope * slope)
fair_value = math.exp(log_fv)
plot(fair_value, "Macro Fair Value", color=color.new(color.blue, 0), linewidth=2)
indicator("Bitcoin Macro Fair Value [Structural]", overlay=true)
// --- Model Coefficients (Derived from Python Analysis 2019-2025) ---
intercept = input.float(3.156434, "Intercept")
c_m2 = input.float(0.132827, "Real M2 Coef")
c_corp = input.float(0.742593, "Corp Spread Coef")
c_hy = input.float(-0.617968, "HY Spread Coef")
c_dxy = input.float(0.009772, "DXY Coef")
c_real30 = input.float(0.713311, "Real 30Y Coef")
c_be30 = input.float(-1.059273, "Breakeven 30Y Coef")
c_slope = input.float(0.402220, "Slope 10Y-2Y Coef")
// --- Data Fetching ---
m2 = request.security("FRED:M2SL", "M", close)
cpi = request.security("FRED:CPIAUCSL", "M", close)
real_m2 = m2 / cpi
corp = request.security("FRED:BAMLC0A0CM", "D", close)
hy = request.security("FRED:BAMLH0A0HYM2", "D", close)
dxy = request.security("TVC:DXY", "D", close)
real30 = request.security("FRED:DFII30", "D", close)
nom30 = request.security("FRED:DGS30", "D", close)
be30 = nom30 - real30
nom10 = request.security("FRED:DGS10", "D", close)
nom2 = request.security("FRED:DGS2", "D", close)
slope = nom10 - nom2
// --- Calculation ---
log_fv = intercept + (c_m2 * real_m2) + (c_corp * corp) + (c_hy * hy) + (c_dxy * dxy) + (c_real30 * real30) + (c_be30 * be30) + (c_slope * slope)
fair_value = math.exp(log_fv)
plot(fair_value, "Macro Fair Value", color=color.new(color.blue, 0), linewidth=2)
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının yaratıcısı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının yaratıcısı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.