Code:
study(title="Smart Money Index (SMI)", shorttitle="Smart Money Index")
xcloseH1 = security(tickerid, "60", close)
xopenH1 = security(tickerid, "60", open)
nRes = nz(nRes[1], 1) - (open - close) + (xopenH1 - xcloseH1)
plot(nRes, color=green, title="SMI")