use on 1 or 2 min spx500
//@version=2 // works best on 1 or 2 min time frame study("esspx") n1=input(30,"ema1") n2=input(120,"ema2") sb=security("spx500" ,period , hl2 ) db=security("es1!" ,period , hl2 ) c=1000*db/sb ao = sma(c,n1) - sma(c,n2) plot(ao, color = change(ao) <= 0 ? green : green, style=histogram,linewidth=3)