Nifty yield curve
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © aftabmk

//@version=4
study("yeild curve")
//ad() =>sign(close - close[1])
m1 = nz(security("TVC:IN10Y", timeframe.period,close))
m2 = nz(security("TVC:IN03MY", timeframe.period,close))
m3=(m1-m2)

u1 = nz(security("TVC:US10Y", timeframe.period,close))
u2 = nz(security("TVC:US03MY", timeframe.period,close))
u3=(u1-u2)


plot(m3,title="Indian yield curve",color=color.new(color.teal,20), linewidth=3)
plot(u3,title="US yield curve",color=color.new(color.yellow,20), linewidth=3)
hline(0)

colorin = m3<0 ? color.teal : na
colorus = u3<0 ? color.yellow : na
bgcolor(colorus)
bgcolor(colorin)
