Thanks for your great work on the VWAP. I have a question that is maybe a little off-topic but I see you reset the VWAP at the beginning of the session. If I would like to do that for any other indicator does it need a change of code in the indicator itself or can I arrange it from the strategy too?
I was thinking of resetting the first bar of session to become the first bar but I don't blieve that's possible.
Most of the indicators use a fixed lookback period. If you have a look at the VWMA, this is essentially the same as the VWAP, but there is a difference
-> the VWMA always calculates a value from the last N bars (N is fixed)
-> the VWAP calculates a value from all bars since the session start (the number of bars is variable and increases by one with every bar until the end of the session)
This needs to be coded. Best use a recursive formula to avoid to go back until the beginning of the session with each incoming tick.
The following user says Thank You to Fat Tails for this post: