Jxmmy2x
Pine Script Rookie
Pine Script Rookie
Posts: 1
Joined: February 28th, 2022

How to make a cumulative line indicator

Need help or any tips to making an indicator plot the DIFFERENCE between the previous day close to the current day open on the daily timeframe???? Any help would be appreciated.

chooka
Pine Script Master
Pine Script Master
Posts: 18
Joined: February 7th, 2022

Re: How to make a cumulative line indicator

Hey there,

Something like this might do the trick?

Code: Select all

//@version=5
indicator("Prev_Day_Close",overlay=false)

prev_day_close = request.security(syminfo.ticker,"1D",close[1])
curr_day_open = request.security(syminfo.ticker,"1D",open[0])

difference = curr_day_open - prev_day_close
plot(difference)

Return to “Pine Script Q&A”