Volume greater than prior 5 days

rudy seena

New member
Hi Thanks for your response. I do thoroughly enjoy your site and thank you for the wonderful work you and the team put together.

I have a question that I cannot find answered anywhere on your site. How can I Thinkscript a code to identify when volume is greater than the prior 5 days, and have the volume bar color coded in blue? see below for an example.

IRWOu8r.jpg


I really do appreciate any feedback you can offer.

As always, keep up the great work!

Thanks, Rudy
 

Welkin

Active member
VIP
@rudy seena this should do the trick, it will only plot on the daily aggregation.

Code:
declare on_volume;
def NA = Double.NaN;
input length = 5;
def aggcheck = GetAggregationPeriod() == AggregationPeriod.DAY;
def v = volume;
def vt = v == Highest(v,length);
plot Vtest = if aggcheck and vt then v else NA;

vtest.SetDefaultColor(CreateColor(0,100,200));
vtest.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
 

rudy seena

New member
Thanks Welkin for the thoughtful response. I greatly appreciate your input. You guys are doing a fantastic job. I sincerely hope Ameritrade recognizes your valuable services to the TOS community!
 

rudy seena

New member
Hi guys. TKS for the script. Is it possible to add daily price greater than previous day to this script? This way I know vol greater than prior day is with up price action, instead of a distribution day. TKS in advance. Rudy
 

Similar threads

Top