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.
VWAP, anyone?
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: VWAP, anyone?
This is not possible in MC .NET, but will be added in MC 9.0 (source).(...)
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.
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: VWAP, anyone?
For some reason MC coded a VWAP study that resets based on date and time which I could never understood.Could you please summarize how your request is different than the built-in VWAP tool?
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.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: VWAP, anyone?
Here is a non-reset VWAP code.
- Attachments
-
- vwap_non_reset.pln
- (1.7 KiB) Downloaded 1468 times
Re: VWAP, anyone?
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.
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
- (103.25 KiB) Downloaded 3088 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: VWAP, anyone?
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.
Please right click on your chart->Format indicators->Format->Properties tab->Max number of bars study will reference:User specified – set it to 1.
Re: VWAP, anyone?
Thank you very much, Henry. This works very well. I am impressed. Appreciate your help.
Re: VWAP, anyone?
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?
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?