VSA Spread Analysis For ThinkOrSwim

Rrm411

Member
Hello All,

Could anyone help us to get this indicator in TOS, I found very useful in volume spread analysis, we have Heatmap volume Indicator by Samer800 and the below one different and very useful one.
@samer800 @BenTen Please help us to get this Indicator in TOS, Thanks in advance.

Volume spread Analysis - VSA

17617[/ATTACH]']
OCEcUIz.jpg
 

Attachments

  • OCEcUIz.jpg
    OCEcUIz.jpg
    148.5 KB · Views: 187
Last edited:
Hello All,

Could anyone help us to get this indicator in TOS, I found very useful in volume spread analysis, we have Heatmap volume Indicator by Samer800 and the below one different and very useful one.
@samer800 @BenTen Please help us to get this Indicator in TOS, Thanks in advance.

Volume spread Analysis - VSA

17628[/ATTACH]']
OCEcUIz.jpg
check the below

CSS:
#//@HariprasathGopal
#study("Spread Analysis")
# Converted by Sam4Cok@Samer800 - 02/2023
declare lower;
declare Zerobase;
input BackgroundColor = yes;
input ShowMovAvgLine = yes;
input MovAvgLength = 30;
input MovAvgType = AverageType.SIMPLE;

def na = Double.NaN;
def pos = Double.POSITIVE_INFINITY;
def neg = Double.NEGATIVE_INFINITY;
def spread = high - low;
def avg_spread = MovingAverage(MovAvgType, spread, MovAvgLength);

def Lev1 = (spread > 4 * avg_spread);
def Lev2 = (spread > 2 * avg_spread) and (spread < 4 * avg_spread);
def Lev3 = (spread < avg_spread * 0.5);
def Lev4 = (spread > avg_spread * 0.5) and (spread < avg_spread * 1.1);
def color = if Lev1 then 4 else
            if Lev2 then 3 else
            if Lev3 then 2 else
            if Lev4 then 1 else 0;

def Line1 = if !BackgroundColor then na else 4 * avg_spread;
def Line2 = if !BackgroundColor then na else 2 * avg_spread;
def Line3 = if !BackgroundColor then na else 1.1 * avg_spread;
def Line4 = if !BackgroundColor then na else 0.5 * avg_spread;

AddCloud(pos  , Line1, CreateColor(179,0,179));
AddCloud(Line1, Line2, CreateColor(179,0,0));
AddCloud(Line2, Line3, CreateColor(0,0,179));
AddCloud(Line3, Line4, CreateColor(0,179,0));
AddCloud(Line4, neg  , CreateColor(179,179,0));

# Plot the new Chart
plot AvgSpread = if !ShowMovAvgLine then na else avg_spread;
AvgSpread.SetDefaultColor(Color.CYAN);

plot SpreadHist = spread;
SpreadHist.SetLineWeight(3);
SpreadHist.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
SpreadHist.AssignValueColor(if color==4 then Color.MAGENTA else
                            if color==3 then Color.RED else
                            if color==2 then Color.BLUE else
                            if color==1 then CreateColor(0,128,0) else Color.YELLOW);


#--- END CODE
 

Attachments

  • OCEcUIz.jpg
    OCEcUIz.jpg
    148.5 KB · Views: 175
check the below

CSS:
#//@HariprasathGopal
#study("Spread Analysis")
# Converted by Sam4Cok@Samer800 - 02/2023
declare lower;
declare Zerobase;
input BackgroundColor = yes;
input ShowMovAvgLine = yes;
input MovAvgLength = 30;
input MovAvgType = AverageType.SIMPLE;

def na = Double.NaN;
def pos = Double.POSITIVE_INFINITY;
def neg = Double.NEGATIVE_INFINITY;
def spread = high - low;
def avg_spread = MovingAverage(MovAvgType, spread, MovAvgLength);

def Lev1 = (spread > 4 * avg_spread);
def Lev2 = (spread > 2 * avg_spread) and (spread < 4 * avg_spread);
def Lev3 = (spread < avg_spread * 0.5);
def Lev4 = (spread > avg_spread * 0.5) and (spread < avg_spread * 1.1);
def color = if Lev1 then 4 else
            if Lev2 then 3 else
            if Lev3 then 2 else
            if Lev4 then 1 else 0;

def Line1 = if !BackgroundColor then na else 4 * avg_spread;
def Line2 = if !BackgroundColor then na else 2 * avg_spread;
def Line3 = if !BackgroundColor then na else 1.1 * avg_spread;
def Line4 = if !BackgroundColor then na else 0.5 * avg_spread;

AddCloud(pos  , Line1, CreateColor(179,0,179));
AddCloud(Line1, Line2, CreateColor(179,0,0));
AddCloud(Line2, Line3, CreateColor(0,0,179));
AddCloud(Line3, Line4, CreateColor(0,179,0));
AddCloud(Line4, neg  , CreateColor(179,179,0));

# Plot the new Chart
plot AvgSpread = if !ShowMovAvgLine then na else avg_spread;
AvgSpread.SetDefaultColor(Color.CYAN);

plot SpreadHist = spread;
SpreadHist.SetLineWeight(3);
SpreadHist.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
SpreadHist.AssignValueColor(if color==4 then Color.MAGENTA else
                            if color==3 then Color.RED else
                            if color==2 then Color.BLUE else
                            if color==1 then CreateColor(0,128,0) else Color.YELLOW);


#--- END CODE
Thank you @samer800, appreciated you effort.
 
Thanks for help, I put this into the scanner however it doesn't scan for ultra high candles, I don't know maybe I do something wrong?
Sorry, cannot be of any further help. The VSA does not have a definition for "ultra high candles"
 

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
382 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