@krishna2509, I am not sure how to script it to get rid of the historical data. I just find things in scripts and put them together to try to create what I want and I couldnt figure that out. I did just publish a script for a weekly version for you linked below. But all you have to do is change all the 'D' in the section below to 'W' and it will work for weekly. You could also do monthly by putting a 'M'.
@syracusepro, The chart is of the SPY on a 15 min. time frame but this script can be used with any intraday time frame. The script plots lines for the current day open, previous day high, previous day low, and previous day close. The overnight gap is highlighted red or green depending on if it was a gap up or gap down. Hope that helps.
Trang web này sử dụng cookie để đảm bảo bạn có được trải nghiệm tốt nhất trên trang web của chúng tôi. Để tìm hiểu thêm về cookie, bao gồm cách kiểm soát cookie, vui lòng đọc Chính sách cookie của chúng tôi.
//Current Open/Previous High,Low,Close
cdo = security(tickerid, 'D', open)
pdc = security(tickerid, 'D', close)
pdh = security(tickerid, 'D', high)
pdl = security(tickerid, 'D', low)
plot(pdc, title="Prev Close", style=line, linewidth=1, color=closecolour,show_last=1, trackprice=true, offset=offset_val)
show_last =1 is the key here.