gb50k

After Hours vs Intra Day

37
latest and IMPROVED:
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
study(shorttitle="AfterHours vs IntraDay", title="AfterHours vs IntraDayD", overlay=true)
//
//Works only on DAILY CHARTS
//Blue line is intraday contribution
//Black line is overnight gap

length = input(20, minval=1)
src = input(close, title="Source")
sro = input(open, title="Source")
src1 = src[1]
intrad=src-sro
co=cum(intrad)
AH=sro-src1
oc1=cum(AH)
summ=co+oc1
offst=src[0]-summ[0]
plot(co+offst, color=blue)
plot(oc1+offst, color=black)
//plot(co+oc1+offst, color=red)