VWAP Boulevard [vnhilton]

vnhilton Pro+ 업데이트됨   
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).

- 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

- 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.

//[__tag__=volume]Volume[/__tag__] 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 [__tag__=volume]volume[/__tag__] from highest to lowest
    sortedIndices2 = array.slice(sortedIndices, 0, highestVolDays)  //Indices of sorted [__tag__=volume]volume[/__tag__] from highest to lowest

    array.sort(pastVol, order.descending)                           //All [__tag__=volume]Volume[/__tag__] sorted from highest to lowest
    pastVol2 = array.slice(pastVol, 0, highestVolDays)              //[__tag__=volume]Volume[/__tag__] sorted from highest to lowest

    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 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 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. )
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.


이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?