How To Auto Plot Entry, Target, and Exit In ThinkOrSwim

modulus

New member
Pretty new to trading and TOS, but managed to read through a few threads and by splicing a some things together was able to create a study that I thought others might find useful.

I start my morning by checcking watcchlists, and then quickly navigate to the ccharts to plot pricec levels on each.
To save time and also have flexibility, what I wanted was a quick way to enter the data and have them charted without adding price levels to each and then copying, moving up and down, etc.

The following code allows you to enter 4 symbols, and then the pertinent data for each, and when you go to those charts the lines will propagate. If you go to charts without those symbols, the lines and text bubbles will be hidden. The data can be edited within the script or through the Options entry.
1720245230530.png

1720286383479.png

input Symbol1 = "NVDA";
input Entry1 = 125.38; # Stock Entry Price
input Target1a = 128.50; #Target Price 1
input Target1b = 130.00; #Target Price 2
input StopLimit1 = 124.75; #Stop Limit Price

input Symbol2 = "TSLA";
input Entry2 = 251.00; # Stock Entry Price
input Target2a = 255.00; #Target Price 1
input Target2b = 260.00; #Target Price 2
input StopLimit2 = 248.00; #Stop Limit Price

input Symbol3 = "PLTR";
input Entry3 = 27.00; # Stock Entry Price
input Target3a = 30.00; #Target Price 1
input Target3b = 32.00; #Target Price 2
input StopLimit3 = 25.50; #Stop Limit Price

input Symbol4 = "GME";
input Entry4 = 23.50; # Stock Entry Price
input Target4a = 25.50; #Target Price 1
input Target4b = 26.50; #Target Price 2
input StopLimit4 = 22.50; #Stop Limit Price

#Line Plots and Styles
plot p1;
p1.SetDefaultColor(Color.GREEN);
p1.SetStyle(Curve.MEDIUM_DASH);
plot p2;
p2.SetDefaultColor(CreateColor(255,154,253));
p2.SetStyle(Curve.MEDIUM_DASH);
plot p3;
p3.SetDefaultColor(CreateColor(255,95,248));
p3.SetStyle(Curve.MEDIUM_DASH);
plot p4;
p4.SetDefaultColor(CreateColor(231,235,120));
p4.SetStyle(Curve.MEDIUM_DASH);

def nan = double.NaN;

#If Then Variable Statements
if (GetSymbol() == Symbol1) then {
p1 = Entry1;
P2 = Target1a;
P3 = Target1b;
P4 = StopLimit1;

} else if (GetSymbol() == Symbol2) then {
p1 = Entry2;
p2 = Target2a;
p3 = Target2b;
p4 = StopLimit2;

} else if (GetSymbol() == Symbol3) then {
p1 = Entry3;
p2 = Target3a;
p3 = Target3b;
p4 = StopLimit3;

} else if (GetSymbol() == Symbol4) then {
p1 = Entry4;
p2 = Target4a;
p3 = Target4b;
p4 = StopLimit4;

} else {
p1 = nan;
p2 = nan;
p3 = nan;
p4 = nan;}

#Bubblemover

input bubblemoversideways = +10;
def b = bubblemoversideways;
def b1 = b + 1;
input bubblemoverupdown = 5;


#Bubbles
def Edge1 = !IsNaN(close) and IsNan(close[-1]);
AddChartBubble(
Edge1,
p1,
"Entry=" + AsText(p1),
p1.TakeValueColor()
);

def Edge2 = !IsNaN(close) and IsNaN(close[-1]);
AddChartBubble(
Edge2,
p2,
"SWEET!=" + AsText(p2),
p2.TakeValueColor()
);

def Edge3 = !IsNaN(close) and IsNaN(close[-1]);
AddChartBubble(
Edge3,
p3,
"SMASH!!=" + AsText(p3),
p3.TakeValueColor()
);

def Edge4 = !IsNaN(close) and IsNaN(close[-1]);
AddChartBubble(
Edge4,
p4,
"GET OUT=" + AsText(p4),
p4.TakeValueColor()
);
 

Attachments

  • 1720282613132.png
    1720282613132.png
    57.9 KB · Views: 106
Last edited:

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