# Mediane Average

#### anton

##### New member
Hi. I have a script, it shows a 1 day moving average on a 5 minute or any chart. There simple, exponential, wilders, hul movings.

##
input averageType = AverageType.SIMPLE;
def AP = aggregationPeriod.DAY;
def price = close(period = AP);
input Length = 50;
input displace = 0;

plot Avg = MovingAverage(averageType, price[-displace], Length);

Solution
like this
like an indicator Daily SMA
Ruby:
``````#
# TD Ameritrade IP Company, Inc. (c) 2012-2021
#

input agg    = AggregationPeriod.DAY;
def price    = close(period = agg);
input length = 9;

plot MedianPrice = Median(price, length);

MedianPrice.SetDefaultColor(GetColor(0));``````
Hi. I have a script, it shows a 1 day moving average on a 5 minute or any chart. There simple, exponential, wilders, hul movings.

##
input averageType = AverageType.SIMPLE;
def AP = aggregationPeriod.DAY;
def price = close(period = AP);
input Length = 50;
input displace = 0;

plot Avg = MovingAverage(averageType, price[-displace], Length);

Median Average is a built in script provided by TOS

Code:
``````#
# TD Ameritrade IP Company, Inc. (c) 2012-2021
#

input price = close;
input length = 9;

plot MedianPrice = Median(price, length);

MedianPrice.SetDefaultColor(GetColor(0));``````

Median Average is a built in script provided by TOS
I need it to show the value from the daily chart to intraday

like this
like an indicator Daily SMA

like this
like an indicator Daily SMA
the guy above you did it i believe, did you want different aggregations?

like this
like an indicator Daily SMA
Ruby:
``````#
# TD Ameritrade IP Company, Inc. (c) 2012-2021
#

input agg    = AggregationPeriod.DAY;
def price    = close(period = agg);
input length = 9;

plot MedianPrice = Median(price, length);

MedianPrice.SetDefaultColor(GetColor(0));``````

87k+ Posts
271 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?