Variables
session.date
The date of the session the current bar falls in. Session values are series, not simple: this one changes as your script moves through bars.
Example
indicator("Session-based CVD (Fixed)", overlay=false)
// Persistent variable
static customCVD = 0
isNewSession = session.date != session.date[1]
// Reset on new session, accumulate otherwise
customCVD := isNewSession ? 0 : customCVD + orderflow.delta
plot(customCVD, title="Session CVD", style=plotStyle.line, color=color.orange)
Type
series string