Tidan
Member
I can get them to appear in a seperate volume indicator I wrote but not with this one. Anyone have any ideas?
Note how the volume values are not appearing in the title bar where it says N/A:
Note how the volume values are not appearing in the title bar where it says N/A:
Code:
#declare on_volume;
declare lower;
#declare zerobase;
#to display volume as over/under instead of overlaid.
input over_under = yes;
def V = volume;
def O = open;
def C = close;
def H = high;
def L = low;
def buying = round(V*(C-L)/(H-L),0);
def selling = round(V*(H-C)/(H-L),0);
#irrelevant code snipped#
################################################################
# Option 2 - Total volume is colored red and buying volume is green and layed over
# total volume to show red up top and green below. Can use total volume and
# uncomment SellingVolume for all three to be displayed(must change totalVolume color to gray).
################################################################
# Sell Volume
#Plot SellVol = selling;
#SellVol.setPaintingStrategy(PaintingStrategy.HISTOGRAM);
#SellVol.SetDefaultColor(getColor(5));
#SellVol.HideTitle();
#SellVol.HideBubble();
#SellVol.SetLineWeight(1);
# Buy Volume
Plot BuyVol = if over_under == no then buying else double.nan;
BuyVol.setPaintingStrategy(PaintingStrategy.HISTOGRAM);
BuyVol.SetDefaultColor(getColor(6));
BuyVol.HideTitle();
BuyVol.HideBubble();
BuyVol.SetLineWeight(5);
# Total Volume or paint red to show sell vol up top and buy vol at bottom
plot TotVol = if over_under == no then volume else double.nan;
TotVol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
TotVol.SetDefaultColor(getColor(5));
##TotVol.SetDefaultColor(Color.Gray);
TotVol.HideTitle();
TotVol.HideBubble();
TotVol.SetLineWeight(5);
# colored label to show whether buy or sell volume is higher
AddLabel(if over_under == no then yes else no, " Trend ", if buying > selling then color.UPTICK else if selling > buying then color.DOWNTICK else color.GRAY);
Last edited: