Looking for a drawing tool like TV/TC2000's Box/Profit

manxtrader

New member
TC2000 and TradeView have a drawing tool that allows you to create a rectangle from anywhere and it will tell you the profit potential. I knows TOS has the Quadrant, Rectangle, Trendline tools but I don't feel it's quite the same.

I was curious if someone had something similar already created or how difficult it would be to create it? Attached is a link to screen shot of an example.

 
Solution
TC2000 and TradeView have a drawing tool that allows you to create a rectangle from anywhere and it will tell you the profit potential. I knows TOS has the Quadrant, Rectangle, Trendline tools but I don't feel it's quite the same.

I was curious if someone had something similar already created or how difficult it would be to create it? Attached is a link to screen shot of an example.


here is something i put together, that is close.
you can enter 5 stocks and a high/low price for each one.

it draws a rectangle , starting at some quantity of bars before the last bar and goes to some quantity of bars after the last bar.

Ruby:
# boxrange_per_00

def na = double.nan;
def bn = barnumber();

def lastbarbn =...
TC2000 and TradeView have a drawing tool that allows you to create a rectangle from anywhere and it will tell you the profit potential. I knows TOS has the Quadrant, Rectangle, Trendline tools but I don't feel it's quite the same.

I was curious if someone had something similar already created or how difficult it would be to create it? Attached is a link to screen shot of an example.


here is something i put together, that is close.
you can enter 5 stocks and a high/low price for each one.

it draws a rectangle , starting at some quantity of bars before the last bar and goes to some quantity of bars after the last bar.

Ruby:
# boxrange_per_00

def na = double.nan;
def bn = barnumber();

def lastbarbn = HighestAll(If(IsNaN(close), 0, bn));
def lastbar = if (bn == lastbarbn) then 1 else 0;
#def lastbar = !isnan(close[0]) and isnan(close[-1]);


input sym1 = "SPY";
input s1_rng_hi = 0.0;
input s1_rng_lo = 0.0;

input sym2 = "TJX";
input s2_rng_hi = 0.0;
input s2_rng_lo = 0.0;

input sym3 = "WMT";
input s3_rng_hi = 0.0;
input s3_rng_lo = 0.0;

input sym4 = "Z";
input s4_rng_hi = 0.0;
input s4_rng_lo = 0.0;

input sym5 = "PM";
input s5_rng_hi = 0.0;
input s5_rng_lo = 0.0;


def rnghi;
def rnglo;
if GetSymbol() == sym1 then {
  rnghi = s1_rng_hi;
  rnglo = s1_rng_lo;
} else if GetSymbol() == sym2 then {
  rnghi = s2_rng_hi;
  rnglo = s2_rng_lo;
} else if GetSymbol() == sym3 then {
  rnghi = s3_rng_hi;
  rnglo = s3_rng_lo;
} else if GetSymbol() == sym4 then {
  rnghi = s4_rng_hi;
  rnglo = s4_rng_lo;
} else if GetSymbol() == sym5 then {
  rnghi = s5_rng_hi;
  rnglo = s5_rng_lo;
} else {
rnghi = 0;
rnglo = 0;
}

plot w1 = rnghi;
plot w2 = rnglo;
w1.setdefaultcolor(color.gray);
w2.setdefaultcolor(color.gray);

# ---------------------------
# box width,  based on last bar

input bars_before_lastbar = 25;
input bars_after_lastbar = 10;

def barsb = bars_before_lastbar;
def barsa = bars_after_lastbar;

def x = if ( lastbarbn - barsb) <= bn and ( lastbarbn + barsa) >= bn then 1 else 0;

def cloudtop = if (rnghi == 0 or rnglo == 0 or !x ) then na else rnghi;
addcloud(cloudtop, rnglo, color.light_gray);

# ---------------------------
# bubbles
def bubx = if !isnan(close[barsa+1]) and isnan(close[barsa+0]) then 1 else 0;
def hiper = round(100*(rnghi[barsa+1] - close[barsa+1])/close[barsa+1],1);
def loper = round(100*(rnglo[barsa+1] - close[barsa+1])/close[barsa+1],1);

def rngper = round(100*(rnghi - rnglo)/rnglo,1);
def y2 = (( rnghi-rnglo)*0.4 ) + rnglo;

addchartbubble( bubx, rnghi, rnghi + "\n" + hiper + " %", color.yellow, yes);
addchartbubble( bubx, rnglo, rnglo + "\n" + loper + " %", color.yellow, no);
addchartbubble( bubx, y2, rngper + " %", color.yellow, yes);
#


DuU4ESf.jpg


settings
XGQ3Syz.jpg
 
Last edited:
Solution

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