투자_주식 그리고 가상화폐/투자 메뉴얼

김치 프리미엄 보조 지표(트레이딩뷰 pine에디터에 붙여넣기)

CallManager 2023. 11. 21. 22:56
study("KIMCHI PREMIUM of BTC(KRWUSD)", "KIMCHI of BTC", false)


btckrw_b = security("BITHUMB:BTCKRW", period, close)
btcusd_b = security("BINANCE:BTCUSDT", period, close)
usdkrw = security("FX_IDC:USDKRW", period, close)
premium = (btckrw_b /usdkrw  / btcusd_b - 1.0) * 100

 

bgcolor = premium < 0 ? navy : premium < 10 ? blue : premium < 20 ? green : premium < 30 ? yellow : premium < 40 ? orange : premium < 50 ? red : premium < 100 ? maroon : na

//bgcolor(bgcolor, 50)
//hline( 0,linestyle=dotted, "0")
hline(0, title="0", linestyle=dotted, linewidth=1, color=gray)
//hline(+0, "5")
linecolor = premium <-4 ? navy : premium < -2 ? blue : premium < 0 ? green : premium < 2 ? orange : premium < 4 ? red : premium < 6 ? maroon : premium < 8 ? black : maroon
plot(premium, "Premium", linecolor, 2)
반응형