fiveema// © CarterTsai
//@version=4
strategy(title="ema_example", shorttitle="ema_example", overlay=true)
plot(ema(close, 12), title="12ema", color=color.white, linewidth=1)
plot(ema(close, 144), title="144ema", color=color.yellow, linewidth=1)
plot(ema(close, 169), title="169ema", color=color.orange, linewidth=1)
plot(ema(close, 576), title="576ema", color=color.blue, linewidth=1)
plot(ema(close, 676), title="676ema", color=color.green, linewidth=1)
FIVE
Rolling summaryStatistical methods based on mean cannot be effective all the time when attributed to financial data since it doesn't usually follow normal distribution, the data can be skewed or/and have extreme values which can be described as outliers.
In order to deal with this problem it is appropriate to use median-based techniques.
The most common one is called five-number summary/box plot, which plots median of the dataset, 25th (Q1) & 75th (Q3) percentiles (the medians of lower & upper parts of the original dataset divided by the original median), and whiskers calculated by taking range between Q1 and Q3, multiplying it by 1.5 and adding it to Q3 and subtracting it from Q1. The values which are outside the whiskers are considered outliers. Default settings of the script correspond to the classic box plot.
Seven-number summary can be also plotted by this script, by turning on 4 additional percentiles/Bowley’s seven-figure summary by turning on first 2 additional percentiles and changing their values to 10 and 90 respectively.
P.S.: Mean can be also turned in just to check the difference.
Penta Moving AveragesFive moving averages in a single indicator, you can decide if they will be exponential or simple. Very useful if you are a free user and want to save some indicator slots.
Enjoy it :)