High Volume Day – VWAP lines
Forums › ProRealTime English forum › ProBuilder support › High Volume Day – VWAP lines
- This topic has 4 replies, 2 voices, and was last updated 2 months ago by trwcapital.
-
-
09/26/2024 at 2:07 PM #238074
I’m trying to create an indicator that looks back x number of bars on the daily chart for days where volume exceeded y threshold, or just identify the top 3-5 volume days and then draws a horizontal line on the daily chart that also displays on inferior timeframes. A bonus would be to add text to the line for the date and shares traded on that day. Any help would be appreciated.
09/26/2024 at 4:22 PM #238081There you go:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051DEFPARAM DrawOnLastBarOnly = trueBars = 50Treshold = 50000Vol1 = 0Vol2 = 0Vol3 = 0Bar1 = 0Bar2 = 0Bar3 = 0FOR i = 0 TO (Bars - 1)IF Volume[i] > Treshold THENIF (Volume[i] > Vol3) THENVol1 = Vol2Bar1 = Bar2Vol2 = Vol3Bar2 = Bar3Vol3 = volume[i]Bar3 = iELSIF Volume[i] > Vol2 THENVol1 = Vol2Bar1 = Bar2Vol2 = volume[i]Bar2 = iELSIF Volume[i] > Vol1 THENVol1 = volume[i]Bar1 = iENDIFENDIFNEXTIF Vol1 THENyy = OpenYear[Bar1] MOD 100 //drop Centturymm = OpenMonth[Bar1]dd = OpenDay[Bar1]Offset = highest[Bars](high) + range*0.5DrawText("#yy##mm##dd#v#Vol1#",BarIndex[Bar1],offset)ENDIFIF Vol2 THENyy = OpenYear[Bar2] MOD 100 //drop Centturymm = OpenMonth[Bar2]dd = OpenDay[Bar2]Offset = highest[Bars](high) + range*1DrawText("#yy##mm##dd#v#Vol2#",BarIndex[Bar2],offset)ENDIFIF Vol3 THENyy = OpenYear[Bar3] MOD 100 //drop Centturymm = OpenMonth[Bar3]dd = OpenDay[Bar3]Offset = highest[Bars](high) + range*1.5DrawText("#yy##mm##dd#v#Vol3#",BarIndex[Bar3],offset)ENDIFRETURNIt only prints some text for the highest 3 volume values > treshold in the last BARS periods, where exactly do you want the lines to be plotted?
2 users thanked author for this post.
09/26/2024 at 4:27 PM #238083All graphical objects and text are only visible on the chart where the indicator has been added. Only PRT tools can plot objects than can be made visible in other timeframes.
1 user thanked author for this post.
09/27/2024 at 12:52 AM #238111This is great. I want the horizontal line to be drawn at the Typical Price on the identified days. I use this more on small cap stocks that trade wildly varying amounts of volume. By identifying where the “VWAP” (or typical price) is on prior high volume days, it helps me to identify where supply might come into play.
Thank you!
09/27/2024 at 3:03 AM #23811212345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061DEFPARAM DrawOnLastBarOnly = trueBars = 504Threshold = 1000000Vol1 = 0Vol2 = 0Vol3 = 0Bar1 = 0Bar2 = 0Bar3 = 0FOR i = 0 TO (Bars - 1)IF Volume[i] > Threshold THENIF (Volume[i] > Vol3) THENVol1 = Vol2Bar1 = Bar2Vol2 = Vol3Bar2 = Bar3Vol3 = volume[i]Bar3 = iELSIF Volume[i] > Vol2 THENVol1 = Vol2Bar1 = Bar2Vol2 = volume[i]Bar2 = iELSIF Volume[i] > Vol1 THENVol1 = volume[i]Bar1 = iENDIFENDIFNEXT// Handle Bar1IF Vol1 THENyy = OpenYear[Bar1] MOD 100 // Drop centurymm = OpenMonth[Bar1]dd = OpenDay[Bar1]Offset = ((DLow(Bar1) + DHigh(Bar1) + DClose(Bar1)) / 3) + ((DHigh(Bar1) - DLow(Bar1)) / 8)DrawText("#mm#/#dd#/#yy#- #Vol1#", BarIndex[Bar1] - 15, Offset) ANCHOR(left, INDEX, VALUE)DRAWHLINE((DLow(Bar1) + DHigh(Bar1) + DClose(Bar1)) / 3)ENDIF// Handle Bar2IF Vol2 THENyy = OpenYear[Bar2] MOD 100 // Drop centurymm = OpenMonth[Bar2]dd = OpenDay[Bar2]Offset = ((DLow(Bar2) + DHigh(Bar2) + DClose(Bar2)) / 3) + ((DHigh(Bar2) - DLow(Bar2)) / 8)DrawText("#mm#/#dd#/#yy#- #Vol2#", BarIndex[Bar2] - 15, Offset) ANCHOR(left, INDEX, VALUE)DRAWHLINE((DLow(Bar2) + DHigh(Bar2) + DClose(Bar2)) / 3)ENDIF// Handle Bar3IF Vol3 THENyy = OpenYear[Bar3] MOD 100 // Drop centurymm = OpenMonth[Bar3]dd = OpenDay[Bar3]Offset = ((DLow(Bar3) + DHigh(Bar3) + DClose(Bar3)) / 3) + ((DHigh(Bar3) - DLow(Bar3)) / 8)DrawText("#mm#/#dd#/#yy#- #Vol3#", BarIndex[Bar3] - 15, Offset) ANCHOR(left, INDEX, VALUE)DRAWHLINE((DLow(Bar3) + DHigh(Bar3) + DClose(Bar3)) / 3)ENDIFRETURNMade a few changes and will probably continue to tweak but you helped immensely. Thank you
1 user thanked author for this post.
-
AuthorPosts