# Lower Study plotting Net Change of Multiple Stocks

##### Active 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:

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

I figured it out my apologies.

For those interested something like this seems to work well:

declare lower;

plot data = high("FB")/high("FB")[1];

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);

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:

87k+ Posts
432 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?