Advanced Volume Indicator for ThinkorSwim

YungTraderFromMontana

YungTraderFromMontana

Well-known member
I'm almost embarrassed to ask this question, it feels really basic but here we go...
I trade forex and have tried to add this and many other volume studies to my charts but not a single one actually displays.
I have enabled / disabled the "show volume subgraph" in the settings but that does not help either.
Thank you
volume subgraph needs to be on and make sure that there are enough bars for the study to calculate. I forget what the default is but that number is the length it uses. don't have the chart show less then 100 bars to be safe.
 
YungTraderFromMontana

YungTraderFromMontana

Well-known member
nevermind it doesn't work on forex, I don't think tos records contracts for forex that's why.
 
Welkin

Welkin

Active member
VIP
I'm almost embarrassed to ask this question, it feels really basic but here we go...
I trade forex and have tried to add this and many other volume studies to my charts but not a single one actually displays.
I have enabled / disabled the "show volume subgraph" in the settings but that does not help either.
Thank you
this is because forex isn't traded on a centralized exchange so you need to use tick count in place of volume.
try the following for the advanced volume indicator:
https://tos.mx/AjzK48r
for the VSA component:
https://tos.mx/rEI8t6Z

if you want to make another volume indicator compatible with forex charts replace volume with tick_count in the script
 
YungTraderFromMontana

YungTraderFromMontana

Well-known member
@Welkin I'm inexperienced with using time in code, if I wanted to make a tool that gives the projected volume for the bar that simply uses this equation (60/seconds out of current minute) * volume so far on unclosed bar. How would I do this.
 
J

Johnny Cash

Member
You will get some type of volume in forex.
just go to settings, forex, Display: Price type: change to " Last".
Check " show volume subgraph"
 
Welkin

Welkin

Active member
VIP
@Welkin I'm inexperienced with using time in code, if I wanted to make a tool that gives the projected volume for the bar that simply uses this equation (60/seconds out of current minute) * volume so far on unclosed bar. How would I do this.
This is interesting, honestly not sure, I think it might be possible for projecting for higher time frames, not sure about 1 min aggregations. if there was a GetMin() function I think I could probably come up with something, I'll have to contemplate it for a bit. Are you familiar with another indicator that does this or something similar?

edit: i feel like I was close to something but am only able to use constant variables in the SecondsFromTime() and SecondsTillTime() functions

Roughly, my idea was to get the barnumber and multiply by GetAggregationPeriod() to work out a bar start time and add GetAggregationPeriod() on top of that to get an end time, then from this you could probably work out a multiplier to use with volume before close.... I'll tinker with it some more and see if I can get something working over the next couple days.
 
Last edited:
YungTraderFromMontana

YungTraderFromMontana

Well-known member
@Welkin Okay I appreciate it, also is there any way to get the cumulative volume from 9:30 to 10:30?
 
Welkin

Welkin

Active member
VIP
Okay I appreciate it, also is there any way to get the cumulative volume from 9:30 to 10:30?
Code:
declare lower;
def T1Start = 0930;
def T1End = 1029;

def NA = Double.NaN;
def conf = SecondsFromTime(T1Start) >= 0 and SecondsFromTime(T1End) <= 0;

def cvolT1 = if conf and !conf[1] then volume else if conf then cvolT1[1] + volume else cvolT1[1];

plot cvol = if conf then cvolT1 else NA;

cvol.SetDefaultColor(Color.YELLOW);
cvol.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
 
M

mrmac

New member
VIP
this is because forex isn't traded on a centralized exchange so you need to use tick count in place of volume.
try the following for the advanced volume indicator:
https://tos.mx/AjzK48r
for the VSA component:
https://tos.mx/rEI8t6Z

if you want to make another volume indicator compatible with forex charts replace volume with tick_count in the script
Thank you very much @Welkin - I really appreciate you getting back to me on this, I'm going to give it a try shortly.
 
J

JL356

New member
@Welkin If I wanted to use just the ETH TVOL, on a column, what would i take out, can't seem to figure, any help will be good. This is really good. Thank you
 
Welkin

Welkin

Active member
VIP
@Welkin If I wanted to use just the ETH TVOL, on a column, what would i take out, can't seem to figure, any help will be good. This is really good. Thank you
try this https://tos.mx/bd5tvYX
Code:
def rthStart = 0930;
def rthEnd = 1600;
def conf = SecondsFromTime(rthStart) >= 0 and SecondsFromTime(rthEnd) <= 0;
def ETH_VOL = if !conf and conf[1] then volume else if !conf then CompoundValue(1, ETH_VOL[1] + volume, volume) else ETH_VOL[1];

plot ETHvol = ETH_VOL;
 
J

JL356

New member
try this https://tos.mx/bd5tvYX
Code:
def rthStart = 0930;
def rthEnd = 1600;
def conf = SecondsFromTime(rthStart) >= 0 and SecondsFromTime(rthEnd) <= 0;
def ETH_VOL = if !conf and conf[1] then volume else if !conf then CompoundValue(1, ETH_VOL[1] + volume, volume) else ETH_VOL[1];

plot ETHvol = ETH_VOL;
thanks love this...
 
S

ShinJ

New member
Hi Welkin, thank you for the tremendous work you've done! Couple of questions, if you don't mind.

1) Why it wont work with the tick charts?
2) Is it possible to add a stDev threshold that will hide candles with relative volume below a given value?
3) On buy/sell strength, is it possible to add exact values for ES from Time and Sales, since it trades only on the one exchange or the problem is that thinkorswim does not allow to use this information?
 
Welkin

Welkin

Active member
VIP
Hi Welkin, thank you for the tremendous work you've done! Couple of questions, if you don't mind.

1) Why it wont work with the tick charts?
2) Is it possible to add a stDev threshold that will hide candles with relative volume below a given value?
3) On buy/sell strength, is it possible to add exact values for ES from Time and Sales, since it trades only on the one exchange or the problem is that thinkorswim does not allow to use this information?
1) this is due to script that calls for higher aggregation data (vol strength, and the dayvol labels) here is a lite version with all of that stripped out:
http://tos.mx/xEluGZf
I plan on reworking the indicator at some point to fix all of this... but for now you'll have to use the lite version
2) do not plot volume bars if volume is less than a user specified std dev AND rvol is below a specified value? is this correct? just clarifying
3) correct, it would be nice if we could play around with the t&s data
 
S

ShinJ

New member
1) this is due to script that calls for higher aggregation data (vol strength, and the dayvol labels) here is a lite version with all of that stripped out:
http://tos.mx/xEluGZf
I plan on reworking the indicator at some point to fix all of this... but for now you'll have to use the lite version
2) do not plot volume bars if volume is less than a user specified std dev AND rvol is below a specified value? is this correct? just clarifying
3) correct, it would be nice if we could play around with the t&s data
Generally speaking, I want to add RelativeVolumeStDev with the threshold (code below) to your study, so that study will plot only extreme volume bars with buy/sell strength

Thank you, lite version working good with ticks

Code:
declare lower;
declare zerobase;

input length = 60;
input numDev = 2.0;
input allowNegativeValues = no;

def rawRelVol = (volume - Average(volume, length)) / StDev(volume, length);
def RelVol = if allowNegativeValues then rawRelVol else Max(0, rawRelVol);

plot StDevLevel = numDev;
plot RV = if RelVol > numDev then RelVol else Double.NaN;

RV.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
RV.SetLineWeight(3);
RV.DefineColor("Above", GetColor(0));
RV.DefineColor("Below", GetColor(2));
RV.AssignValueColor(if RelVol >= numDev then RV.Color("Above") else RV.Color("Below"));
StDevLevel.SetDefaultColor(GetColor(7));
StDevLevel.SetStyle(Curve.SHORT_DASH);
# End Code
 
S

solaris

New member
@Welkin Is there a watchlist code for Volume Strength Oscillator so i can watch the Vol across multiple timeframes
 
S

smeg

New member
This indicator is fantastic - I have been using a relative volume by time script however it doesnt work too great on shorter time frames ie < 5minutes. I am just trying to display the rvol figure by time of day. Ie what is the volume measure today for this 3 minute candle vs this same 3 minute candle at this same time of day over say 20 periods. Thats real rvol to me as it measures the relative volume for that time of day, vs the average overall as there is different market regimes and characteristics of the market at different times of day. Can anyone point to anything like that here?

The script im using currently is below. If you can improve on it by all means. I just cant get it working for 3m charts or less.

Code:
declare upper;
#declare fullrange;
def na = double.nan;
#input opentime = 0930;
#def AP = getAggregationPeriod();
rec barcounter = if getDay() != getDay()[1] then 1 else barcounter[1] + 1;

rec daycount = if barNumber() == 1 then 0 else if getDay() > getDay()[1] then 1 else 0;

def istoday = if getLastDay() == getDay() then 1 else 0;

def bar1volume = if istoday then 0 else if barcounter == 1 then volume else 0;
def bar2volume = if istoday then 0 else if barcounter == 2 then volume else 0;
def bar3volume = if istoday then 0 else if barcounter == 3 then volume else 0;
def bar4volume = if istoday then 0 else if barcounter == 4 then volume else 0;
def bar5volume = if istoday then 0 else if barcounter == 5 then volume else 0;
def bar6volume = if istoday then 0 else if barcounter == 6 then volume else 0;
def bar7volume = if istoday then 0 else if barcounter == 7 then volume else 0;
def bar8volume = if istoday then 0 else if barcounter == 8 then volume else 0;
def bar9volume = if istoday then 0 else if barcounter == 9 then volume else 0;
def bar10volume = if istoday then 0 else if barcounter == 10 then volume else 0;
def bar11volume = if istoday then 0 else if barcounter == 11 then volume else 0;
def bar12volume = if istoday then 0 else if barcounter == 12 then volume else 0;
def bar13volume = if istoday then 0 else if barcounter == 13 then volume else 0;
def bar14volume = if istoday then 0 else if barcounter == 14 then volume else 0;
def bar15volume = if istoday then 0 else if barcounter == 15 then volume else 0;
def bar16volume = if istoday then 0 else if barcounter == 16 then volume else 0;
def bar17volume = if istoday then 0 else if barcounter == 17 then volume else 0;
def bar18volume = if istoday then 0 else if barcounter == 18 then volume else 0;
def bar19volume = if istoday then 0 else if barcounter == 19 then volume else 0;
def bar20volume = if istoday then 0 else if barcounter == 20 then volume else 0;
def bar21volume = if istoday then 0 else if barcounter == 21 then volume else 0;
def bar22volume = if istoday then 0 else if barcounter == 22 then volume else 0;
def bar23volume = if istoday then 0 else if barcounter == 23 then volume else 0;
def bar24volume = if istoday then 0 else if barcounter == 24 then volume else 0;
def bar25volume = if istoday then 0 else if barcounter == 25 then volume else 0;
def bar26volume = if istoday then 0 else if barcounter == 26 then volume else 0;
def bar27volume = if istoday then 0 else if barcounter == 27 then volume else 0;
def bar28volume = if istoday then 0 else if barcounter == 28 then volume else 0;
def bar29volume = if istoday then 0 else if barcounter == 29 then volume else 0;
def bar30volume = if istoday then 0 else if barcounter == 30 then volume else 0;
def bar31volume = if istoday then 0 else if barcounter == 31 then volume else 0;
def bar32volume = if istoday then 0 else if barcounter == 32 then volume else 0;
def bar33volume = if istoday then 0 else if barcounter == 33 then volume else 0;
def bar34volume = if istoday then 0 else if barcounter == 34 then volume else 0;
def bar35volume = if istoday then 0 else if barcounter == 35 then volume else 0;
def bar36volume = if istoday then 0 else if barcounter == 36 then volume else 0;
def bar37volume = if istoday then 0 else if barcounter == 37 then volume else 0;
def bar38volume = if istoday then 0 else if barcounter == 38 then volume else 0;
def bar39volume = if istoday then 0 else if barcounter == 39 then volume else 0;
def bar40volume = if istoday then 0 else if barcounter == 40 then volume else 0;
def bar41volume = if istoday then 0 else if barcounter == 41 then volume else 0;
def bar42volume = if istoday then 0 else if barcounter == 42 then volume else 0;
def bar43volume = if istoday then 0 else if barcounter == 43 then volume else 0;
def bar44volume = if istoday then 0 else if barcounter == 44 then volume else 0;
def bar45volume = if istoday then 0 else if barcounter == 45 then volume else 0;
def bar46volume = if istoday then 0 else if barcounter == 46 then volume else 0;
def bar47volume = if istoday then 0 else if barcounter == 47 then volume else 0;
def bar48volume = if istoday then 0 else if barcounter == 48 then volume else 0;
def bar49volume = if istoday then 0 else if barcounter == 49 then volume else 0;
def bar50volume = if istoday then 0 else if barcounter == 50 then volume else 0;
def bar51volume = if istoday then 0 else if barcounter == 51 then volume else 0;
def bar52volume = if istoday then 0 else if barcounter == 52 then volume else 0;
def bar53volume = if istoday then 0 else if barcounter == 53 then volume else 0;
def bar54volume = if istoday then 0 else if barcounter == 54 then volume else 0;
def bar55volume = if istoday then 0 else if barcounter == 55 then volume else 0;
def bar56volume = if istoday then 0 else if barcounter == 56 then volume else 0;
def bar57volume = if istoday then 0 else if barcounter == 57 then volume else 0;
def bar58volume = if istoday then 0 else if barcounter == 58 then volume else 0;
def bar59volume = if istoday then 0 else if barcounter == 59 then volume else 0;
def bar60volume = if istoday then 0 else if barcounter == 60 then volume else 0;
def bar61volume = if istoday then 0 else if barcounter == 61 then volume else 0;
def bar62volume = if istoday then 0 else if barcounter == 62 then volume else 0;
def bar63volume = if istoday then 0 else if barcounter == 63 then volume else 0;
def bar64volume = if istoday then 0 else if barcounter == 64 then volume else 0;
def bar65volume = if istoday then 0 else if barcounter == 65 then volume else 0;
def bar66volume = if istoday then 0 else if barcounter == 66 then volume else 0;
def bar67volume = if istoday then 0 else if barcounter == 67 then volume else 0;
def bar68volume = if istoday then 0 else if barcounter == 68 then volume else 0;
def bar69volume = if istoday then 0 else if barcounter == 69 then volume else 0;
def bar70volume = if istoday then 0 else if barcounter == 70 then volume else 0;
def bar71volume = if istoday then 0 else if barcounter == 71 then volume else 0;
def bar72volume = if istoday then 0 else if barcounter == 72 then volume else 0;
def bar73volume = if istoday then 0 else if barcounter == 73 then volume else 0;
def bar74volume = if istoday then 0 else if barcounter == 74 then volume else 0;
def bar75volume = if istoday then 0 else if barcounter == 75 then volume else 0;
def bar76volume = if istoday then 0 else if barcounter == 76 then volume else 0;
def bar77volume = if istoday then 0 else if barcounter == 77 then volume else 0;
def bar78volume = if istoday then 0 else if barcounter == 78 then volume else 0;
def bar79volume = if istoday then 0 else if barcounter == 79 then volume else 0;
def bar80volume = if istoday then 0 else if barcounter == 80 then volume else 0;
def bar81volume = if istoday then 0 else if barcounter == 81 then volume else 0;

def avgbar1 = TotalSum(bar1volume) / TotalSum(daycount);
def avgbar2 = TotalSum(bar2volume) / TotalSum(daycount);
def avgbar3 = TotalSum(bar3volume) / TotalSum(daycount);
def avgbar4 = TotalSum(bar4volume) / TotalSum(daycount);
def avgbar5 = TotalSum(bar5volume) / TotalSum(daycount);
def avgbar6 = TotalSum(bar6volume) / TotalSum(daycount);
def avgbar7 = TotalSum(bar7volume) / TotalSum(daycount);
def avgbar8 = TotalSum(bar8volume) / TotalSum(daycount);
def avgbar9 = TotalSum(bar9volume) / TotalSum(daycount);
def avgbar10 = TotalSum(bar10volume) / TotalSum(daycount);
def avgbar11 = TotalSum(bar11volume) / TotalSum(daycount);
def avgbar12 = TotalSum(bar12volume) / TotalSum(daycount);
def avgbar13 = TotalSum(bar13volume) / TotalSum(daycount);
def avgbar14 = TotalSum(bar14volume) / TotalSum(daycount);
def avgbar15 = TotalSum(bar15volume) / TotalSum(daycount);
def avgbar16 = TotalSum(bar16volume) / TotalSum(daycount);
def avgbar17 = TotalSum(bar17volume) / TotalSum(daycount);
def avgbar18 = TotalSum(bar18volume) / TotalSum(daycount);
def avgbar19 = TotalSum(bar19volume) / TotalSum(daycount);
def avgbar20 = TotalSum(bar20volume) / TotalSum(daycount);
def avgbar21 = TotalSum(bar21volume) / TotalSum(daycount);
def avgbar22 = TotalSum(bar22volume) / TotalSum(daycount);
def avgbar23 = TotalSum(bar23volume) / TotalSum(daycount);
def avgbar24 = TotalSum(bar24volume) / TotalSum(daycount);
def avgbar25 = TotalSum(bar25volume) / TotalSum(daycount);
def avgbar26 = TotalSum(bar26volume) / TotalSum(daycount);
def avgbar27 = TotalSum(bar27volume) / TotalSum(daycount);
def avgbar28 = TotalSum(bar28volume) / TotalSum(daycount);
def avgbar29 = TotalSum(bar29volume) / TotalSum(daycount);
def avgbar30 = TotalSum(bar30volume) / TotalSum(daycount);
def avgbar31 = TotalSum(bar31volume) / TotalSum(daycount);
def avgbar32 = TotalSum(bar32volume) / TotalSum(daycount);
def avgbar33 = TotalSum(bar33volume) / TotalSum(daycount);
def avgbar34 = TotalSum(bar34volume) / TotalSum(daycount);
def avgbar35 = TotalSum(bar35volume) / TotalSum(daycount);
def avgbar36 = TotalSum(bar36volume) / TotalSum(daycount);
def avgbar37 = TotalSum(bar37volume) / TotalSum(daycount);
def avgbar38 = TotalSum(bar38volume) / TotalSum(daycount);
def avgbar39 = TotalSum(bar39volume) / TotalSum(daycount);
def avgbar40 = TotalSum(bar40volume) / TotalSum(daycount);
def avgbar41 = TotalSum(bar41volume) / TotalSum(daycount);
def avgbar42 = TotalSum(bar42volume) / TotalSum(daycount);
def avgbar43 = TotalSum(bar43volume) / TotalSum(daycount);
def avgbar44 = TotalSum(bar44volume) / TotalSum(daycount);
def avgbar45 = TotalSum(bar45volume) / TotalSum(daycount);
def avgbar46 = TotalSum(bar46volume) / TotalSum(daycount);
def avgbar47 = TotalSum(bar47volume) / TotalSum(daycount);
def avgbar48 = TotalSum(bar48volume) / TotalSum(daycount);
def avgbar49 = TotalSum(bar49volume) / TotalSum(daycount);
def avgbar50 = TotalSum(bar50volume) / TotalSum(daycount);
def avgbar51 = TotalSum(bar51volume) / TotalSum(daycount);
def avgbar52 = TotalSum(bar52volume) / TotalSum(daycount);
def avgbar53 = TotalSum(bar53volume) / TotalSum(daycount);
def avgbar54 = TotalSum(bar54volume) / TotalSum(daycount);
def avgbar55 = TotalSum(bar55volume) / TotalSum(daycount);
def avgbar56 = TotalSum(bar56volume) / TotalSum(daycount);
def avgbar57 = TotalSum(bar57volume) / TotalSum(daycount);
def avgbar58 = TotalSum(bar58volume) / TotalSum(daycount);
def avgbar59 = TotalSum(bar59volume) / TotalSum(daycount);
def avgbar60 = TotalSum(bar60volume) / TotalSum(daycount);
def avgbar61 = TotalSum(bar61volume) / TotalSum(daycount);
def avgbar62 = TotalSum(bar62volume) / TotalSum(daycount);
def avgbar63 = TotalSum(bar63volume) / TotalSum(daycount);
def avgbar64 = TotalSum(bar64volume) / TotalSum(daycount);
def avgbar65 = TotalSum(bar65volume) / TotalSum(daycount);
def avgbar66 = TotalSum(bar66volume) / TotalSum(daycount);
def avgbar67 = TotalSum(bar67volume) / TotalSum(daycount);
def avgbar68 = TotalSum(bar68volume) / TotalSum(daycount);
def avgbar69 = TotalSum(bar69volume) / TotalSum(daycount);
def avgbar70 = TotalSum(bar70volume) / TotalSum(daycount);
def avgbar71 = TotalSum(bar71volume) / TotalSum(daycount);
def avgbar72 = TotalSum(bar72volume) / TotalSum(daycount);
def avgbar73 = TotalSum(bar73volume) / TotalSum(daycount);
def avgbar74 = TotalSum(bar74volume) / TotalSum(daycount);
def avgbar75 = TotalSum(bar75volume) / TotalSum(daycount);
def avgbar76 = TotalSum(bar76volume) / TotalSum(daycount);
def avgbar77 = TotalSum(bar77volume) / TotalSum(daycount);
def avgbar78 = TotalSum(bar78volume) / TotalSum(daycount);
def avgbar79 = TotalSum(bar79volume) / TotalSum(daycount);
def avgbar80 = TotalSum(bar80volume) / TotalSum(daycount);
def avgbar81 = TotalSum(bar81volume) / TotalSum(daycount);





plot AvgVol = if getDay() != getLastDay() then na
else if barcounter == 1 then avgbar1
else if barcounter == 2 then avgbar2
else if barcounter == 3 then avgbar3
else if barcounter == 4 then avgbar4
else if barcounter == 5 then avgbar5
else if barcounter == 6 then avgbar6
else if barcounter == 7 then avgbar7
else if barcounter == 8 then avgbar8
else if barcounter == 9 then avgbar9
else if barcounter == 10 then avgbar10
else if barcounter == 11 then avgbar11
else if barcounter == 12 then avgbar12
else if barcounter == 13 then avgbar13
else if barcounter == 14 then avgbar14
else if barcounter == 15 then avgbar15
else if barcounter == 16 then avgbar16
else if barcounter == 17 then avgbar17
else if barcounter == 18 then avgbar18
else if barcounter == 19 then avgbar19
else if barcounter == 20 then avgbar20
else if barcounter == 21 then avgbar21
else if barcounter == 22 then avgbar22
else if barcounter == 23 then avgbar23
else if barcounter == 24 then avgbar24
else if barcounter == 25 then avgbar25
else if barcounter == 26 then avgbar26
else if barcounter == 27 then avgbar27
else if barcounter == 28 then avgbar28
else if barcounter == 29 then avgbar29
else if barcounter == 30 then avgbar30
else if barcounter == 31 then avgbar31
else if barcounter == 32 then avgbar32
else if barcounter == 33 then avgbar33
else if barcounter == 34 then avgbar34
else if barcounter == 35 then avgbar35
else if barcounter == 36 then avgbar36
else if barcounter == 37 then avgbar37
else if barcounter == 38 then avgbar38
else if barcounter == 39 then avgbar39
else if barcounter == 40 then avgbar40
else if barcounter == 41 then avgbar41
else if barcounter == 42 then avgbar42
else if barcounter == 43 then avgbar43
else if barcounter == 44 then avgbar44
else if barcounter == 45 then avgbar45
else if barcounter == 46 then avgbar46
else if barcounter == 47 then avgbar47
else if barcounter == 48 then avgbar48
else if barcounter == 49 then avgbar49
else if barcounter == 50 then avgbar50
else if barcounter == 51 then avgbar51
else if barcounter == 52 then avgbar52
else if barcounter == 53 then avgbar53
else if barcounter == 54 then avgbar54
else if barcounter == 55 then avgbar55
else if barcounter == 56 then avgbar56
else if barcounter == 57 then avgbar57
else if barcounter == 58 then avgbar58
else if barcounter == 59 then avgbar59
else if barcounter == 60 then avgbar60
else if barcounter == 61 then avgbar61
else if barcounter == 62 then avgbar62
else if barcounter == 63 then avgbar63
else if barcounter == 64 then avgbar64
else if barcounter == 65 then avgbar65
else if barcounter == 66 then avgbar66
else if barcounter == 67 then avgbar67
else if barcounter == 68 then avgbar68
else if barcounter == 69 then avgbar69
else if barcounter == 70 then avgbar70
else if barcounter == 71 then avgbar71
else if barcounter == 72 then avgbar72
else if barcounter == 73 then avgbar73
else if barcounter == 74 then avgbar74
else if barcounter == 75 then avgbar75
else if barcounter == 76 then avgbar76
else if barcounter == 77 then avgbar77
else if barcounter == 78 then avgbar78
else if barcounter == 79 then avgbar79
else if barcounter == 80 then avgbar80
else if barcounter == 81 then avgbar81
else na;

avgvol.SetDefaultColor(color.dark_gray);
#avgvol.setstyle(curve.points);
avgvol.SetLineWeight(1);
plot zero = 0;
AddCloud(avgvol, zero, color.gray);

plot vol = volume;
vol.SetLineWeight(3);
vol.SetPaintingStrategy(paintingStrategy.HISTOGRAM);
vol.AssignValueColor(if !istoday then color.cYAN else if volume > avgvol then color.yellow else color.gray);
 

Similar threads

Top