Reputation: 11
Is there an easy way to reference volume on a different time frame?
For example if i'm on the daily time frame, but I want my indicator to reference the weekly volume (not the cumulative volume from the past 5 days)?
Upvotes: 1
Views: 1467
Reputation: 174
To have more flexiblility you could use inputs for the desired timeframe and symbol, like so...
res = input(title="Resolution", type=input.resolution, defval="W")
sym = input(title="Symbol", type=input.symbol, defval="EURUSD")
vol = security(sym, res, volume)
Upvotes: 1