Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thanks, I was actually hoping to get whatever color the user had chosen for the ArrowDown; to use that same color in another place.
DefineGlobalColor("Arrow Down Color", Color.PINK);
def ma5 = Average(close, 5);
def ma13 = Average(close, 13);
plot arrow_down = ma5 crosses below ma13;
arrow_down.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
arrow_down.SetLineWeight(5);
arrow_down.AssignValueColor(GlobalColor("Arrow Down Color"));
AddLabel(yes, "This color will change when the user changes 'Arrow Down Color'", GlobalColor("Arrow Down Color"));
AddChartBubble(high == HighestAll(high), high, high, GlobalColor("Arrow Down Color"));
AddChartBubble(low == LowestAll(low), low, low, GlobalColor("Arrow Down Color"), 0);
#To define a custom color in TOS, plug the RGB codes into the following statement:
DefineGlobalColor("FunkyCoral", CreateColor(255, 175, 175)) ;
#To use a custom color use (put the name of variable you want colored before the dot)
your_arrow.SetDefaultColor(GlobalColor("FunkyCoral"));
AddLabel(emaShort, "EMA " + emaShort, (if AvgExpShort > AvgExpMid then Color.GREEN else Color.CYAN));
AddLabel(emaShort, "EMA " + emaShort, (if AvgExpShort > AvgExpMid then Color.GREEN else object.SetDefaultColor(GetColor(1))));
color.green;
I couldn't find it anywhere. The farther I got online, in think the green that is the same color as@mourningwood4521 The Learning Center is your friend... I keep at least one tab open to it at all times... Search there for "color" and you'll get results...
color.green
create color(0, 255, 0);
yeah I know I hate an entire palette, I was just trying to find the exact color match.@mourningwood4521 How about Color.DARK_GREEN... In all honesty, you have an entire palette to choose from or the named colors in TOS which you should have stumbled across in your research...
I have two plots but I want to be able to define them so I only have to access the global color and change it once rather than for both plots, how can I do this?Use "global" colors. https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/DefineGlobalColor
Define the global color, then use that color in all the places that you want to be changed when the user picks the color under the "global" tab in chart settings.
Ruby:DefineGlobalColor("Arrow Down Color", Color.PINK); def ma5 = Average(close, 5); def ma13 = Average(close, 13); plot arrow_down = ma5 crosses below ma13; arrow_down.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); arrow_down.SetLineWeight(5); arrow_down.AssignValueColor(GlobalColor("Arrow Down Color")); AddLabel(yes, "This color will change when the user changes 'Arrow Down Color'", GlobalColor("Arrow Down Color")); AddChartBubble(high == HighestAll(high), high, high, GlobalColor("Arrow Down Color")); AddChartBubble(low == LowestAll(low), low, low, GlobalColor("Arrow Down Color"), 0);
input UpperRange = 130.00;
input LowerRange = 131.00;
input showlabels = yes;
plot l1 = UpperRange;
plot l2 = LowerRange;
l1.SetDefaultColor(color.magenta);
l2.SetDefaultColor(color.magenta);
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
C | Code referencing other stocks not working properly | Questions | 2 | |
referencing FPL() in a strategy (to set a daily $ cap) | Questions | 1 | ||
M | Referencing Floating P/L (FPL()) in scans? | Questions | 2 | |
S | Referencing a custom study in Scan Hacker | Questions | 1 | |
M | Referencing FullK and FullD from Stochastic functions | Questions | 2 |
Start a new thread and receive assistance from our community.
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.
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.