How to code VWAP strategy?

How to code VWAP strategy?

e.g. buy if a 5 min candle crosses above VWAP or sell if crosses below

which keyword to use VWAP or VWAP series? Give some example.

Hi, Really not sure on how both keyword work but definately know what works.

  1. Position (Close, -1) > position(VWAP Series, -1) works for last candle and you can define timeframe in Symbol.
  2. position(Cross(1,2) works - i.e. 1st(CLOSE) CROSS 2nd (VWAP Series), more info on https://www.youtube.com/watch?v=Ujy3PIhRIxQ

Maybe TT team can answer on VWAP keyword. Hope this helps. Thanks

1 Like

Position- CROSS- Close(-1), vwap series(-1)

Or u can use,
Close(-1) > vwap series(-1)
and
Close(-2) < vwap series(-2)

2 Likes

I tried the second method but its not working.