VWAP, anyone?

User avatar
arnie
Posts: 1589
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 478 times
Been thanked: 509 times

VWAP, anyone?

Postby arnie » 09 Feb 2014

Does anyone here thought coding a VWAP study?
Is it possible to convert this EL study to .NET?
viewtopic.php?f=5&t=16154

When I posted that study I forgot to include an input for calculation method.
It would be nice to change the method between close and average price.

Also, I have it only for RTH session (date <> date[1]) but it would be preferable to have it recognizing the session template. In EL there's a function for it "CurrentSession" (currentsession<>currentsession[1]), don't know if there's one for .NET.
Recognizing the session template allow to have the study available for RTH and ETH sessions.

MidKnight
Posts: 343
Joined: 12 Aug 2012
Has thanked: 123 times
Been thanked: 56 times

Re: VWAP, anyone?

Postby MidKnight » 02 Mar 2014

Could you please summarize how your request is different than the built-in VWAP tool?

User avatar
JoshM
Posts: 2089
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1525 times
Been thanked: 1485 times
Contact:

Re: VWAP, anyone?

Postby JoshM » 03 Mar 2014

arnie wrote:(...)
Also, I have it only for RTH session (date <> date[1]) but it would be preferable to have it recognizing the session template. In EL there's a function for it "CurrentSession" (currentsession<>currentsession[1]), don't know if there's one for .NET.
Recognizing the session template allow to have the study available for RTH and ETH sessions.

This is not possible in MC .NET, but will be added in MC 9.0 (source).
These users thanked the author JoshM for the post:
arnie

User avatar
arnie
Posts: 1589
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 478 times
Been thanked: 509 times

Re: VWAP, anyone?

Postby arnie » 03 Mar 2014

MidKnight wrote:Could you please summarize how your request is different than the built-in VWAP tool?


For some reason MC coded a VWAP study that resets based on date and time which I could never understood.

I know that if we set all 5 time imputs with the same date we get the real VWAP for the day but all those time and date resets is beyond my understading. Initially I thought we could set a initial day and an end day for the calculation which would allow to build custom VWAP periods but that's not the case.

A simple VWAP study just plots de VWAP for the day, with the 5 standard deviations so we can have it's bands and that's it.

I have an image posted on the link I gave above.
These users thanked the author arnie for the post:
dtl-saw

User avatar
Henry MultiСharts
Posts: 8508
Joined: 25 Aug 2011
Has thanked: 1213 times
Been thanked: 2733 times

Re: VWAP, anyone?

Postby Henry MultiСharts » 13 Mar 2014

Here is a non-reset VWAP code.
Attachments
vwap_non_reset.pln
(1.7 KiB) Downloaded 574 times
These users thanked the author Henry MultiСharts for the post (total 3):
MidKnightdtl-sawdarkah123

darkah123
Posts: 2
Joined: 14 Apr 2014
Has thanked: 2 times

Re: VWAP, anyone?

Postby darkah123 » 14 Apr 2014

Thank you very much, Henry. This is exactly what we needed. However, there is one issue, though. This is the case with both VWAP_non_reset, as posted above, and VWAP_reset, which is present among MC's default studies. The problem is that when these are applied to chart, they do not start calculation from the first bar, however rather from the 7th bar. This is the case across different resolutions. For example, I have setup a 1 minute/1day chart and applied VWAP_non_reset. As you can see in the attached picture, the first VWAP data point appears on the 7th bar/candle. Why is this? This is actually a problem, as the first 6 bars are not taken into account. If there is a volatile move in the first 6 minutes, the VWAP for the whole day would be skwed. I have also compared this to other platforms, where the same VWAP, however from the first bar, is available and there is a significant different between the VWAP values throughout the day, if the first 6 minutes are volatile.

Would it be possible to fix this and have the VWAP start calculate from the first bar/candle?

Thank you.
Attachments
VWAP_non_reset.PNG
VWAP_non_reset.PNG (103.25 KiB) Viewed 1676 times

User avatar
Henry MultiСharts
Posts: 8508
Joined: 25 Aug 2011
Has thanked: 1213 times
Been thanked: 2733 times

Re: VWAP, anyone?

Postby Henry MultiСharts » 15 Apr 2014

Hello darkah123,

Please right click on your chart->Format indicators->Format->Properties tab->Max number of bars study will reference:User specified – set it to 1.
These users thanked the author Henry MultiСharts for the post:
darkah123

darkah123
Posts: 2
Joined: 14 Apr 2014
Has thanked: 2 times

Re: VWAP, anyone?

Postby darkah123 » 15 Apr 2014

Thank you very much, Henry. This works very well. I am impressed. Appreciate your help.

Gubbar924
Posts: 4
Joined: 12 Mar 2015

Re: VWAP, anyone?

Postby Gubbar924 » 29 May 2015

Hello, were you guys able to get this indicator to work? I tried it on a couple of charts (of ES), and the value of this plot is all the way down at 2088.25


EDIT:
I just realized that this value of vwap is based off a larger timeframe and thats why it seems so far intraday. Is there a way to make this indicator use the chart's period as the source timeframe and have it 1 continuous line that does not reset every session/day?


Return to “User Contributed Studies”