Looking for EXP_MOV_AVG Channel HIGH LOW

dmaffo

Member
VIP
I was messing around with chart and I noticed when I change close to " high" and "low" on same exponential number I get a nice channel. When I mess around with making an actual script I could get it to do what I wanted.
input pricehigh = HIGH;
input length = 50;
input displace = 0;
input showBreakoutSignals = no;

input pricelow = LOW;
input lengthlow = 50;
input displace1ow = 0;
input showBreakoutSignals1 = no;


plot AvgExp = ExpAverage(pricehigh[-displace], length);
plot UpSignal = pricehigh crosses above AvgExp;
plot DownSignal = pricehigh crosses below AvgExp;

UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);

AvgExp.SetDefaultColor(GetColor(1));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

It doesn't plot the channel right. I want it to show same was as any other cloud would with arrows. Easy on the eyes type thing.

Any help with few lines of code missing be great. I tried copy and pasting the same above and it didn't work.
Here is a pic of the channel in case anyone wants to see how nice it plots on chart
WmxW4Ub.jpg
 
Solution
This will plot the high and low values for the Exponential Moving Average. I figured i would post it just in case someone needs it in the future.


#EMA CHANNEL with cloud
input price = low;
input length = 50;
input displace = 0;
input showBreakoutSignals = no;
plot AvgExp = ExpAverage(price[-displace], length);
plot UpSignal = price crosses above AvgExp;
plot DownSignal = price crosses below AvgExp;
input price2 = high;
input showBreakoutSignals2 = no;
plot AvgExp2 = ExpAverage(price2[-displace], length);
plot UpSignal2 = price2 crosses above AvgExp2;
plot DownSignal2 = price2 crosses below AvgExp2;
AddCloud(AVGEXP,AVGEXP2, Color.gray, Color.gray);

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

This will plot the high and low values for the Exponential Moving Average. I figured i would post it just in case someone needs it in the future.


#EMA CHANNEL with cloud
input price = low;
input length = 50;
input displace = 0;
input showBreakoutSignals = no;
plot AvgExp = ExpAverage(price[-displace], length);
plot UpSignal = price crosses above AvgExp;
plot DownSignal = price crosses below AvgExp;
input price2 = high;
input showBreakoutSignals2 = no;
plot AvgExp2 = ExpAverage(price2[-displace], length);
plot UpSignal2 = price2 crosses above AvgExp2;
plot DownSignal2 = price2 crosses below AvgExp2;
AddCloud(AVGEXP,AVGEXP2, Color.gray, Color.gray);
 
Last edited:
Solution
Here is my script. The Red I shade down to 30 as I dont like it very bright.
#EXPONENTIAL_HIGH_LOW_CHANNEL_BY_DIO

input pricehigh = high;
input pricelow = low;
input price = close;
input fastLength = 50;
input slowLength = 50;
input length = 50;
input averageType = AverageType.EXPONENTIAL;
input displace = 0;
input showBreakoutSignals = no;

plot AvgExp = ExpAverage(price[-displace], length);
plot FastMA = MovingAverage(averageType, pricehigh, fastLength);
plot SlowMA = MovingAverage(averageType, pricelow, slowLength);

FastMA.SetDefaultColor(GetColor(1));
SlowMA.SetDefaultColor(GetColor(2));

AddCloud(FastMA, SlowMA, Color.DARK_RED, Color.GREEN);

AvgExp.SetDefaultColor(GetColor(1));

plot UpSignal = price crosses above AvgExp;
plot DownSignal = price crosses below AvgExp;

UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);

UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

#End Code
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
291 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