Lower Study plotting Net Change of Multiple Stocks

justAnotherTrader

Member
VIP
VIP Enthusiast
I have searched everywhere for a solution to what I am looking for. The closest I found was this post here referencing how to add a chart as a lower study:

https://usethinkscript.com/threads/add-chart-as-a-lower-study.286/

What I would like is to plot multiple companies, say FB, NKE, WRK, COST ect in percentage form to get a sentiment of the market.

That is to say something along the lines of:

Plot FBclose = FB/FB[1], NKEclose = NKE/NKE[1], ect.....

I hope my explanation is clear. The idea is to get a general feel in chart form of the overall market sentiment using something other than say a vix indicator
 

boogz101

New member
VIP

Thanks for sharing the idea! I just put together something that works similarly to this idea with some visual improvements.

Code:
declare lower;

input SYMB1 = “AAPL”;
input SYMB2 = “AMZN”;
input SYMB3 = "TSLA";
input SYMB4 = "MSFT";
input SYMB5 = "GOOGL";

def data = high(SYMB1)/high(SYMB1)[1];
def data1 = high(SYMB2)/high(SYMB2)[1];
def data2 = high(SYMB3)/high(SYMB3)[1];
def data3 = high(SYMB4)/high(SYMB4)[1];
def data4 = high(SYMB5)/high(SYMB5)[1];

plot one = 1;
one.SetDefaultColor(color.gray);
one.HideBubble();

def sent = data + data1 + data2 + data3 + data4;
def sent1 = data and data1 and data2 and data3 and data4;
plot avg = sent/5;
avg.AssignValueColor(if avg > 1 then color.light_green else if avg < 1 then color.light_red else color.gray);

AddCloud(one,data,color.light_red,color.light_green);
AddCloud(one,data1,color.light_red,color.light_green);
AddCloud(one,data2,color.light_red,color.light_green);
AddCloud(one,data3,color.light_red,color.light_green);
AddCloud(one,data4,color.light_red,color.light_green);

AddLabel(yes, if sent1 > 1 then "Up" else if sent1 < 1 then "Dn" else"", if sent1 > 1 then color.green else if sent1 < 1 then color.red else color.gray);
 
Last edited:

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.
Top