Can anyone help me get the color for the 3rd cloud please

i tried to get the this green color. can anyone help?

this is complete code

input price = close;
input emaFastlength = 9;
input emaSlowlength = 21;
input emaThreelength = 50;
input emaLonglength = 200;
input displace = 0;
input showBreakoutSignals = no;


# First EMA
plot emaFastAvgExp = ExpAverage(price[-displace], emaFastlength);
plot emaFastUpSignal = price crosses above emaFastAvgExp;
plot emaFastDownSignal = price crosses below emaFastAvgExp;

emaFastUpSignal.SetHiding(!showBreakoutSignals);
emaFastDownSignal.SetHiding(!showBreakoutSignals);

emaFastAvgExp.SetDefaultColor(Color.WHITE);
emaFastUpSignal.SetDefaultColor(Color.UPTICK);
emaFastUpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
emaFastDownSignal.SetDefaultColor(Color.DOWNTICK);
emaFastDownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

# Second Ema
plot emaSlowAvgExp = ExpAverage(price[-displace], emaSlowlength);
plot emaSlowUpSignal = price crosses above emaSlowAvgExp;
plot emaSlowDownSignal = price crosses below emaSlowAvgExp;

emaSlowUpSignal.SetHiding(!showBreakoutSignals);
emaSlowDownSignal.SetHiding(!showBreakoutSignals);

emaSlowAvgExp.SetDefaultColor(Color.CYAN);
emaSlowUpSignal.SetDefaultColor(Color.UPTICK);
emaSlowUpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
emaSlowDownSignal.SetDefaultColor(Color.DOWNTICK);
emaSlowDownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);


# Third EMA
plot emaThreeAvgExp = ExpAverage(price[-displace], emaThreelength);
plot emaThreeUpSignal = price crosses above emaThreeAvgExp;
plot emaThreeDownSignal = price crosses below emaThreeAvgExp;

emaThreeUpSignal.SetHiding(!showBreakoutSignals);
emaThreeDownSignal.SetHiding(!showBreakoutSignals);

emaThreeAvgExp.SetDefaultColor(Color.VIOLET);
emaThreeAvgExp.SetLineWeight(2);
emaThreeUpSignal.SetDefaultColor(Color.UPTICK);
emaThreeUpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
emaThreeDownSignal.SetDefaultColor(Color.DOWNTICK);
emaThreeDownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);


# Fourth EMA
#plot emaLongAvgExp = ExpAverage(price[-displace], emaLonglength);
#plot emaLongUpSignal = price crosses above emaLongAvgExp;
#plot emaLongDownSignal = price crosses below emaLongAvgExp;

#emaLongUpSignal.SetHiding(!showBreakoutSignals);
#emaLongDownSignal.SetHiding(!showBreakoutSignals);

#emaLongAvgExp.SetDefaultColor(Color.LIGHT_ORANGE);
#emaLongAvgExp.SetLineWeight(2);
#emaLongUpSignal.SetDefaultColor(Color.UPTICK);
#emaLongUpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#emaLongDownSignal.SetDefaultColor(Color.DOWNTICK);
#emaLongDownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

input ShowEMAcloud = yes;
AddCloud(if ShowEMAcloud and (emaThreeAvgExp > emaSlowAvgExp > emaFastAvgExp) then emaFastAvgExp else Double.NaN, emaFastAvgExp, Color.dark_RED, Color.CURRENT);
AddCloud(if ShowEMAcloud and (emaFastAvgExp > emaSlowAvgExp > emaThreeAvgExp ) then emaFastAvgExp else Double.NaN, emaSlowAvgExp, Color.dark_GREEN, Color.CURRENT);

AddCloud(if ShowEMAcloud and (emaThreeAvgExp > emaSlowAvgExp ) then emathreeAvgExp else Double.NaN, emaslowAvgExp, Color.dark_RED, Color.CURRENT);

AddCloud(if ShowEMAcloud and (emafastAvgExp > emaslowAvgExp > emathreeAvgExp ) then emaslowAvgExp else Double.NaN, emathreeAvgExp, Color.dark_greeN, Color.CURRENT);
 

Attachments

  • IMG_5929.jpeg
    IMG_5929.jpeg
    357.6 KB · Views: 143
Last edited by a moderator:
@Resiliencetrader
Your first AddCloud statement has the same upper and lower limit.
You also have to use a Between() statement.
Judging by the color of your plots, I am assuming you meant this:
Ruby:
input ShowEMAcloud = yes;
AddCloud(if ShowEMAcloud and Between(emaSlowAvgExp,emaFastAvgExp,emaThreeAvgExp) then emaSlowAvgExp else Double.NaN, emaFastAvgExp, Color.dark_RED, Color.CURRENT);
AddCloud(if ShowEMAcloud and Between(emaSlowAvgExp,emaThreeAvgExp,emaFastAvgExp) then emaFastAvgExp else Double.NaN, emaSlowAvgExp, Color.dark_GREEN, Color.CURRENT);

AddCloud(if ShowEMAcloud and (emaThreeAvgExp > emaSlowAvgExp ) then emathreeAvgExp else Double.NaN, emaslowAvgExp, Color.dark_RED, Color.CURRENT);

AddCloud(if ShowEMAcloud and Between(emaslowAvgExp,emathreeAvgExp,emafastAvgExp) then emaslowAvgExp else Double.NaN, emathreeAvgExp, Color.dark_greeN, Color.CURRENT);
 
@Resiliencetrader
Your first AddCloud statement has the same upper and lower limit.
You also have to use a Between() statement.
Judging by the color of your plots, I am assuming you meant this:
Ruby:
input ShowEMAcloud = yes;
AddCloud(if ShowEMAcloud and Between(emaSlowAvgExp,emaFastAvgExp,emaThreeAvgExp) then emaSlowAvgExp else Double.NaN, emaFastAvgExp, Color.dark_RED, Color.CURRENT);
AddCloud(if ShowEMAcloud and Between(emaSlowAvgExp,emaThreeAvgExp,emaFastAvgExp) then emaFastAvgExp else Double.NaN, emaSlowAvgExp, Color.dark_GREEN, Color.CURRENT);

AddCloud(if ShowEMAcloud and (emaThreeAvgExp > emaSlowAvgExp ) then emathreeAvgExp else Double.NaN, emaslowAvgExp, Color.dark_RED, Color.CURRENT);

AddCloud(if ShowEMAcloud and Between(emaslowAvgExp,emathreeAvgExp,emafastAvgExp) then emaslowAvgExp else Double.NaN, emathreeAvgExp, Color.dark_greeN, Color.CURRENT);
this is what i want ! thank you so much. one last thing would it possible to change the color of the line of EMA to green or red when it turned or crossed each other?
 
@Resiliencetrader
Ruby:
input price = close;
input emaFastlength = 9;
input emaSlowlength = 21;
input emaThreelength = 50;
input emaLonglength = 200;
input displace = 0;
input showBreakoutSignals = no;


# First EMA
plot emaFastAvgExp = ExpAverage(price[-displace], emaFastlength);
plot emaFastUpSignal = price crosses above emaFastAvgExp;
plot emaFastDownSignal = price crosses below emaFastAvgExp;

emaFastUpSignal.SetHiding(!showBreakoutSignals);
emaFastDownSignal.SetHiding(!showBreakoutSignals);

emaFastAvgExp.AssignValueColor(if emaFastAvgExp > emaFastAvgExp[1] then Color.GREEN else Color.Red);
emaFastUpSignal.SetDefaultColor(Color.UPTICK);
emaFastUpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
emaFastDownSignal.SetDefaultColor(Color.DOWNTICK);
emaFastDownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

# Second Ema
plot emaSlowAvgExp = ExpAverage(price[-displace], emaSlowlength);
plot emaSlowUpSignal = price crosses above emaSlowAvgExp;
plot emaSlowDownSignal = price crosses below emaSlowAvgExp;

emaSlowUpSignal.SetHiding(!showBreakoutSignals);
emaSlowDownSignal.SetHiding(!showBreakoutSignals);

emaSlowAvgExp.AssignValueColor(if emaSlowAvgExp > emaSlowAvgExp[1] then Color.GREEN else Color.Red);
emaSlowUpSignal.SetDefaultColor(Color.UPTICK);
emaSlowUpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
emaSlowDownSignal.SetDefaultColor(Color.DOWNTICK);
emaSlowDownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);


# Third EMA
plot emaThreeAvgExp = ExpAverage(price[-displace], emaThreelength);
plot emaThreeUpSignal = price crosses above emaThreeAvgExp;
plot emaThreeDownSignal = price crosses below emaThreeAvgExp;

emaThreeUpSignal.SetHiding(!showBreakoutSignals);
emaThreeDownSignal.SetHiding(!showBreakoutSignals);

emaThreeAvgExp.AssignValueColor(if emaThreeAvgExp > emaThreeAvgExp[1] then Color.GREEN else Color.Red);
emaThreeAvgExp.SetLineWeight(2);
emaThreeUpSignal.SetDefaultColor(Color.UPTICK);
emaThreeUpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
emaThreeDownSignal.SetDefaultColor(Color.DOWNTICK);
emaThreeDownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);


# Fourth EMA
#plot emaLongAvgExp = ExpAverage(price[-displace], emaLonglength);
#plot emaLongUpSignal = price crosses above emaLongAvgExp;
#plot emaLongDownSignal = price crosses below emaLongAvgExp;

#emaLongUpSignal.SetHiding(!showBreakoutSignals);
#emaLongDownSignal.SetHiding(!showBreakoutSignals);

#emaLongAvgExp.SetDefaultColor(Color.LIGHT_ORANGE);
#emaLongAvgExp.SetLineWeight(2);
#emaLongUpSignal.SetDefaultColor(Color.UPTICK);
#emaLongUpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#emaLongDownSignal.SetDefaultColor(Color.DOWNTICK);
#emaLongDownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

input ShowEMAcloud = yes;
AddCloud(if ShowEMAcloud and Between(emaSlowAvgExp,emaFastAvgExp,emaThreeAvgExp) then emaSlowAvgExp else Double.NaN, emaFastAvgExp, Color.dark_RED, Color.CURRENT);
AddCloud(if ShowEMAcloud and Between(emaSlowAvgExp,emaThreeAvgExp,emaFastAvgExp) then emaFastAvgExp else Double.NaN, emaSlowAvgExp, Color.dark_GREEN, Color.CURRENT);

AddCloud(if ShowEMAcloud and (emaThreeAvgExp > emaSlowAvgExp ) then emathreeAvgExp else Double.NaN, emaslowAvgExp, Color.dark_RED, Color.CURRENT);

AddCloud(if ShowEMAcloud and Between(emaslowAvgExp,emathreeAvgExp,emafastAvgExp) then emaslowAvgExp else Double.NaN, emathreeAvgExp, Color.dark_greeN, Color.CURRENT);
 
@Resiliencetrader
Ruby:
input price = close;
input emaFastlength = 9;
input emaSlowlength = 21;
input emaThreelength = 50;
input emaLonglength = 200;
input displace = 0;
input showBreakoutSignals = no;


# First EMA
plot emaFastAvgExp = ExpAverage(price[-displace], emaFastlength);
plot emaFastUpSignal = price crosses above emaFastAvgExp;
plot emaFastDownSignal = price crosses below emaFastAvgExp;

emaFastUpSignal.SetHiding(!showBreakoutSignals);
emaFastDownSignal.SetHiding(!showBreakoutSignals);

emaFastAvgExp.AssignValueColor(if emaFastAvgExp > emaFastAvgExp[1] then Color.GREEN else Color.Red);
emaFastUpSignal.SetDefaultColor(Color.UPTICK);
emaFastUpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
emaFastDownSignal.SetDefaultColor(Color.DOWNTICK);
emaFastDownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

# Second Ema
plot emaSlowAvgExp = ExpAverage(price[-displace], emaSlowlength);
plot emaSlowUpSignal = price crosses above emaSlowAvgExp;
plot emaSlowDownSignal = price crosses below emaSlowAvgExp;

emaSlowUpSignal.SetHiding(!showBreakoutSignals);
emaSlowDownSignal.SetHiding(!showBreakoutSignals);

emaSlowAvgExp.AssignValueColor(if emaSlowAvgExp > emaSlowAvgExp[1] then Color.GREEN else Color.Red);
emaSlowUpSignal.SetDefaultColor(Color.UPTICK);
emaSlowUpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
emaSlowDownSignal.SetDefaultColor(Color.DOWNTICK);
emaSlowDownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);


# Third EMA
plot emaThreeAvgExp = ExpAverage(price[-displace], emaThreelength);
plot emaThreeUpSignal = price crosses above emaThreeAvgExp;
plot emaThreeDownSignal = price crosses below emaThreeAvgExp;

emaThreeUpSignal.SetHiding(!showBreakoutSignals);
emaThreeDownSignal.SetHiding(!showBreakoutSignals);

emaThreeAvgExp.AssignValueColor(if emaThreeAvgExp > emaThreeAvgExp[1] then Color.GREEN else Color.Red);
emaThreeAvgExp.SetLineWeight(2);
emaThreeUpSignal.SetDefaultColor(Color.UPTICK);
emaThreeUpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
emaThreeDownSignal.SetDefaultColor(Color.DOWNTICK);
emaThreeDownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);


# Fourth EMA
#plot emaLongAvgExp = ExpAverage(price[-displace], emaLonglength);
#plot emaLongUpSignal = price crosses above emaLongAvgExp;
#plot emaLongDownSignal = price crosses below emaLongAvgExp;

#emaLongUpSignal.SetHiding(!showBreakoutSignals);
#emaLongDownSignal.SetHiding(!showBreakoutSignals);

#emaLongAvgExp.SetDefaultColor(Color.LIGHT_ORANGE);
#emaLongAvgExp.SetLineWeight(2);
#emaLongUpSignal.SetDefaultColor(Color.UPTICK);
#emaLongUpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#emaLongDownSignal.SetDefaultColor(Color.DOWNTICK);
#emaLongDownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

input ShowEMAcloud = yes;
AddCloud(if ShowEMAcloud and Between(emaSlowAvgExp,emaFastAvgExp,emaThreeAvgExp) then emaSlowAvgExp else Double.NaN, emaFastAvgExp, Color.dark_RED, Color.CURRENT);
AddCloud(if ShowEMAcloud and Between(emaSlowAvgExp,emaThreeAvgExp,emaFastAvgExp) then emaFastAvgExp else Double.NaN, emaSlowAvgExp, Color.dark_GREEN, Color.CURRENT);

AddCloud(if ShowEMAcloud and (emaThreeAvgExp > emaSlowAvgExp ) then emathreeAvgExp else Double.NaN, emaslowAvgExp, Color.dark_RED, Color.CURRENT);

AddCloud(if ShowEMAcloud and Between(emaslowAvgExp,emathreeAvgExp,emafastAvgExp) then emaslowAvgExp else Double.NaN, emathreeAvgExp, Color.dark_greeN, Color.CURRENT);
Thank you so much for all you help !
 

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