AddCloud Color in Edit Studies Dialog


Category:
0
0

Pete,

Do you know if it’s possible to change the “AddCloud” Color using the Edit Studies Dialog (as opposed to specifying the AddCloud Color in the code)?

Example:  AddCloud(DataValue1, DataValue2, Color.VIOLET, Color.PINK);

I tried to configure this to using a global color (and) a default color – but I cant get the syntax right… I would like to do this in the dialog to keep from having to modify the code when I want to use a different color – but maybe it’s not possible…

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on January 30, 2022 12:04 pm
199 views
0
You can’t input colors but you can input numbers, so you could use the GetColor() function inside the addcloud. Would have to input and switch on the two colors you want to use. Example of one color : (number values might not be right) input ColorTypeOne = {default red, blue, green} ; def ColorOne; switch(ColorTypeOne){ case red: ColorOne = 5; case blue: ColorOne = 6; case green: ColorOne = 9; } AddCloud(DataValue1, DataValue2, GetColor(ColorOne), GetColor(ColorTwo));
( at February 1, 2022 9:03 pm)
0
Private answer

I moved your question out of the "Frequently Asked Questions" topic and into the "Chart Studies" topic.

In this forum it's important to provide a fully functional section of code. The code you included in your question is incomplete, meaning that you have two variables which were not previously declared or assigned a value. So I will not be able to provide a solution using your specific section of code.

However you are on the right track in that you must use DefineGlobalColor() method to acheive this. There are many examples of this already posted throughout this forum. You will also find many examples in the various free tools published with our tutorial videos.

I suggest you examine the solution I provided in the following post:

https://www.hahn-tech.com/ans/adding-cloud-on-price-chart-based-off-rsi-value/

In that solution you will find a real world example of how to employ the DefineGlobalColor() correctly.

How did I find that previous post? By using the search term "cloud" in the "Chart Studies" topic.

 

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on January 30, 2022 12:53 pm