Adjust VWAP indicator
Forums › ProRealTime English forum › ProBuilder support › Adjust VWAP indicator
- This topic has 9 replies, 3 voices, and was last updated 5 years ago by
Vonasi.
-
-
12/23/2019 at 7:36 PM #115427
Hi team,
The big advantage with the regular VWAP indicator is that the price generated is the same on every time frame. However, this is not the case with the VWAP indicator of PRT. Is it possible to adjust the code below to show the same price on every time frame, or to write a new code for this indicator?
Thank you
PRT VWAP indicator12345678910111213//VWAPd = 20vw = volume*closevwsum = SUMMATION[d](vw)volsum = SUMMATION[d](volume)vwap = vwsum/volsum///////////////////////cc = customcloseRETURN vwap AS "VWAP" , cc as " customclose "12/28/2019 at 12:43 PM #115518Anybody? …….
All the guys who helped me multiple times before: #Grahal, #Nicolas, #robertogozzi, #Vonasi
12/28/2019 at 2:42 PM #115521I think they are all hungover Marcel !? 🙂
Might you be able to show screen shots of what you mean?
I copied and pasted the above indicator and from what I deduct the Price that shows for a respective Timeframe is the mid price for that Timeframe? Is that not what you would expect to get anyway??
- If you are on 1 min TF then over a 5 min period you would see 5 x mid prices?
- If you are on 5 min TF then over a 5 min period you would see 1 x mid price?
1 user thanked author for this post.
12/28/2019 at 2:53 PM #11552212/28/2019 at 3:12 PM #115523Is attached what you mean?
1st image is 5 min TF and 2nd image is 1 min TF.
They are different by 0.001 ??
1 user thanked author for this post.
12/28/2019 at 4:40 PM #115529The built in PRT indicator takes tick by tick data and calculates a moving average of price taking into account the volume of each tick. It does this either day by day or on a sliding period of x minutes.
As we cannot currently use multiple time frames in ProBuilder it is not possible to replicate the same thing.
12/28/2019 at 4:47 PM #115530I coded something a long time ago that detected what time frame chart we were using (I think Roberto has also coded something similar) so it might be possible to use that code and then set a period of x candles based on what time frame it detects. It probably wouldn’t match the built in VWAP exactly as on faster time frames missing candles will mess up the calculation as ProBuilder will still count missing candles as a candle!
1 user thanked author for this post.
12/29/2019 at 12:55 PM #115563Thanks for your help.
What I mean with the VWAP is that the price shows the same on every time frame the same as it does with the Tradestation code in the article included.
When I switch from the D1 to the H1 or H4 timeframe, Tradestation shows (almost) the same price for VWAP.
12/31/2019 at 11:57 AM #115648Hi Vonasi,
Will you please sent me your code, so I can adjust and build further on from that. If you don’t want it displayed in public, you can sent it to me in an email.
*******@gmail.com (Moderators edit: email address deleted)
Thank you.
12/31/2019 at 2:14 PM #115652You can find the chart time detection code here:
https://www.prorealcode.com/topic/determine-the-charts-time-frame-in-a-program/#post-105538
It is not advised to post your email address in the forums – I will delete it from your post.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on