PROTECTED SOURCE SCRIPT

M2 Global Liquidity Index - 10 Week Lead

134
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org/MPL/2.0/
// CalmMonkey
// Mik3Christ3ns3n's M2 Global Liquidity Index Moved forward 10 weeks.
// M2 Money Stock for CNY+USD+EUR+JPY+GBP

//version=6
indicator('M2 Global Liquidity Index - 10 Week Lead (4H)', overlay=false, scale=scale.left)

// Define offset in weeks
offset_weeks = 12

// Convert weeks to milliseconds (1 week = 7 days * 86400000 ms/day)
offset_ms = offset_weeks * 7 * 86400000

// --- 각 자산을 4시간봉(240분)으로 변경 ---
cnm2 = request.security("ECONOMICS:CNM2", "240", close)
cnyusd = request.security("FX_IDC:CNYUSD", "240", close)

usm2 = request.security("ECONOMICS:USM2", "240", close)

eum2 = request.security("ECONOMICS:EUM2", "240", close)
eurusd = request.security("FX:EURUSD", "240", close)

jpm2 = request.security("ECONOMICS:JPM2", "240", close)
jpyusd = request.security("FX_IDC:JPYUSD", "240", close)

gbm2 = request.security("ECONOMICS:GBM2", "240", close)
gbpusd = request.security("FX:GBPUSD", "240", close)

// --- 합산 ---
total = (cnm2 * cnyusd + usm2 + eum2 * eurusd + jpm2 * jpyusd + gbm2 * gbpusd) / 1000000000000

// Plot with the time offset (주 단위 오프셋 그대로 유지)
plot(total, color=color.yellow, linewidth=2, offset=offset_weeks * 7)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.