color change depending if close over/under level?

CaseyPlays_

New member
I have a strategy that I made to easily put in levels I'm watching currently I have them separated into Sup/Res and have to manually change them each day. Is there a way I can change this to just a list of levels and the color will change depending on if close over/under level?

Code:
input resistance1 = 0;
input resistance2 = 0;
input resistance3 = 0;
input resistance4 = 0;
input resistance5 = 0;
input resistance6 = 0;
input resistance7 = 0;
input resistance8 = 0;
input resistance9 = 0;
input resistance10 = 0;

input support1 = 0;
input support2 = 0;
input support3 = 0;
input support4 = 0;
input support5 = 0;
input support6 = 0;
input support7 = 0;
input support8 = 0;
input support9 = 0;
input support10 = 0;

plot line_1 = resistance1; line_1.SetDefaultColor(Color.red);
plot line_2 = resistance2; line_2.SetDefaultColor(Color.red);
plot line_3 = resistance3; line_3.SetDefaultColor(Color.red);
plot line_4 = resistance4; line_4.SetDefaultColor(Color.red);
plot line_5 = resistance5; line_5.SetDefaultColor(Color.red);
plot line_6 = resistance6; line_6.SetDefaultColor(Color.red);
plot line_7 = resistance7; line_7.SetDefaultColor(Color.red);
plot line_8 = resistance8; line_8.SetDefaultColor(Color.red);
plot line_9 = resistance9; line_9.SetDefaultColor(Color.red);
plot line_10 = resistance10; line_10.SetDefaultColor(Color.red);

plot line_11 = support1; line_11.SetDefaultColor(Color.blue);
plot line_12 = support2; line_12.SetDefaultColor(Color.blue);
plot line_13 = support3; line_13.SetDefaultColor(Color.blue);
plot line_14 = support4; line_14.SetDefaultColor(Color.blue);
plot line_15 = support5; line_15.SetDefaultColor(Color.blue);
plot line_16 = support6; line_16.SetDefaultColor(Color.blue);
plot line_17 = support7; line_17.SetDefaultColor(Color.blue);
plot line_18 = support8; line_18.SetDefaultColor(Color.blue);
plot line_19 = support9; line_19.SetDefaultColor(Color.blue);
plot line_20 = support10; line_20.SetDefaultColor(Color.blue);
 
I have a strategy that I made to easily put in levels I'm watching currently I have them separated into Sup/Res and have to manually change them each day. Is there a way I can change this to just a list of levels and the color will change depending on if close over/under level?

Code:
input resistance1 = 0;
input resistance2 = 0;
input resistance3 = 0;
input resistance4 = 0;
input resistance5 = 0;
input resistance6 = 0;
input resistance7 = 0;
input resistance8 = 0;
input resistance9 = 0;
input resistance10 = 0;

input support1 = 0;
input support2 = 0;
input support3 = 0;
input support4 = 0;
input support5 = 0;
input support6 = 0;
input support7 = 0;
input support8 = 0;
input support9 = 0;
input support10 = 0;

plot line_1 = resistance1; line_1.SetDefaultColor(Color.red);
plot line_2 = resistance2; line_2.SetDefaultColor(Color.red);
plot line_3 = resistance3; line_3.SetDefaultColor(Color.red);
plot line_4 = resistance4; line_4.SetDefaultColor(Color.red);
plot line_5 = resistance5; line_5.SetDefaultColor(Color.red);
plot line_6 = resistance6; line_6.SetDefaultColor(Color.red);
plot line_7 = resistance7; line_7.SetDefaultColor(Color.red);
plot line_8 = resistance8; line_8.SetDefaultColor(Color.red);
plot line_9 = resistance9; line_9.SetDefaultColor(Color.red);
plot line_10 = resistance10; line_10.SetDefaultColor(Color.red);

plot line_11 = support1; line_11.SetDefaultColor(Color.blue);
plot line_12 = support2; line_12.SetDefaultColor(Color.blue);
plot line_13 = support3; line_13.SetDefaultColor(Color.blue);
plot line_14 = support4; line_14.SetDefaultColor(Color.blue);
plot line_15 = support5; line_15.SetDefaultColor(Color.blue);
plot line_16 = support6; line_16.SetDefaultColor(Color.blue);
plot line_17 = support7; line_17.SetDefaultColor(Color.blue);
plot line_18 = support8; line_18.SetDefaultColor(Color.blue);
plot line_19 = support9; line_19.SetDefaultColor(Color.blue);
plot line_20 = support10; line_20.SetDefaultColor(Color.blue);
i don't understand. that is a list of 20 levels. what kind of list do you want?


do you want to pick a list and have 20 different numbers be plotted?
that is 1 group of 20 lines.
example,
Do you want to have 5 groups of 20, and type in a 100 numbers, one time?
then each day, you would pick a group number, 1 to 5, to have a group of 20 numbers plotted as lines?

that is doable
changing color is doable
 

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