Determine the correlation of your selected chart to USOIL.
Inputs for Resolution and Time Frame available from the Format menu of the indicator.
Inputs for Resolution and Time Frame available from the Format menu of the indicator.
//@version=2 study("4x4_USOIL correlation",shorttitle="USOIL Corr.") res=input(defval="D",type=resolution) length=input(defval=20,minval=2,type=integer,step=1) s1=security(tickerid,res, close[0]) s2=security("USOIL",res, close[0]) cor=correlation(s1,s2,length) plot(cor,color=blue,linewidth=3,transp=0,title="corr") hline(.90,linewidth=3) hline(0.0,linewidth=3) hline(-.90,linewidth=3)