TradingView
vnhilton
21 ינו׳ 2023 01:27

VWAP Boulevard [vnhilton] 

Kiora Pharmaceuticals, Inc.NASDAQ

תיאור

(OVERVIEW)
The idea of this indicator comes from traders identifying supply to mainly look for shorts. Scenarios would be gap ups or pump & dumps where huge volume is transacted, & bag-holders are present. Some traders would draw resistance lines, I myself used to draw supply zones using the volume profile on that day, & others used the day VWAP on those days. VWAP Boulevard (I believe the name comes from the trader named team3dstocks) draws day VWAP lines from the highest volume days for a given period (excluding the current day).

(FEATURES)
- Draws horizontal & vertical lines from up to 250 highest volume days out of up to 3568 days, with the ability to hide either of these lines, their thicknesses, styles
- Extend/cut horizontal lines, or extend them all the way to the right
- Show the day VWAP, volume & age for these days in labels, with the ability to show what information you want to see only
- Separate customizable color forms for the lines & labels - ordinary (1 color); volume (2 color gradient from lowest to highest volume of the highest volume days); age (2 color gradient from youngest to oldest volume of the highest volume days)
- Edit offset & size of labels, & hide them
- Hide vertical lines


From left to right: Age color; ordinary color; volume color


250 highest volume days in the past year. Very messy so it's very likely you won't be using this but the ability to draw lines from 250 highest volume days is there if needed

(DRAWDOWNS)
- This indicator will only on the daily timeframe (error message will show up if unaware of this, & can be toggled off). Unfortunately, this would mean you would have to draw the lines manually yourself if you wish to use them on intraday timeframes.
- You may also encounter the 'Pine cannot determine the referencing length of a series. Try using max_bars_back' error. This occurs when the lookback period is very high & the indicator attempts to recalculate I believe. If this happens then reload the indicator.

The logic I used to obtain the highest volume days were to put all of the volume days in a given period in 1 array, then to sort them from highest to lowest, & also store their sorted indices in an separate array as well, so that drawings for each volume day could be done from the 2 arrays.

//Volume for last N periods var int [] pastVol = array.new_int(lookbackPeriodFixed) for i = 0 to lookbackPeriodFixed - 1 array.set(pastVol, i, int(volume[i + 1])) sortedIndices = array.sort_indices(pastVol, order.descending) //All Indices of sorted volume from highest to lowest sortedIndices2 = array.slice(sortedIndices, 0, highestVolDays) //Indices of sorted volume from highest to lowest array.sort(pastVol, order.descending) //All Volume sorted from highest to lowest pastVol2 = array.slice(pastVol, 0, highestVolDays) //Volume sorted from highest to lowest //Drawings for i = 0 to highestVolDays - 1 index := array.get(sortedIndices, i) vol := array.get(pastVol, i)


Since these array sizes were determined from the lookback period, it would mean that the request.security() function used to obtain daily values on intraday timeframes wouldn't work for a lookback period >20 (20 * 2 values I believe, which are the day VWAP & the day volume) as TradingView has put a maximum amount of calls of 40 in 1 script. Therefore, for intraday plots to work I would have to change the logic for getting the day VWAP & day volume for the highest days, as the request.security() function doesn't work on for loops, & this would also mean that the user would only be able to draw lines from up to 20 highest volume days instead of 250. I couldn't go forward with this as I wasn't able to find the logic to pick the highest volume days & their day VWAPs & times (indexes) without using a for loop. If anyone has any solutions (including for the 'Pine cannot determine the referencing length of a series. Try using max_bars_back' error) then please let me know. I've also left commented-out code for dealing with intraday drawings for future use.

הערות שחרור

-Added minimum volume filter which will exclude days that have less volume than the value set by the user.


Left shows indicator showcasing 10 highest volume days in the past year with no minimum volume filter. Right shows indicator with the same settings as shown on Left, but with minimum volume filter of 5000000. (Note colors don't update since I haven't coded the solution to that problem. [lazy])

הערות שחרור

- Added format.volume to display volume in a clear way e.g. 5,600,000 into 5.6M

הערות שחרור

- Fixed minor issue regarding volume formatting.
תגובות
TMK2
Hi, @vnhilton.

Great script! May I please request a small, visual tweak?

Would you be able to add comma separators to the volume figures, so that a volume like 123456789 could be read as 123,456,789? It would make reading the volume values so much easier.
Either that or being able to read 123456789 as 123.46M?

Looking forward to hearing your thoughts.
vnhilton
@TMK2, Done, please update script.
TMK2
@vnhilton, thank you
Blueprintsud
is there a way to make it work here i can pick the time frame ? i would love it to work on lower time frame
vnhilton
@Blueprintsud, see my reply to vensonom
vensonom
Any way i can me this intraday ? Would like to see boulevards of last 4 high volume bars in a 30 bar lookback
vnhilton
@vensonom, i believe TheVWAP has a boulevard script that does this for you, except only plots 3 lines. I wouldn't update this script to provide that function as that wouldn't be considered a day VWAP boulevard, rather, a line projecting from highest volume from a bar. Fortunately, all you have to do is copy & paste the Main code, & modify part of the if statement timeframe.isdaily -> timeframe.isintraday. Then the code where you plot the lines & labels, instead of plotting it at intraday or day VWAP for the y-axis, you would plot from e.g. hlc3 or ohlc4 of that bar (add an input to start of script for choice). Modify labels & others accordingly (daily to intraday). Hope this helps.
JMF_Tattoo
@vnhilton, Yes, We offer one that looks back bar by bar. I have multiple versions that plot up to 40 lines. I and RumpyPumpyDumpy are the creators of the scripts. If you need an intraday version feel free to dm me.
JMF_Tattoo
@vnhilton, I have about 100 different variations of the BLVD scripts. Intraday, weekly, 1 line, 100 lines, Heat map zones, Profiles, etc.
עוד