OPEN-SOURCE SCRIPT

Global Liquidity Index

//version=5
indicator('Global Liquidity Index', overlay=true, scale=scale.left)
fed_active = input(true, title = "FED (Federal Reserve System)")
tga_active = input(true, title = "TGA (Treasury General Account)")
rrp_active = input(true, title = "RRP (Reverse Repurchase Agreements)")
ecb_active = input(true, title = "ECB (European Central Bank)")
pbc_active = input(true, title = "PBC (People's Bank of China)")
boj_active = input(true, title = "BOJ (Bank of Japan)")
other_active = input(true, title = "Other Central Banks")
usa_active = input(false, title = "USM2 (USA Money Supply)")
europe_active = input(false, title = "EUM2 (Europe Money Supply)")
china_active = input(false, title = "CNM2 (China Money Supply)")
japan_active = input(false, title = "JPM2 (Japan Money Supply)")
other_m2_active = input(false, title = "Other Countries M2")
sma_input = input(defval = 1, title = "SMA Length")
roc_input = input(defval = 1, title = "ROC Length")
fed = fed_active ? request.security("USCBBS", "D", close, currency=currency.USD) : 0
rrp = rrp_active ? request.security("RRPONTSYD", "D", close, currency=currency.USD) : 0
tga = tga_active ? request.security("WTREGEN", "D", close, currency=currency.USD) : 0
ecb = ecb_active ? request.security("EUCBBS * EURUSD", "D", close, currency=currency.USD) : 0
pbc = pbc_active ? request.security("CNCBBS * CNYUSD", "D", close, currency=currency.USD) : 0
boj = boj_active ? request.security("JPCBBS * JPYUSD", "D", close, currency=currency.USD) : 0
boe = other_active ? request.security("GBCBBS * GBPUSD", "D", close, currency=currency.USD) : 0
boc = other_active ? request.security("CACBBS * CADUSD", "D", close, currency=currency.USD) : 0
rba = other_active ? request.security("AUCBBS * AUDUSD", "D", close, currency=currency.USD) : 0
rbi = other_active ? request.security("INCBBS * INRUSD", "D", close, currency=currency.USD) : 0
snb = other_active ? request.security("CHCBBS * CHFUSD", "D", close, currency=currency.USD) : 0
cbr = other_active ? request.security("RUCBBS * RUBUSD", "D", close, currency=currency.USD) : 0
bcb = other_active ? request.security("BRCBBS * BRLUSD", "D", close, currency=currency.USD) : 0
bok = other_active ? request.security("KRCBBS * KRWUSD", "D", close, currency=currency.USD) : 0
rbzn = other_active ? request.security("NZCBBS * NZDUSD", "D", close, currency=currency.USD) : 0
sr = other_active ? request.security("SECBBS * SEKUSD", "D", close, currency=currency.USD) : 0
bnm = other_active ? request.security("MYCBBS * MYRUSD", "D", close, currency=currency.USD) : 0
usa = usa_active ? request.security("ECONOMICS:USM2", "D", close, currency=currency.USD) : 0
eu = europe_active ? request.security("ECONOMICS:EUM2 * EURUSD", "D", close, currency=currency.USD) : 0
china = china_active ? request.security("ECONOMICS:CNM2 * CNYUSD", "D", close, currency=currency.USD) : 0
japan = japan_active ? request.security("ECONOMICS:JPM2 * JPYUSD", "D", close, currency=currency.USD) : 0
uk = other_m2_active ? request.security("ECONOMICS:GBM2 * GBPUSD", "D", close, currency=currency.USD) : 0
canada = other_m2_active ? request.security("ECONOMICS:CAM2 * CADUSD", "D", close, currency=currency.USD) : 0
australia = other_m2_active ? request.security("ECONOMICS:AUM3 * AUDUSD", "D", close, currency=currency.USD) : 0
india = other_m2_active ? request.security("ECONOMICS:INM2 * INRUSD", "D", close, currency=currency.USD) : 0
switzerland = other_m2_active ? request.security("ECONOMICS:CHM2 * CHFUSD", "D", close, currency=currency.USD) : 0
russia = other_m2_active ? request.security("ECONOMICS:RUM2 * RUBUSD", "D", close, currency=currency.USD) : 0
brazil = other_m2_active ? request.security("ECONOMICS:BRM2 * BRLUSD", "D", close, currency=currency.USD) : 0
korea = other_m2_active ? request.security("ECONOMICS:KRM2 * KRWUSD", "D", close, currency=currency.USD) : 0
mexico = other_m2_active ? request.security("ECONOMICS:MXM2 * MXNUSD", "D", close, currency=currency.USD) : 0
indonesia = other_m2_active ? request.security("ECONOMICS:IDM2 * IDRUSD", "D", close, currency=currency.USD) : 0
africa = other_m2_active ? request.security("ECONOMICS:ZAM2 * ZARUSD", "D", close, currency=currency.USD) : 0
malaysia = other_m2_active ? request.security("ECONOMICS:MYM2 * MYRUSD", "D", close, currency=currency.USD) : 0
sweden = other_m2_active ? request.security("ECONOMICS:SEM2 * SEKUSD", "D", close, currency=currency.USD) : 0
total = (fed - rrp - tga + boj + pbc + boe + ecb + rbi + boc + rba + snb + cbr + bcb + bok + rbzn + sr + bnm + usa + eu + china + japan + uk + canada + australia + india + switzerland + russia + brazil + korea + mexico + indonesia + africa + malaysia + sweden) / 1000000000000
sma = ta.sma(total, sma_input)
roc = ta.roc(total, roc_input)
sma_roc = ta.sma(roc, sma_input)
iff = roc_input > 1 ? true : false
roc_sma = iff ? sma_roc : sma
plot(roc_sma, color=color.yellow, linewidth=2)
Breadth Indicators

Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Хотите использовать этот скрипт на графике?

Отказ от ответственности