Change opacity of cloud?

temtam

New member
Ok so I've got a set of indicators that use clouds, but it's almost always covering the price. This results in candles that are sometimes hard to see. I'm wondering if it's possible to change the opacity of the cloud, or maybe put the candles in front of the cloud study somehow.

As far as I know, you can only choose specific colors for clouds in the source code. You can change transparency with HSV colors, but my cloud doesn't show up in the "edit properties" window where you can switch to HSV. Is there maybe some way to import an HSV color to use on the cloud? Or make my cloud show up in the "edit properties" window? Any ideas?
 
@temtam You would need to modify the Study code and change the Color.<whatever> to use CreateColor(###, ###, ###)... Another way would be to use Global Colors... I'll leave t to you to research further in the Learning Center... Type in "Color" and you'll get results...
 
From funwiththinkscript

you can use an old function:
Code:
AddChart(high = h, low = l, open = o, close = c, type = ChartType.CANDLE, growcolor = color.black);
and work on the order of your plots to make sure it comes out on top (I never remember whether the first plots in your script are on top or on bottom, but ToS draws things in an order based on the order they appear in your script. There is a note in the funwiththinkscript page that says:

"[T]he AddChart() function was deprecated a few years ago and is no longer fully supported. i.e.—While it used to allow for different colors to be used for up, down, or neutral candles; it no longer does."

Use it at your own peril.

happy trading,
mashume
 
From funwiththinkscript

you can use an old function:
Code:
AddChart(high = h, low = l, open = o, close = c, type = ChartType.CANDLE, growcolor = color.black);
and work on the order of your plots to make sure it comes out on top (I never remember whether the first plots in your script are on top or on bottom, but ToS draws things in an order based on the order they appear in your script. There is a note in the funwiththinkscript page that says:

"[T]he AddChart() function was deprecated a few years ago and is no longer fully supported. i.e.—While it used to allow for different colors to be used for up, down, or neutral candles; it no longer does."

Use it at your own peril.

happy trading,
mashume
Here are two (candle and heiken ashi) workarounds for the deprecated addchart() function to create up/down colored candles.

Code:
#addchart - up/down  candle colors - workaround for the addchart() function not supported by TOS
def o = open;
def c = close;
def h = high;
def l = low;
AddChart(if c > o then h else Double.NaN,
         if c > o then l else Double.NaN,
         if c > o then c else Double.NaN,
         if c > o then o else Double.NaN,
         ChartType.CANDLE, Color.GREEN);
AddChart(if c < o then h else Double.NaN,
         if c < o then l else Double.NaN,
         if c < o then o else Double.NaN,
         if c < o then c else Double.NaN,
         ChartType.CANDLE, Color.RED);
AddChart(if c == o then h else Double.NaN,
         if c == o then l else Double.NaN,
         if c == o then o else Double.NaN,
         if c == o then c else Double.NaN,
         ChartType.CANDLE, Color.WHITE);

Code:
#addchart - up/down heiken ashi candle colors - workaround for the addchart() function not supported by TOS
def HAclose = (open + high + low + close) / 4;
def HAopen  = CompoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh  = Max(Max(high, HAopen), HAclose);
def HAlow   = Min(Min(low, HAopen), HAclose);

def o = haopen;
def c = haclose;
def h = hahigh;
def l = halow;

AddChart(if c > o then h else Double.NaN,
         if c > o then l else Double.NaN,
         if c > o then c else Double.NaN,
         if c > o then o else Double.NaN,
         ChartType.CANDLE, Color.GREEN);
AddChart(if c < o then h else Double.NaN,
         if c < o then l else Double.NaN,
         if c < o then o else Double.NaN,
         if c < o then c else Double.NaN,
         ChartType.CANDLE, Color.RED);
AddChart(if c == o then h else Double.NaN,
         if c == o then l else Double.NaN,
         if c == o then o else Double.NaN,
         if c == o then c else Double.NaN,
         ChartType.CANDLE, Color.WHITE);
 
@temtam You would need to modify the Study code and change the Color.<whatever> to use CreateColor(###, ###, ###)... Another way would be to use Global Colors... I'll leave t to you to research further in the Learning Center... Type in "Color" and you'll get results...
I did find CreateColor in the Learning Center but it only accepts 3 values and not the 4 that would be required for HSV, so it's only limited to RGB. Is there any way to set an HSV color as my global color?
 
@temtam No, RGB is the only way to use CreateColor()... There is no Thinkscript function that supports HSV as it is not a standard color convention... HSV can only be selected through the color palette panel...
 
From funwiththinkscript

you can use an old function:
Code:
AddChart(high = h, low = l, open = o, close = c, type = ChartType.CANDLE, growcolor = color.black);
and work on the order of your plots to make sure it comes out on top (I never remember whether the first plots in your script are on top or on bottom, but ToS draws things in an order based on the order they appear in your script. There is a note in the funwiththinkscript page that says:

"[T]he AddChart() function was deprecated a few years ago and is no longer fully supported. i.e.—While it used to allow for different colors to be used for up, down, or neutral candles; it no longer does."

Use it at your own peril.

happy trading,
mashume

@mashume Someone posted AddChart() code a few weeks ago and I played with it a bit... While it does work, it's a bit quirky... ;) (y)

Here are two (candle and heiken ashi) workarounds for the deprecated addchart() function to create up/down colored candles.

Hmm, I tried AddChart() and my clouds still print above it no matter the order of my indicators...

HxMY833.png


nMjh0ZE.png
 
@temtam Clouds will always paint above the candles regardless of the layer priority you may attempt to implement... I know it's frustrating but that's just a shortcoming of the TOS platform... I've played with the concept extensively and haven't found a work-around... I wish there was... :(
 

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