New here, looking for red/green rectangle


New member
Hello, ive been visiting this forum for a couple weeks, love the content and usefulness the site. Looking for 2 things that i couldn't find in the search.
1. The ticker symbol in the background of the chart , not really necessary i know, but it looks cool.
2. Many YouTube tutorials have the green/red, reward/risk rectangle, i know that tos has a rectangle but i have to build 2 every time and then change the color.


Staff member
1. ThinkorSwim doesn't display the ticker symbol in the background, instead, they display the company's logo. It's shown by default. Just look at the top left-hand corner of your chart.

2. Not possible. I know what you're referring to but ToS doesn't have it.


New member
@BenTen is it possible to help me modify this code to switch between the amount of Consecutive Green Heikin Ashi candles after a Red Heikin Ashi candle.

This code finds the last two Consecutive Green Heikin Ashi candles after a Red Heikin Ashi candle but i wanted to lets say add three or even four candles.
def haClose = ohlc4;
def haOpen = if haOpen[1] == 0 then haClose[1] else (haOpen[1] + haClose[1]) / 2;
def haHigh = Max(high, Max(haClose, haOpen));
def haLow = Min(low, Min(haClose, haOpen));
def haColor = haClose > haOpen;
def trendUp = haColor and haColor[1] and !haColor[2];
plot scan = trendUp;


New member
Hi Everyone,

I had tried searching through the forum to see if anyone had created a similar indicator/tool and the only thread I could find was this one:

It's kind of close to what I would like to have but unfortunately it looks as though it was never actually created. I've provided some screenshots of TradingView's position calculator where you can choose Long or Short and it will automatically tell you how many shares you can purchase based on your input.


Here are the parameter settings for the position calculator:


You can set it by your total account and the amount of risk (in USD or %) you want. It will automatically calculate the number of shares based on your entry, stop, and risk amount.

This is if you wanted to change colors and other style settings:


It would be great to have something like this within ToS so that I no longer have to try and set this up on TradingView and then scramble to place an order on ToS. If it's easier to create and less work, I can forgo the take profit level as I really just want to be able to show/mark my entry and stop loss and have the number of shares I can purchase all visible and automatically calculated based on my settings.

Is this possible to create within thinkscript? If anyone has any thoughts/ideas or know of something similar or has some partial code that can be tweaked, please let me know as it would be greatly appreciated. Thanks!


New member
i asked the same question a couple weeks back. The answer was no. I talked to the Tos platform nerd on the phone, and he had no clue what I was talking about