Weekly 200 EMA label on minute chart?

jokajon00

New member
I have successfully made labels that show emas from the 5 minute, 1 minute, and daily time frames all on the 1 minute chart. I have an input for the timeframe, but when I select Week, it only displays N/A where every other time frame up to and including daily works. Here's the code:

Code:
# MTF Moving Average

input ChartType = {default CANDLE, HEIKIN_ASHI};
input Period = AggregationPeriod.WEEK;
input AvgType = AverageType.EXPONENTIAL;
input Length = 200;
input priceclose = close;

plot AVG = MovingAverage(AvgType, close(period = Period), Length);
AVG.SetDefaultColor(Color.YELLOW);
input label = yes;
AddLabel(label and yes, Concat("200/W EMA = ", Round(AVG, 2)),  Color.CYAN);

TLMVweW.png


Also. I turn plotting off and usually just use the label. Thanks in advance for the help!
 
Solution
I have successfully made labels that show emas from the 5 minute, 1 minute, and daily time frames all on the 1 minute chart. I have an input for the timeframe, but when I select Week, it only displays N/A where every other time frame up to and including daily works. Here's the code:

Code:
# MTF Moving Average

input ChartType = {default CANDLE, HEIKIN_ASHI};
input Period = AggregationPeriod.WEEK;
input AvgType = AverageType.EXPONENTIAL;
input Length = 200;
input priceclose = close;

plot AVG = MovingAverage(AvgType, close(period = Period), Length);
AVG.SetDefaultColor(Color.YELLOW);
input label = yes;
AddLabel(label and yes, Concat("200/W EMA = ", Round(AVG, 2)),  Color.CYAN);

Also. I turn plotting off and usually just use the...
I have successfully made labels that show emas from the 5 minute, 1 minute, and daily time frames all on the 1 minute chart. I have an input for the timeframe, but when I select Week, it only displays N/A where every other time frame up to and including daily works. Here's the code:

Code:
# MTF Moving Average

input ChartType = {default CANDLE, HEIKIN_ASHI};
input Period = AggregationPeriod.WEEK;
input AvgType = AverageType.EXPONENTIAL;
input Length = 200;
input priceclose = close;

plot AVG = MovingAverage(AvgType, close(period = Period), Length);
AVG.SetDefaultColor(Color.YELLOW);
input label = yes;
AddLabel(label and yes, Concat("200/W EMA = ", Round(AVG, 2)),  Color.CYAN);

Also. I turn plotting off and usually just use the label. Thanks in advance for the help!
weekly data on a minute chart may be asking for more data bars than what exists.

On a week chart, change the length from 200, to a number around 40 , to see if you find a number that works. That will be similar to 200 days. then increase the number until it creates n/a's.

6.5 hrs/day = 390min/day
390 x 200 days = 78000 bars

78000/ ( 390x5) = 40 weeks

390 min x 5 days/week x 200 weeks = 390,000 bars
 
Solution
I've tried lowering the number all the way down to 1 and on the 1 minute chart it still shows N/A. Just realized going to different time frames that a number displays and the exact accurate number is with it set at 200. It shows the value of the 200 ema on the weekly but only when a 5 min, hourly, 15 min, daily or weekly chart is selected. Essentially it works on every chart except the 1 minute. any fix to this?

Also just realized 5 minute only works if its more than 2 days. So 5 min 1day or 2 day chart shows N/A, but 5 min 3 day or 5 min 5 day shows accurate number.
 
When you choose the 1 minute chart, make sure the time interval is 10 days. The picture you have above is only 1 day, 1 minute. See the "1D 1m" in the top left. When you go to choose the timeframe, make sure it says 10d 1m.

I'm not sure whether the figure that returns is going to be correct or not. I don't believe you're going to be able to go back 200 weeks on a minute chart. But it solves it from returning N/A.
 
When you choose the 1 minute chart, make sure the time interval is 10 days. The picture you have above is only 1 day, 1 minute. See the "1D 1m" in the top left. When you go to choose the timeframe, make sure it says 10d 1m.

I'm not sure whether the figure that returns is going to be correct or not. I don't believe you're going to be able to go back 200 weeks on a minute chart. But it solves it from returning N/A.
Thanks, but then I always have to zoom into the chart. Was looking if there was a way to get it on the 1 day 1 min chart. What I've done for now is added a mini 3 day 5 min chart and linked the charts and its displayed there.

JDZFT3k.png
 

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