# Simple Kalman Filter Compared to different Averages

# Mobius

# 2.22.2016

input n = 8;

input Kalman = yes;

input SMA = yes;

input EMA = yes;

input Weighted_MA = yes;

plot Data = WMA(((close * 3) + (close[1] * 2) + close[2] + Average(close, n)) / 7, n);

Data.SetDefaultColor(Color.Cyan);

Data.SetHiding(!Kalman);

AddLabel(1, "Kalman Filter", Color.Cyan);

plot avg = Average(close, n);

avg.SetDefaultColor(Color.Yellow);

avg.SetHiding(!SMA);

AddLabel(1, "SMA", Color.Yellow);

plot ExAvg = ExpAverage(close, n);

ExAvg.SetDefaultColor(Color.Red);

ExAvg.SetHiding(!EMA);

AddLabel(1, "EMA", Color.Red);

plot WtAvg = WMA(close, n);

WtAvg.SetDefaultColor(Color.Green);

WtAvg.SetHiding(!Weighted_MA);

AddLabel(1, "Weighted MA", Color.Green);