CaptainBluebear
CaptainBluebear

Reputation: 11

PineScript - Monthly / Weekly Volume on Daily timeframe

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

Answers (2)

paaax
paaax

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

CaptainBluebear
CaptainBluebear

Reputation: 11

security(syminfo.tickerid, "W", volume)

Upvotes: 0

Related Questions