Dynamic Risk Reward Study For ThinkOrSwim

digitalml

New member
Couldn't find a working dynamic Risk Reward Ratio study so I decided to make one. This will plot a stop and profit cloud dynamically based on number of shares and entry price. I just used simple percentages and it's only for Long positions but I commented and I'm sure you can adjust the study as you see fit. This uses the portfolio functions and you'll need to have TD turn on "Advanced Features" for it to work for you. Also make sure to turn off "Fit Studies".

Never really contributed to the forums but have gotten so much help and great stuff here, so thank you everyone!

Rich (BB code):

		
		
	


	
RRChart-SS.png
#digitalml 10/27/2021 v1 input sl_percent = 2.0; input rr_ratio = 3; input showClouds = yes; input showBubbles = yes; #number of shares of your position def shares = GetQuantity(); #the price you bought in at plot entry_price = GetAveragePrice(); #plot the stop price plot stop = entry_price - (entry_price * (sl_percent / 100)); stop.setdefaultcolor(Color.RED); stop.setlineweight(1); #plot the entry price plot profit = entry_price + ((entry_price * (sl_percent * rr_ratio)) / 100); profit.setdefaultcolor(Color.GREEN); profit.setlineweight(1); #add the clouds AddCloud(if showClouds then entry_price else Double.NaN, stop, Color.RED, Color.RED); AddCloud(if showClouds then entry_price else Double.NaN, profit, Color.GREEN, Color.GREEN);
 
Couldn't find a working dynamic Risk Reward Ratio study so I decided to make one. This will plot a stop and profit cloud dynamically based on number of shares and entry price. I just used simple percentages and it's only for Long positions but I commented and I'm sure you can adjust the study as you see fit. This uses the portfolio functions and you'll need to have TD turn on "Advanced Features" for it to work for you. Also make sure to turn off "Fit Studies".

Never really contributed to the forums but have gotten so much help and great stuff here, so thank you everyone!

Rich (BB code):
View attachment 2695
#digitalml 10/27/2021 v1

input sl_percent = 2.0;
input rr_ratio = 3;
input showClouds = yes;
input showBubbles = yes;

#number of shares of your position
def shares = GetQuantity();

#the price you bought in at
plot entry_price = GetAveragePrice();

#plot the stop price
plot stop = entry_price - (entry_price * (sl_percent / 100));
stop.setdefaultcolor(Color.RED);
stop.setlineweight(1);

#plot the entry price
plot profit = entry_price + ((entry_price * (sl_percent * rr_ratio)) / 100);
profit.setdefaultcolor(Color.GREEN);
profit.setlineweight(1);

#add the clouds
AddCloud(if showClouds then entry_price else Double.NaN, stop, Color.RED, Color.RED);
AddCloud(if showClouds then entry_price else Double.NaN, profit, Color.GREEN, Color.GREEN);
This is an awesome indicator bro, thank you so much for sharing.
 

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