ThinkorSwim Volume By Price (VBP) Indicator

Do any of you know if I can find the volume by price study in ThinkorSwim to display volume on the left as horizontal volume bars? I have played with the default ToS Volume Profile indicator and I can't get so it's simple to see on my charts. Is there a custom script that anyone has used in the past for just a simple / easy to read study? I copied a few below from other charting systems for what I consider simple.

hu1sUKr.png


Ky6K4jc.png


Code:
# Volume by Price location
# Mobius
# Chat Room Request 08.16.2016


declare lower;


def Active = if SecondsFromTime(0930) > 0 and
                SecondsTillTime(1600) >= 0
             then 1
             else 0;
def hh = if Active and !Active[1]
         then high
         else if Active and
              high > hh[1]
              then high
              else hh[1];
def ll = if Active and !Active[1]
         then low
         else if Active and
              low < ll[1]
              then low
              else ll[1];
def volP = if ((close - ll) / (hh - ll)) > .5
           then volume
           else -volume;
def data = if Active then
            data[1] + volP
            else data[1];
plot Histo = if Active then data else double.nan;
        Histo.SetPaintingStrategy(paintingStrategy.Histogram);
 

Axel

New member
You can do it by using default ToS Volume profile. Only thing that I doubt its possible to move it to the left.

07:10 Dilbert: Someone asked recently if it was possible to plot the volume profile starting for the left of the screen instead of in the expansion area like the native TOS study does. I found in my saved studies this one that TOS posted.

Code:
#HINT: This study plots volume that occurred at different prices.  For example, if timePerProfile of CHART is selected then net total volume of the horizontal volume-by-price will be equal to the net total volume of the vertical volume bars under the chart.\n\n Use horizontal volume-by-price to find areas of hidden support/resistance by noticing prices where largest volume occurred.\n.
 
 
input pricePerRowHeightMode = {default AUTOMATIC, TICKSIZE, CUSTOM};
input customRowHeight = 1.0;
input timePerProfile = {default CHART, MINUTE, HOUR, DAY, WEEK, MONTH, "OPT EXP", BAR}; #HINT timePerProfile: If onExpansion is set to no, select CHART to have horizontal volume-by-price include all volume for entire chart. Or select an aggregation period to show horizontal volume-by-price include only total volume for that time period (for example select MONTH to show only 1 month of volume on aa 1-year daily chart)
input onExpansion = no; #HINT onExpansion: no will plot horizontal volume-by-price bars under the chart bars/candles.  onExpansion yes will plot in the extra space to right of the chart.
input opacity = 40; #HINT opacity: If onExpansion is set to no, DECREASE the opacity number to make price bars/candles easier to see on top of the horizontal volume-by-price bars
input profiles = 1000; #HINT profiles: The numberOfProfiles parameter defines the number of profiles to be displayed if onExpansion is set to no. If onExpansion is set to yes then this parameter is ignored and only one profile is shown.
input multiplier = 1;
 
def period;
def yyyymmdd = getYyyyMmDd();
def seconds = secondsFromTime(0);
def month = getYear() * 12 + getMonth();
def day_number = daysFromDate(first(yyyymmdd)) + getDayOfWeek(first(yyyymmdd));
def dom = getDayOfMonth(yyyymmdd);
def dow = getDayOfWeek(yyyymmdd - dom + 1);
def expthismonth = (if dow > 5 then 27 else 20) - dow;
def exp_opt = month + (dom > expthismonth);
switch (timePerProfile) {
case CHART:
    period = 0;
case MINUTE:
    period = floor(seconds / 60 + day_number * 24 * 60);
case HOUR:
    period = floor(seconds / 3600 + day_number * 24);
case DAY:
    period = countTradingDays(min(first(yyyymmdd), yyyymmdd), yyyymmdd) - 1;
case WEEK:
    period = floor(day_number / 7);
case MONTH:
    period = floor(month - first(month));
case "OPT EXP":
    period = exp_opt - first(exp_opt);
case BAR:
    period = barNumber() - 1;
}
 
def count = CompoundValue(1, if period != period[1] then (count[1] + period - period[1]) % multiplier else count[1], 0);
def cond = count < count[1] + period - period[1];
def height;
switch (pricePerRowHeightMode) {
case AUTOMATIC:
    height = PricePerRow.AUTOMATIC;
case TICKSIZE:
    height = PricePerRow.TICKSIZE;
case CUSTOM:
    height = customRowHeight;
}
 
profile volumeByPrice = volumeProfile("startNewProfile" = cond, "onExpansion" = onExpansion, "numberOfProfiles" = profiles, "pricePerRow" = height);
 
DefineGlobalColor("Profile", color.CYAN);
 
volumeByPrice.show(globalColor("Profile"), color.CURRENT, color.CURRENT, opacity);
 

Similar threads

Top