vwap previous close line
Forums › ProRealTime English forum › ProBuilder support › vwap previous close line
- This topic has 11 replies, 2 voices, and was last updated 3 years ago by keks.
-
-
10/15/2021 at 2:03 PM #179739
Hi, I would like to draw a horizontal line on the intraday chart that represents last observed daily vwap level of previous session of trading. So in essense:
line1 = dclose(1)
return line1 coloured(255,255,255)Except I do not want dclose, instead want to see where daily vwap was at close previous session. Would anyone PLEASE let me know how I can create this?
THANKS!!
10/15/2021 at 2:18 PM #179740There you go:
123456Timeframe(Daily,UpdateOnClose)if volume > 0 thenVWAP = (volume * typicalprice)endifTimeframe(default)return VWAP AS "Daily VWAP"1 user thanked author for this post.
10/15/2021 at 3:28 PM #17974310/15/2021 at 3:36 PM #17974410/15/2021 at 3:51 PM #179746in the attached pic the green is daily vwap, red is the code above… ideally i would like the red line to extend from where green on ends on previous day. strategy under development will build signals based on whether price remains above previous day vwap….
10/15/2021 at 3:56 PM #179748I am not getting any error with both of them.
Anyhow, you are NOT calculating VWAP, your code simply returns TypicalPrice.
1 user thanked author for this post.
10/15/2021 at 4:02 PM #179751I also got the error message now. I think it’s due to the high number involved summing up they daily volume*typicalprice for the intradaybarindex.
10/15/2021 at 4:05 PM #179752would it be easier/less calc to use last observed vwap level of previous session instead of calculating? In other words previous session daily vwap close… seem to be an lighter way to accomplish this however I am not sure how to code this
10/15/2021 at 5:30 PM #17975410/18/2021 at 7:57 AM #179838thanks again.
would you be chance be willing to help me specify time interval of previous day session for the vwap calculation line to be based off?
For example, let us assume I want to use index futures previous day vwap level during ordinary trading session only as an indicator on the following day trading session…
10/18/2021 at 8:21 AM #179841To make it work in a time interval the daily timeframe can’t be used.
The code you wrote is almost correct, provided the TIMEFRAME keyword is removed. Then a time interval must be added:
1234567891011ONCE d = 0if volume > 0 thenIF intradaybarindex = 0 THENd = 0ENDIFIF Time >= 080000 AND Time <= 180000 THENd = d + 1VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)ENDIFendifreturn VWAP AS “Daily VWAP”1 user thanked author for this post.
10/18/2021 at 2:09 PM #179871thanks so much for taking the time to update this code. Still this does not seem to give me a horizontal line marking previous end of session vwap level….
the reason I like having this drawn is many of the securities I follow seem to trade differently based on whether they are above or below previous session vwap…
I will try to figure out how to get an accurate line drawn using clues from your code, but so far still not where I would like to be!
-
AuthorPosts
Find exclusive trading pro-tools on