make script for watchlist column to addlabel or chartbubble format

Feniks2020

New member
Is there a way to convert this script I wrote for my custom watchlist to show as a ChartBubble on the top right hand side of my chart.....or maybe an AddLabel conversion that will change colors with the corresponding data???? When I use addlabel that turns "RED" I can't see the numbers as well. Is it possible to change Value colors on "AddLabel" scripts??? I couldn't figure it out. Any assistance would be greatly appreciated!!
Thanks in Advance



def ValueRSUD = RSI()."RSI" + StochRSI()."FullK" + StochasticFull()."FullK";
def Avg = ValueRSUD/3;
plot Diff = Avg*1;
Diff.DefineColor("RU3", Color.DARK_GREEN);
Diff.DefineColor("RU2", Color.GREEN);
Diff.DefineColor("RU1", Color.LIGHT_GREEN);
Diff.DefineColor("NRML", Color.PINK);
Diff.DefineColor("RD1", Color.RED);
Diff.DefineColor("RD2", Color.DARK_RED);
Diff.DefineColor("RD3", Color.BLACK);
Diff.DefineColor("blk", Color.BLACK);
Diff.DefineColor("wht", Color.WHITE);
Diff.AssignValueColor(if Diff >=88.35 then Diff.Color("wht")
else if Diff <= 88.34 and Diff >= 83.33 then Diff.Color("blk")
else if Diff <= 83.32 and Diff >= 76.67 then Diff.Color("blk")
else if Diff <= 76.66 and Diff >= 23.34 then Diff.Color("blk")
else if Diff <= 23.33 and Diff >= 16.67 then Diff.Color("wht")
else if Diff <= 16.66 and Diff >= 5 then Diff.Color("wht")
else if Diff <= 4.99 and Diff >= 0.1 then Diff.Color("wht")
else Color.WHITE);
AssignBackgroundColor(if Diff >88.35 then Diff.Color("RU3")
else if Diff <= 88.34 and Diff >= 83.33 then Diff.Color("RU2")
else if Diff <= 83.32 and Diff >= 76.67 then Diff.Color("RU1")
else if Diff <= 76.66 and Diff >= 23.34 then Diff.Color("NRML")
else if Diff <= 23.33 and Diff >= 16.67 then Diff.Color("RD1")
else if Diff <= 16.66 and Diff >= 5 then Diff.Color("RD2")
else if Diff <= 4.99 and Diff >= 0.1 then Diff.Color("RD3")
else Color.BLACK);
 
Solution
Is there a way to convert this script I wrote for my custom watchlist to show as a ChartBubble on the top right hand side of my chart.....or maybe an AddLabel conversion that will change colors with the corresponding data???? When I use addlabel that turns "RED" I can't see the numbers as well. Is it possible to change Value colors on "AddLabel" scripts??? I couldn't figure it out. Any assistance would be greatly appreciated!!
Thanks in Advance



def ValueRSUD = RSI()."RSI" + StochRSI()."FullK" + StochasticFull()."FullK";
def Avg = ValueRSUD/3;
plot Diff = Avg*1;
Diff.DefineColor("RU3", Color.DARK_GREEN);
Diff.DefineColor("RU2", Color.GREEN);
Diff.DefineColor("RU1", Color.LIGHT_GREEN);
Diff.DefineColor("NRML", Color.PINK)...
Is there a way to convert this script I wrote for my custom watchlist to show as a ChartBubble on the top right hand side of my chart.....or maybe an AddLabel conversion that will change colors with the corresponding data???? When I use addlabel that turns "RED" I can't see the numbers as well. Is it possible to change Value colors on "AddLabel" scripts??? I couldn't figure it out. Any assistance would be greatly appreciated!!
Thanks in Advance



def ValueRSUD = RSI()."RSI" + StochRSI()."FullK" + StochasticFull()."FullK";
def Avg = ValueRSUD/3;
plot Diff = Avg*1;
Diff.DefineColor("RU3", Color.DARK_GREEN);
Diff.DefineColor("RU2", Color.GREEN);
Diff.DefineColor("RU1", Color.LIGHT_GREEN);
Diff.DefineColor("NRML", Color.PINK);
Diff.DefineColor("RD1", Color.RED);
Diff.DefineColor("RD2", Color.DARK_RED);
Diff.DefineColor("RD3", Color.BLACK);
Diff.DefineColor("blk", Color.BLACK);
Diff.DefineColor("wht", Color.WHITE);
Diff.AssignValueColor(if Diff >=88.35 then Diff.Color("wht")
else if Diff <= 88.34 and Diff >= 83.33 then Diff.Color("blk")
else if Diff <= 83.32 and Diff >= 76.67 then Diff.Color("blk")
else if Diff <= 76.66 and Diff >= 23.34 then Diff.Color("blk")
else if Diff <= 23.33 and Diff >= 16.67 then Diff.Color("wht")
else if Diff <= 16.66 and Diff >= 5 then Diff.Color("wht")
else if Diff <= 4.99 and Diff >= 0.1 then Diff.Color("wht")
else Color.WHITE);
AssignBackgroundColor(if Diff >88.35 then Diff.Color("RU3")
else if Diff <= 88.34 and Diff >= 83.33 then Diff.Color("RU2")
else if Diff <= 83.32 and Diff >= 76.67 then Diff.Color("RU1")
else if Diff <= 76.66 and Diff >= 23.34 then Diff.Color("NRML")
else if Diff <= 23.33 and Diff >= 16.67 then Diff.Color("RD1")
else if Diff <= 16.66 and Diff >= 5 then Diff.Color("RD2")
else if Diff <= 4.99 and Diff >= 0.1 then Diff.Color("RD3")
else Color.BLACK);

Regrettably, you can not change the color of a value in a label.

Here is code to display this as a label.
Capture.jpg
Ruby:
def ValueRSUD = RSI()."RSI" + StochRSI()."FullK" + StochasticFull()."FullK";
def Avg = ValueRSUD / 3;

plot Diff = Avg * 1;
Diff.DefineColor("RU3", Color.DARK_GREEN);
Diff.DefineColor("RU2", Color.GREEN);
Diff.DefineColor("RU1", Color.LIGHT_GREEN);
Diff.DefineColor("NRML", Color.PINK);
Diff.DefineColor("RD1", Color.RED);
Diff.DefineColor("RD2", Color.DARK_RED);
Diff.DefineColor("RD3", Color.BLACK);
Diff.DefineColor("blk", Color.BLACK);
Diff.DefineColor("wht", Color.WHITE);
Diff.AssignValueColor(if Diff >= 88.35 then Diff.Color("wht")
else if Diff <= 88.34 and Diff >= 83.33 then Diff.Color("blk")
else if Diff <= 83.32 and Diff >= 76.67 then Diff.Color("blk")
else if Diff <= 76.66 and Diff >= 23.34 then Diff.Color("blk")
else if Diff <= 23.33 and Diff >= 16.67 then Diff.Color("wht")
else if Diff <= 16.66 and Diff >= 5 then Diff.Color("wht")
else if Diff <= 4.99 and Diff >= 0.1 then Diff.Color("wht")
else Color.WHITE);
Diff.SetHiding(yes);

input showlabel = yes;
AddLabel(showlabel, Diff,
if Diff > 88.35 then Diff.Color("RU3")
else if Diff <= 88.34 and Diff >= 83.33 then Diff.Color("RU2")
else if Diff <= 83.32 and Diff >= 76.67 then Diff.Color("RU1")
else if Diff <= 76.66 and Diff >= 23.34 then Diff.Color("NRML")
else if Diff <= 23.33 and Diff >= 16.67 then Diff.Color("RD1")
else if Diff <= 16.66 and Diff >= 5 then Diff.Color("RD2")
else if Diff <= 4.99 and Diff >= 0.1 then Diff.Color("RD3")
else Color.BLACK);

The bubble is possible, but will disappear when you scroll the chart.
I have shown it in the image above in the upper right corner.
To use it, the script is declared lower and is moved from the lower pane to the upper pane.

Ruby:
declare lower;

def ValueRSUD = RSI()."RSI" + StochRSI()."FullK" + StochasticFull()."FullK";
def Avg = ValueRSUD / 3;

plot Diff = Avg * 1;
Diff.DefineColor("RU3", Color.DARK_GREEN);
Diff.DefineColor("RU2", Color.GREEN);
Diff.DefineColor("RU1", Color.LIGHT_GREEN);
Diff.DefineColor("NRML", Color.PINK);
Diff.DefineColor("RD1", Color.RED);
Diff.DefineColor("RD2", Color.DARK_RED);
Diff.DefineColor("RD3", Color.BLACK);
Diff.DefineColor("blk", Color.BLACK);
Diff.DefineColor("wht", Color.WHITE);
Diff.AssignValueColor(if Diff >= 88.35 then Diff.Color("wht")
else if Diff <= 88.34 and Diff >= 83.33 then Diff.Color("blk")
else if Diff <= 83.32 and Diff >= 76.67 then Diff.Color("blk")
else if Diff <= 76.66 and Diff >= 23.34 then Diff.Color("blk")
else if Diff <= 23.33 and Diff >= 16.67 then Diff.Color("wht")
else if Diff <= 16.66 and Diff >= 5 then Diff.Color("wht")
else if Diff <= 4.99 and Diff >= 0.1 then Diff.Color("wht")
else Color.WHITE);
Diff.SetHiding(yes);

input showbubble  = yes;
input bubblemover = 3;

def bm  = bubblemover;
def bm1 = bm + 1;

plot line0   = 0;
line0.SetDefaultColor(Color.BLACK);
plot line100 = 100;
line100.SetDefaultColor(Color.BLACK);

AddChartBubble(showbubble and IsNaN(close[bm]) and !IsNaN(close[bm1]),
               100,
               Diff[bm1],
if Diff[bm1] > 88.35 then Diff.Color("RU3")
else if Diff[bm1] <= 88.34 and Diff[bm1] >= 83.33 then Diff.Color("RU2")
else if Diff[bm1] <= 83.32 and Diff[bm1] >= 76.67 then Diff.Color("RU1")
else if Diff[bm1] <= 76.66 and Diff[bm1] >= 23.34 then Diff.Color("NRML")
else if Diff[bm1] <= 23.33 and Diff[bm1] >= 16.67 then Diff.Color("RD1")
else if Diff[bm1] <= 16.66 and Diff[bm1] >= 5 then Diff.Color("RD2")
else if Diff[bm1] <= 4.99 and Diff[bm1] >= 0.1 then Diff.Color("RD3")
else Color.BLACK, no);
 
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
321 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