• Get $30 off VIP with code SUMMER30. Ends July 27. Happy trading!

THINKorSWIM RISK REWARD INDICATOR

generic

Active member
@rwfarrell @hockeycoachdoug Only works for long, I'll add short to it if you guys are gonna use this.
Code:
input amount = 2000;
input risk = 100;
input price = 2.75;
input ratio = 2;

def shares = floor(amount / price);
plot stop = if isnan(close[-1]) then round((amount - risk) / shares) else double.nan;
plot entry = if isnan(close[-1]) then price else double.nan;
plot t1 = if isnan(close[-1]) then price + ratio * (price - stop) else double.nan;
plot t2 = if isnan(close[-1]) then price + (2 * ratio) * (price - stop) else double.nan;
plot t3 = if isnan(close[-1]) then price + (3 * ratio) * (price - stop) else double.nan;

addcloud(price, stop, color.gray, color.gray);
addcloud(t1, t2, color.green, color.green);
addcloud(t2, t3, color.light_green, color.light_green);

addchartbubble(isnan(close[2]) and !isnan(close[3]), price, price, color.white);
addchartbubble(isnan(close[2]) and !isnan(close[3]), t1, "T1 $" + t1, color.green);
addchartbubble(isnan(close[2]) and !isnan(close[3]), t2, "T2 $" + t2, color.green);
addchartbubble(isnan(close[2]) and !isnan(close[3]), t3, "T3 $" + t3, color.green);
addchartbubble(isnan(close[2]) and !isnan(close[3]), stop, "STOP $" + stop, color.red, no);
addchartbubble(isnan(close[10]) and !isnan(close[11]), price, "SHARES:" + shares, color.yellow);
 
Last edited:

c0der

New member
I'm interested too, but preferably one that pins at current price, puts stops at prior swing low and also suitable for options spreads too.
 

Britt95

New member
@rwfarrell @hockeycoachdoug Only works for long, I'll add short to it if you guys are gonna use this.
Code:
input amount = 2000;
input risk = 100;
input price = 2.75;
input ratio = 2;

def shares = floor(amount / price);
plot stop = if isnan(close[-1]) then round((amount - risk) / shares) else double.nan;
plot entry = if isnan(close[-1]) then price else double.nan;
plot t1 = if isnan(close[-1]) then price + ratio * (price - stop) else double.nan;
plot t2 = if isnan(close[-1]) then price + (2 * ratio) * (price - stop) else double.nan;
plot t3 = if isnan(close[-1]) then price + (3 * ratio) * (price - stop) else double.nan;

addcloud(price, stop, color.gray, color.gray);
addcloud(t1, t2, color.green, color.green);
addcloud(t2, t3, color.light_green, color.light_green);

addchartbubble(isnan(close[2]) and !isnan(close[3]), price, price, color.white);
addchartbubble(isnan(close[2]) and !isnan(close[3]), t1, "T1 $" + t1, color.green);
addchartbubble(isnan(close[2]) and !isnan(close[3]), t2, "T2 $" + t2, color.green);
addchartbubble(isnan(close[2]) and !isnan(close[3]), t3, "T3 $" + t3, color.green);
addchartbubble(isnan(close[2]) and !isnan(close[3]), stop, "STOP $" + stop, color.red, no);
addchartbubble(isnan(close[10]) and !isnan(close[11]), price, "SHARES:" + shares, color.yellow);
Wow this is an AWESOME indicator!! I’ve been using an excel spreadsheet to calculate risk to reward and share size, this indicator really simplifies it!
I am short biased in the market. I was curious if you would you mind creating the indicator to go short as well?? Thank you in advance!!
 

adefrenza

New member
VIP
Wow this is an AWESOME indicator!! I’ve been using an excel spreadsheet to calculate risk to reward and share size, this indicator really simplifies it!
I am short biased in the market. I was curious if you would you mind creating the indicator to go short as well?? Thank you in advance!!
Yes, please add short.
 

rkwchu

New member
VIP
I had modified the codes contributed by "Generic" to allow for Long and Short trade

Code:
input action = {Default "Long","Short"};
input price = 2.75;
input amount = 2000;
input risk = 100;
input ratio = 2;

def shares = Floor(amount / price);
plot stop;
switch (action) {
case Long:
stop = if isnan(close[-1]) then round((amount - risk) / shares)
              else double.nan;
Case Short:
stop = if isnan(close[-1]) then round((amount + risk) / shares)
              else double.nan;}

plot entry = if isnan(close[-1]) then price else double.nan;
plot t1 = if isnan(close[-1]) then price + ratio * (price - stop) else double.nan;
plot t2 = if isnan(close[-1]) then price + (2 * ratio) * (price - stop) else double.nan;
plot t3 = if isnan(close[-1]) then price + (3 * ratio) * (price - stop) else double.nan;
AddCloud(price, stop, Color.GRAY, Color.GRAY);
AddCloud(t1, t2, Color.GREEN, Color.GREEN);
AddCloud(t2, t3, Color.LIGHT_GREEN, Color.LIGHT_GREEN);

AddChartBubble(IsNaN(close[2]) and !IsNaN(close[3]), price, price, Color.WHITE);
AddChartBubble(IsNaN(close[2]) and !IsNaN(close[3]), t1, "T1 $" + t1, Color.GREEN);
AddChartBubble(IsNaN(close[2]) and !IsNaN(close[3]), t2, "T2 $" + t2, Color.GREEN);
AddChartBubble(IsNaN(close[2]) and !IsNaN(close[3]), t3, "T3 $" + t3, Color.GREEN);
AddChartBubble(IsNaN(close[2]) and !IsNaN(close[3]), stop, "STOP $" + stop, Color.RED, no);
AddChartBubble(IsNaN(close[10]) and !IsNaN(close[11]), price, "SHARES:" + shares, Color.YELLOW);
 

us3r001

New member
I thought it was supposed to act as price lines, where you click&drag to move them.
This one I have to manually change entry price if I wanna slide the whole study up / down.
 

generic

Active member
@rktrader Watch the video from post #1. From what I saw you put how much your position size into amount, put the amount you're willing to risk, and decide on a risk to reward ratio and it'll plot where you should exit.
 
Top