NextSignals Aggressive Buy & Sell Pressure Volume For ThinkOrSwim

Hi everyone,
Im sharing Doctor Stephen Harlins work he shared on his Twitter. He can be found here on Twitter. His posts are of tremendous value.
The tweet containing this work is here & here

According to him

" I'm sharing this code purely for educational purposes. Please don't trade this without fully understanding it. And I can't teach individuals how to import studies into ThinkorSwim or troubleshoot your platform, etc.

(2/3) The concept works best on a tick chart for reasons beyond the scope of this tweet. The study just says, "Show me (highlight) price bars that are above average in volume and price range, that also push the close well off of the high(selling press) or low (buying press)."

(3/3) That would highlight/infer the presence of "aggressive" orders. The white-tagged price bars display when the above conditions are met - plus an extreme in a high or low falls outside of a stDev calc (modif'd Bollinger Band). A forthcoming tweet will compliment this.

It looks like this.
Ic20XT6.png


FYI im simply sharing his work so the community can possibly benefit, I haven't gotten a chance to take it for a spin live.

Code:
plot zero = 0;
zero.setdefaultcolor(color.black);

addlabel(yes," Aggressive Buy ",createcolor(82,202,22));
addlabel(yes," Aggressive Sell ",color.red);
addlabel(yes," Stat Outlier ", color.white);
addlabel(yes," Overnight ", createcolor(60,80,120));

def seconds = SecondsFromTime(0);
def time = SecondsTillTime (1600);
def minutes = seconds / 3600;
def RTH = minutes > 8 and minutes < 16.5;

def sDev = StDev(data = close, 20);
def mid = MovingAverage(AverageType.SIMPLE, close, 20);
def lowerBand = mid -1 * sDev;
def upperBand = mid - (-1.918) * sDev;

def range = AbsValue(open - close);
def WAvg = WildersAverage(range, 20);
def avgVolume = ExpAverage(volume,50);
def bp= (close - low)/(high - low) > 0.75;
def sp = (high - close)/(high - low) > 0.75;
def up = close > open and range > Wavg and volume > avgVolume and bp;
def dn = close < open and range > wavg and volume > avgVolume and sp;

plot hiupvol = if up and !up[1] then round(volume/1000,0) else double.nan;
hiupvol.setpaintingstrategy(paintingstrategy.values_below);
hiupvol.setdefaultcolor(color.green);
hiupvol.assignvaluecolor(if low < lowerBand and range > wavg and volume > avgVolume and bp then color.white else color.current);
hiupvol.hidetitle();
plot hidnvol = if dn and !dn[1] then round(volume/1000,0) else double.nan;
hidnvol.setpaintingstrategy(paintingstrategy.values_above);
hidnvol.setdefaultcolor(color.red);
hidnvol.assignvaluecolor(if high > upperBand and range > wavg and volume > avgVolume and sp then color.white else color.current);
hidnvol.hidetitle();

DefineGlobalColor("color1",  createcolor(0,132,193)) ;
DefineGlobalColor("color2",  color.green) ;
DefineGlobalColor("color3",  color.red) ;
DefineGlobalColor("color4",  createcolor(60,80,120)) ;
assignpricecolor(if RTH and !up and !dn then GlobalColor("color1") else if up then GlobalColor("color2") else if dn then GlobalColor("color3") else GlobalColor("color4"));
 
Last edited by a moderator:

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

any way that this script could be changed so that you can change the color of all the candles to personal preference?

I have this version of the script below which colors the aggressive buying and selling bars green and red, while the rest remain dark blue, I want to be able to change them to my preference colors

plot zero = 0;
zero.setdefaultcolor(color.black);

addlabel(yes," Aggressive Buy ",createcolor(82,202,22));
addlabel(yes," Aggressive Sell ",color.red);
addlabel(yes," Stat Outlier ", color.white);
addlabel(yes," Overnight ", createcolor(60,80,120));

def seconds = SecondsFromTime(0);
def time = SecondsTillTime (1600);
def minutes = seconds / 3600;
def RTH = minutes > 8 and minutes < 16.5;

def sDev = StDev(data = close, 20);
def mid = MovingAverage(AverageType.SIMPLE, close, 20);
def lowerBand = mid -1 * sDev;
def upperBand = mid - (-1.918) * sDev;

def range = AbsValue(open - close);
def WAvg = WildersAverage(range, 20);
def avgVolume = ExpAverage(volume,50);
def bp= (close - low)/(high - low) > 0.75;
def sp = (high - close)/(high - low) > 0.75;
def up = close > open and range > Wavg and volume > avgVolume and bp;
def dn = close < open and range > wavg and volume > avgVolume and sp;

plot hiupvol = if up and !up[1] then round(volume/1000,0) else double.nan;
hiupvol.setpaintingstrategy(paintingstrategy.values_below);
hiupvol.setdefaultcolor(color.green);
hiupvol.assignvaluecolor(if low < lowerBand and range > wavg and volume > avgVolume and bp then color.white else color.current);
hiupvol.hidetitle();
plot hidnvol = if dn and !dn[1] then round(volume/1000,0) else double.nan;
hidnvol.setpaintingstrategy(paintingstrategy.values_above);
hidnvol.setdefaultcolor(color.red);
hidnvol.assignvaluecolor(if high > upperBand and range > wavg and volume > avgVolume and sp then color.white else color.current);
hidnvol.hidetitle();

assignpricecolor(if RTH and !up and !dn then createcolor(0,132,193) else if up then color.green else if dn then color.red else createcolor(60,80,120));
 
Last edited by a moderator:
any way that this script could be changed so that you can change the color of all the candles to personal preference?
The top post has been updated so that "you can change the color of all the candles to personal preference".
1. Copy & paste the new script from the top post
2. click on the gear to the right of the study after you add it to your chart
3. click on Globals
4. click on the color that you want to change
5. REMEMBER: to click on "Save As Default" at the top of the box.
So you don't have to constantly re-do your changes every time you add the indicator to a chart.​
ctSvwMj.png
 
Last edited:
any way to make a watchlist column for this?
Here ya go:
Ruby:
plot zero = 0;
zero.setdefaultcolor(color.black);

def seconds = SecondsFromTime(0);
def time = SecondsTillTime (1600);
def minutes = seconds / 3600;
def RTH = minutes > 8 and minutes < 16.5;

def sDev = StDev(data = close, 20);
def mid = MovingAverage(AverageType.SIMPLE, close, 20);
def lowerBand = mid -1 * sDev;
def upperBand = mid - (-1.918) * sDev;

def range = AbsValue(open - close);
def WAvg = WildersAverage(range, 20);
def avgVolume = ExpAverage(volume,50);
def bp= (close - low)/(high - low) > 0.75;
def sp = (high - close)/(high - low) > 0.75;
def up = close > open and range > Wavg and volume > avgVolume and bp;
def dn = close < open and range > wavg and volume > avgVolume and sp;

AddLabel(yes, " ");
assignbackgroundColor(
if RTH and !up and !dn then createcolor(0,132,193) else
if up then color.green else
if dn then color.red else createcolor(60,80,120));
iWnORoR.png
 
Hi all Thinkscript experts.
Can someone quickly look at this and see if it's possible to add MTF to this study?

def sDev = StDev(data = close, 20);
def mid = MovingAverage(AverageType.SIMPLE, close, 20);
def lowerBand = mid -1 * sDev;
def upperBand = mid - (-1.918) * sDev;

def range = AbsValue(open - close);
def WAvg = WildersAverage(range, 20);
def avgVolume = ExpAverage(volume,50);
def bp= (close - low)/(high - low) > 0.75;
def sp = (high - close)/(high - low) > 0.75;
def up = close > open and range > Wavg and volume > avgVolume and bp;
def dn = close < open and range > wavg and volume > avgVolume and sp;

plot hiupvol = if up and !up[1] then round(volume/1000,0) else double.nan;
hiupvol.setpaintingstrategy(paintingstrategy.values_below);
hiupvol.setdefaultcolor(color.green);
hiupvol.assignvaluecolor(if low < lowerBand and range > wavg and volume > avgVolume and bp then color.magenta else color.current);

plot hidnvol = if dn and !dn[1] then round(volume/1000,0) else double.nan;
hidnvol.setpaintingstrategy(paintingstrategy.values_above);
hidnvol.setdefaultcolor(color.red);
hidnvol.assignvaluecolor(if high > upperBand and range > wavg and volume > avgVolume and sp then color.magenta else color.current);

Thank you,
PT
 
Hi everyone,
Im sharing Doctor Stephen Harlins work he shared on his Twitter. He can be found here on Twitter. His posts are of tremendous value.
The tweet containing this work is here & here

According to him

" I'm sharing this code purely for educational purposes. Please don't trade this without fully understanding it. And I can't teach individuals how to import studies into ThinkorSwim or troubleshoot your platform, etc.

(2/3) The concept works best on a tick chart for reasons beyond the scope of this tweet. The study just says, "Show me (highlight) price bars that are above average in volume and price range, that also push the close well off of the high(selling press) or low (buying press)."

(3/3) That would highlight/infer the presence of "aggressive" orders. The white-tagged price bars display when the above conditions are met - plus an extreme in a high or low falls outside of a stDev calc (modif'd Bollinger Band). A forthcoming tweet will compliment this.

It looks like this.
View attachment 12382

FYI im simply sharing his work so the community can possibly benefit, I haven't gotten a chance to take it for a spin live.

Code:
plot zero = 0;
zero.setdefaultcolor(color.black);

addlabel(yes," Aggressive Buy ",createcolor(82,202,22));
addlabel(yes," Aggressive Sell ",color.red);
addlabel(yes," Stat Outlier ", color.white);
addlabel(yes," Overnight ", createcolor(60,80,120));

def seconds = SecondsFromTime(0);
def time = SecondsTillTime (1600);
def minutes = seconds / 3600;
def RTH = minutes > 8 and minutes < 16.5;

def sDev = StDev(data = close, 20);
def mid = MovingAverage(AverageType.SIMPLE, close, 20);
def lowerBand = mid -1 * sDev;
def upperBand = mid - (-1.918) * sDev;

def range = AbsValue(open - close);
def WAvg = WildersAverage(range, 20);
def avgVolume = ExpAverage(volume,50);
def bp= (close - low)/(high - low) > 0.75;
def sp = (high - close)/(high - low) > 0.75;
def up = close > open and range > Wavg and volume > avgVolume and bp;
def dn = close < open and range > wavg and volume > avgVolume and sp;

plot hiupvol = if up and !up[1] then round(volume/1000,0) else double.nan;
hiupvol.setpaintingstrategy(paintingstrategy.values_below);
hiupvol.setdefaultcolor(color.green);
hiupvol.assignvaluecolor(if low < lowerBand and range > wavg and volume > avgVolume and bp then color.white else color.current);
hiupvol.hidetitle();
plot hidnvol = if dn and !dn[1] then round(volume/1000,0) else double.nan;
hidnvol.setpaintingstrategy(paintingstrategy.values_above);
hidnvol.setdefaultcolor(color.red);
hidnvol.assignvaluecolor(if high > upperBand and range > wavg and volume > avgVolume and sp then color.white else color.current);
hidnvol.hidetitle();

DefineGlobalColor("color1",  createcolor(0,132,193)) ;
DefineGlobalColor("color2",  color.green) ;
DefineGlobalColor("color3",  color.red) ;
DefineGlobalColor("color4",  createcolor(60,80,120)) ;
assignpricecolor(if RTH and !up and !dn then GlobalColor("color1") else if up then GlobalColor("color2") else if dn then GlobalColor("color3") else GlobalColor("color4"));
INTERESTING! i cant tell what type of Volume is being used or is it just VOL ? .
 
INTERESTING! i cant tell what type of Volume is being used or is it just VOL ? .

The ToS platform data feeds just supply Volume there is no further demarkation as to "type" of volume.
Member's most common method of defining buying and selling volume is to denote all volume on a bullish candle as buying volume and all volume on a bearish candle as selling.

This is a poor approximation but as these type of buying/selling pressure scripts are some of the most popular on the forum, members seem to be finding value in them.
https://usethinkscript.com/tags/buysellpressure/
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
260 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