ChristianS
Member
you could have found the script ?I am looking for a script that show volume on the buy and sell side as well as percentages. Can anyone point me in the right direction?
you could have found the script ?I am looking for a script that show volume on the buy and sell side as well as percentages. Can anyone point me in the right direction?
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
declare lower;
input period = AggregationPeriod.DAY;
input lengthB = 9;
input lengthS = 9;
input averageType = AverageType.EXPONENTIAL;
# Buying Volume
def O1 = open(period = period);
def H1 = high(period = period);
def C1 = close(period = period);
def L1 = low(period = period);
def V1 = volume(period = period);
def BV = V1 * ((C1 - L1) / (H1 - L1));
def Buy = MovingAverage (averageType, BV,lengthB);
plot BuyVol = ExpAverage (Buy, LengthB);
# Selling Volume
def O = open(period = period);
def H = high(period = period);
def C = close(period = period);
def L = low(period = period);
def V = volume(period = period);
def SV = -V * ((H - C) / (H - L));
def Sell = MovingAverage (averageType, -SV, lengthS);
plot SellVol = ExpAverage (Sell, LengthS);
# Signal
input showBreakoutSignals = no;
plot UpSignal = BuyVol+1 crosses above SellVol;
plot DownSignal = BuyVol-1 crosses below SellVol;
UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
@ugaotraderChris' Enhanced Volume I know light green is DevIncrease and light red is DevDecrease but what exactly does that mean as far as the indicator goes.
I fixed it nevermind.. the premarket volume wasn't added in properly for the buy and sell vol. I posted it below in case anyone's interested. Please let me know if there's a problem with it, I'm not very experienced and I'd love to improve it.Does someone know if the code below is correct? I took a label code for RVol that was posted on here and I was playing with it to see if I could utilize it with avg b/s vol. I think it's wrong though, the result looks nothing like my other buy sell volume data and the numbers seem too high on the buy and sell volume. Any input would be wonderful
Ruby:def isRollover = GetYYYYMMDD() != GetYYYYMMDD()[1]; def beforeStart = GetTime() < RegularTradingStart(GetYYYYMMDD()); def vol = if isRollover and beforeStart then volume else if beforeStart then vol[1] + volume else Double.NaN; def PMV = if IsNaN(vol) then PMV[1] else vol; def AV = AggregationPeriod.DAY; def O = open(period = AV); def H = high(period = AV); def C = close(period = AV); def L = low(period = AV); def V = volume(period = AV); def Buying = V * (C - L) / (H - L); def Selling = V * (H - C) / (H - L); # Selling Volume def SV = Selling; # Buying Volume def BV = Buying; input vlength = 60; def x = Average(volume(period = AV)[1], vlength); def y1 = Round((PMV / x), 2); def Lg = Lg(y1); def p = if Lg >= 1 then 0 else if Lg >= 0 then 1 else 2; def y2 = Round(y1, p); def rVol = y2; input blength = 60; def x_b = Average(Buying[1], blength); def y1_b = Round((PMV / x_b), 2); def Lg_b = Lg(y1_b); def p_b = if Lg_b >= 1 then 0 else if Lg_b >= 0 then 1 else 2; def y2_b = Round(y1_b, p_b); def rVolBuying = y2_b; input slength = 60; def x_s = Average(Selling[1], slength); def y1_s = Round((PMV / x_s), 2); def Lg_s = Lg(y1_s); def p_s = if Lg_s >= 1 then 0 else if Lg_s >= 0 then 1 else 2; def y2_s = Round(y1_s, p_s); def RvolSelling = y2_s; rVol.SetPaintingStrategy(PaintingStrategy.LINE); AddLabel(yes, "R-Vol: " + rVol, if rVol > 3 then Color.Cyan else if rVol > 2 then Color.Blue else if rVol > 1.2 then Color.Orange else if (rVol <1.2 and rVol >.8) then color.Dark_orange else color.gray); AddLabel(yes, "R-Vol (Buying): " + rVolBuying, if rVolBuying > 3 then Color.Green else if rVolBuying > 2 then Color.Dark_Green else if rVolBuying > 1.2 then Color.light_green else if rVolBuying <1.2 and rVolBuying >.8 then color.orange else color.red); AddLabel(yes, "R-Vol (Selling): " + rVolSelling, if rVolSelling > 3 then Color.Red else if rVolSelling > 2 then Color.Dark_Red else if rVolSelling > 1.2 then Color.light_Red else if rVolSelling <1.2 and rVolSelling >.8 then color.orange else color.Green);
def isRollover = GetYYYYMMDD() != GetYYYYMMDD()[1];
def beforeStart = GetTime() < RegularTradingStart(GetYYYYMMDD());
def vol = if isRollover and beforeStart then volume else if beforeStart then vol[1] + volume else Double.NaN;
def PMV = if IsNaN(vol) then PMV[1] else vol;
def AV = AggregationPeriod.DAY;
def O = open(period = AV);
def H = high(period = AV);
def C = close(period = AV);
def L = low(period = AV);
def V = volume(period = AV);
def Buying = V * (C - L) / (H - L);
def Selling = V * (H - C) / (H - L);
def pmB = PMV * (C - L) / (H - L);
def pmS = PMV * (H - C) / (H - L);
# Selling Volume
def SV = Selling;
# Buying Volume
defBV = Buying;
input vlength = 22;
def x = Average(volume(period = AV)[1], vlength);
def y1 = Round((PMV / x), 2);
def Lg = Lg(y1);
def p = if Lg >= 1 then 0 else if Lg >= 0 then 1 else 2;
def y2 = Round(y1, p);
def rVol = y2;
input blength = 22;
def x_b = Average(Buying[1], blength);
def y1_b = Round((pmB / x_b), 2);
def Lg_b = Lg(y1_b);
def p_b = if Lg_b >= 1 then 0 else if Lg_b >= 0 then 1 else 2;
def y2_b = Round(y1_b, p_b);
def rVolBuying = y2_b;
input slength = 22;
def x_s = Average(Selling[1], slength);
def y1_s = Round((pmS / x_s), 2);
def Lg_s = Lg(y1_s);
def p_s = if Lg_s >= 1 then 0 else if Lg_s >= 0 then 1 else 2;
def y2_s = Round(y1_s, p_s);
def RvolSelling = y2_s;
AddLabel(yes, "R-Vol: " + rVol, if rVol > 3 then Color.Cyan else if rVol > 2 then Color.Blue else if rVol > 1.2 then Color.Orange else if (rVol <1.2 and rVol >.8) then color.Dark_orange else color.gray);
AddLabel(yes, "R-Vol (Buying): " + rVolBuying, if rVolBuying > 3 then Color.Green else if rVolBuying > 2 then Color.Dark_Green else if rVolBuying > 1.2 then Color.light_green else if rVolBuying <1.2 and rVolBuying >.8 then color.orange else color.red);
AddLabel(yes, "R-Vol (Selling): " + rVolSelling, if rVolSelling > 3 then Color.Red else if rVolSelling > 2 then Color.Dark_Red else if rVolSelling > 1.2 then Color.light_Red else if rVolSelling <1.2 and rVolSelling >.8 then color.orange else color.Green);
input length = 5;
def o = open;
def h = high;
def l = low;
def c = close;
def v = volume;
def bvolsum = Sum(((c - l) / (h - l)) * v, length);
def svolsum = Sum(((h - c) / (h - l)) * v, length);
See 1st post in this thread. Comment out what you don't need.So i have this code for buy & sell volume and need to create a label for the upper chart that displays which vol type is currently showing and label should be painted green for bvol and red for svol. Appreciate if anyone can help me with this.
Code:input length = 5; def o = open; def h = high; def l = low; def c = close; def v = volume; def bvolsum = Sum(((c - l) / (h - l)) * v, length); def svolsum = Sum(((h - c) / (h - l)) * v, length);
Thanks for posting, any way to change the audio alert? I looked over the code and did not see it listed so I am guessing it's TOS default?Chris's Enhanced Volume For ThinkOrSwim
Buy / Sell Volume Pressure w/ volumes and percentages
View attachment 913
Ruby:#Chris' Enhanced Volume V.2 /w Uptick/Downtick declare on_volume; ############### #DPL CRITERIA # ############### input Audible_Alert = yes; def Deviation_Length = 60; def Deviate = 2; def volumestdev = RelativeVolumeStDev(length = Deviation_Length); def abovedev = volumestdev >= Deviate; def belowdev = volumestdev <= Deviate; ############ # DPL BARS # ############ def increase = volume > volume[1]; def devincrease = increase and abovedev; def decrease = volume < volume[1]; def devdecrease = decrease and abovedev; ############################## # UPTICK / DOWNTICK CRITERIA # ############################## def O = open; def H = high; def C = close; def L = low; def V = volume; def Buying = V * (C - L) / (H - L); def Selling = V * (H - C) / (H - L); ################## # Selling Volume # ################## plot SV = Selling; SV.DefineColor("Decrease", Color.rED); SV.DefineColor("DevDecrease", Color.pink); SV.AssignValueColor(if devdecrease then SV.Color("DevDecrease") else SV.Color("Decrease")); SV.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); SV.HideTitle(); SV.HideBubble(); SV.SetLineWeight(5); ################# # Buying Volume # ################# DefineGlobalColor("LabelGreen", CreateColor(0, 165, 0)) ; plot BV = Buying; BV.DefineColor("Increase", GlobalColor("LabelGreen")); BV.DefineColor("DevIncrease", Color.light_GREEN); BV.AssignValueColor(if devincrease then BV.Color("DevIncrease") else BV.Color("Increase")); BV.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); BV.HideTitle(); BV.HideBubble(); BV.SetLineWeight(5); ################# # Adding Volume Labels # ################# input Show_Labels = yes; AddLabel(Show_Labels, "Buy Vol = " + Round(Buying, 0), if Buying > Selling then GlobalColor("LabelGreen") else color.red); AddLabel(Show_Labels, "Buy %: " + Round((Buying/(Buying+Selling))*100,2), If (Buying/(Buying+Selling))*100 > 60 then GlobalColor("LabelGreen") else color.red); AddLabel(Show_Labels, "Sell Vol = " + Round(Selling, 0), if Selling > Buying then GlobalColor("LabelGreen") else color.red); AddLabel(Show_Labels, "Sell %: " + Round((Selling/(Selling+Buying))*100,2), If (Selling/(Selling+Buying))*100 > 60 then GlobalColor("LabelGreen") else color.RED);
Buy / Sell Volume Pressure w/ volumes and percentages -- Upper Study Labels Only
Ruby:#Chris' Enhanced Volume V.2 /w Uptick/Downtick LABELS ONLY declare upper; ############### #DPL CRITERIA # ############### def Deviation_Length = 60; def Deviate = 2; def volumestdev = RelativeVolumeStDev(length = Deviation_Length); def abovedev = volumestdev >= Deviate; def belowdev = volumestdev <= Deviate; ############ # DPL BARS # ############ def increase = volume > volume[1]; def devincrease = increase and abovedev; def decrease = volume < volume[1]; def devdecrease = decrease and abovedev; ############################## # UPTICK / DOWNTICK CRITERIA # ############################## def O = open; def H = high; def C = close; def L = low; def V = volume; def Buying = V * (C - L) / (H - L); def Selling = V * (H - C) / (H - L); ################## # Selling Volume # ################## def SV = Selling; def BV = Buying; ################# # Adding Volume Labels # ################# DefineGlobalColor("LabelGreen", CreateColor(0, 165, 0)) ; input Show_Labels = yes; AddLabel(Show_Labels, "Buy Vol = " + Round(Buying, 0), if Buying > Selling then GlobalColor("LabelGreen") else color.red); AddLabel(Show_Labels, "Buy %: " + Round((Buying/(Buying+Selling))*100,2), If (Buying/(Buying+Selling))*100 > 60 then GlobalColor("LabelGreen") else color.red); AddLabel(Show_Labels, "Sell Vol = " + Round(Selling, 0), if Selling > Buying then GlobalColor("LabelGreen") else color.red); AddLabel(Show_Labels, "Sell %: " + Round((Selling/(Selling+Buying))*100,2), If (Selling/(Selling+Buying))*100 > 60 then GlobalColor("LabelGreen") else color.RED);
There is no alerts in the scripts that you referenced so there is nothing to 'change'.Thanks for posting, any way to change the audio alert? I looked over the code and did not see it listed so I am guessing it's TOS default?
Is there any way to take out those icons for Earnings and Dividend info between the Symbol and the rest of watchlist? I'd like to put that space to better use.Here's a Watchlist Column Mod I just made.
Code:# Original author: Unknown # Watchlist Label # Mod by Ramon DV aka Pelonsax declare lower; def O = open; def H = high; def C = close; def L = low; def Price = H + L + C / 3; def V = volume; def buying = V * (C - L) / (H - L); def selling = V * (H - C) / (H - L); def SellVolPercent = Round((Selling / Volume) * 100, 0); def BuyVolPercent = 100 - SellVolPercent; assignBackgroundColor(if buying >= selling then color.GREEN else if buying <= selling then color.RED else color.white); AddLabel(buying <= selling, "Sell %: "+SellVolPercent, color.black); AddLabel(buying >= selling, "Buy %: "+BuyVolPercent, color.black);
################################
# Original script by Cwparker23#
################################
# Original script by Cwparker23 #
#-----------------
#DISCLAIMER
#-----------------
#I am not a certified financial advisor. The content of this page/site and tools are for informational purposes only and does not constitute financial or legal advice. Under no circumstances will the author be responsible for errors or use of this tool and site. User assumes all risks.
declare lower;
declare zerobase;
def O = open;
def H = high;
def C = close;
def L = low;
def V = volume;
DEF VOLAVG= expaverage (V);
#############################################
def buying = ((C - L) / (H - L))*volume;
def selling = ((H - C) / (H - L)*volume);
DEF buying_AVG= expaverage (buying);
DEF selling_AVG= expaverage (selling);
AddLabel(yes, "BAR: " + volume, Color.WHITE);
def buy_percentage = (buying_AVG/VOLAVG)*100;
AddLabel (yes, "BUY_VOL " + Round (buying , 2) + " BUY_AVG " + round (buying_AVG)+ " %" + round (buy_percentage) + "", (if buying_AVG > selling_AVG then Color.GREEN else if buying_AVG < selling_AVG then Color.GRAY else Color.YELLOW));
def SELL_percentage = (selling_AVG/VOLAVG)*100;
AddLabel (yes, "SELL_VOL " + Round (selling , 2) + " SELL_AVG " + round (selling_AVG)+ " %" + round (SELL_percentage) + "", (if buying_AVG < selling_AVG then Color.RED else if buying_AVG > selling_AVG then Color.GRAY else Color.YELLOW));
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.