Unusual Volume For ThinkOrSwim

Simple script modification that helps me to confirm when a trend is broken. All it does is paint candles dark red or dark green if volume is 3x average. If you see anything wrong with the code please point it out thank you.

https://ibb.co/p2dmnFL - for an example on TSLA, I made good money trading puts off that broken trend.

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2021
# Modified VolumeAvg to paint candlesticks that are 3x the average volume.
# Make sure you put this in the Volume section of studies

declare lower;
declare zerobase;

input length = 50;

def AvgVol = Average(volume * 3);

plot Vol = volume;
plot VolAvg = Average(volume, length);

Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Vol.SetLineWeight(3);
Vol.DefineColor("Up", Color.UPTICK);
Vol.DefineColor("Down", Color.DOWNTICK);
Vol.AssignValueColor(if close > close[1] then Vol.color("Up") else if close < close[1] then Vol.color("Down") else GetColor(1));
VolAvg.SetDefaultColor(GetColor(8));

AssignPriceColor(if close > close[1] AND volume > AvgVol then color.DARK_GREEN else color.current);
AssignPriceColor(if close < close[1] AND volume > AvgVol then color.DARK_RED else color.current);
I really like this indicator but Instead of changing the color of the candles can someone help me add arrows instead? Please.
 
I really like this indicator but Instead of changing the color of the candles can someone help me add arrows instead? Please.
Code:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2021
# Modified VolumeAvg to paint candlesticks that are 3x the average volume.
# Make sure you put this in the Volume section of studies

declare lower;
declare zerobase;

input length = 50;

def AvgVol = Average(volume * 3);

plot Vol = volume;
plot VolAvg = Average(volume, length);

Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Vol.SetLineWeight(3);
Vol.DefineColor("Up", Color.UPTICK);
Vol.DefineColor("Down", Color.DOWNTICK);
Vol.AssignValueColor(if close > close[1] then Vol.color("Up") else if close < close[1] then Vol.color("Down") else GetColor(1));
VolAvg.SetDefaultColor(GetColor(8));

#AssignPriceColor(if close > close[1] AND volume > AvgVol then color.DARK_GREEN else color.current);
#AssignPriceColor(if close < close[1] AND volume > AvgVol then color.DARK_RED else color.current);

plot UpArrow= if close > close[1] AND volume > AvgVol then low else double.NaN ;
UpArrow.SetPaintingStrategy(PaintingStrategy.ARROW_up);
UpArrow.SetDefaultColor(color.blue) ;
UpArrow.SetLineWeight(1);

plot DnArrow = if  close < close[1] AND volume > AvgVol  then high else double.NaN ;
DnArrow .SetPaintingStrategy(PaintingStrategy.ARROW_down);
DnArrow .SetDefaultColor(color.magenta) ;
DnArrow .SetLineWeight(1);
 
@crawford5002

Code:
AssignBackgroundColor( if percentOf30Bar >=200 then color.Dark_GREEN else  if percentOf30Bar >= 100 then color.yellow else  if percentOf30Bar < 100 then color.red else color.black);
Any way to add an alert to this? if >=200?, i just tried but my coding skills are still new
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
788 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

How do I get started?

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.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top