#### netarchitech

##### Well-known member

**Please Note**: This indicator is currently under development...

Code:

```
# filename: MR__EZ_Trading_Dashboard_
# idea source: @HighBredCloud and https://usethinkscript.com/threads/adding-breakouts-and-dss-to-macd-indicator-for-thinkorswim.957/post-8699
# V11.12.2019 - Initial design and development by netarchitech per HighBredCloud request
# MACD with a more Normal Distribution
# Mobius
# V01.09.2015
#Hint: Plots a Gaussian distribution. If Normal Distribution is met, then at minimum, 68.2% of the close values should be inside a One Standard Deviation Envelope and 95.4% of the close values should be inside a 2 Standard Deviation Envelope.
declare lower;
def zeroLine = 0;
input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
# Four Pole Filter
script g {
input length = 4;
input betaDev = 2;
input price = OHLC4;
def c;
def w;
def beta;
def alpha;
def G;
c = price;
w = (2 * Double.Pi / length);
beta = (1 - Cos(w)) / (Power(1.414, 2.0 / betaDev) - 1 );
alpha = (-beta + Sqrt(beta * beta + 2 * beta));
G = Power(alpha, 4) * c +
4 * (1 – alpha) * G[1] – 6 * Power( 1 - alpha, 2 ) * G[2] +
4 * Power( 1 - alpha, 3 ) * G[3] - Power( 1 - alpha, 4 ) * G[4];
plot Line = G;
}
# Modified MACD
def MACD_Value = g(length = fastLength) - g(length = slowLength);
def MACD_Avg = g(price = MACD_Value, length = MACDLength);
def Diff = MACD_Value - MACD_Avg;
plot MACDdiff_LED = if !IsNaN(close) then 1.01 else Double.NaN;
MACDdiff_LED.SetPaintingStrategy(PaintingStrategy.POINTS);
MACDdiff_LED.DefineColor("OverZero", Color.GREEN);
MACDdiff_LED.DefineColor("Normal", GetColor(7));
MACDdiff_LED.DefineColor("UnderZero", Color.RED);
MACDdiff_LED.AssignValueColor(if Diff > zeroLine then MACDdiff_LED.Color("OverZero") else if Diff < zeroLine then MACDdiff_LED.Color("UnderZero") else MACDdiff_LED.Color("Normal"));
MACDdiff_LED.SetLineWeight(5);
MACDdiff_LED.HideBubble();
MACDdiff_LED.HideTitle();
# Forward / Reverse EMA
# (c) 2017 John F. Ehlers
# Ported to TOS 07.16.2017
# Mobius
# Inputs:
input AA = .1;
# Vars:
def CC;
def RE1;
def RE2;
def RE3;
def RE4;
def RE5;
def RE6;
def RE7;
def RE8;
def EMA;
CC = if CC[1] == 0 then .9 else 1 – AA;
EMA = AA * close + CC * EMA[1];
RE1 = CC * EMA + EMA[1];
RE2 = Power(CC, 2) * RE1 + RE1[1];
RE3 = Power(CC, 4) * RE2 + RE2[1];
RE4 = Power(CC, 8) * RE3 + RE3[1];
RE5 = Power(CC, 16) * RE4 + RE4[1];
RE6 = Power(CC, 32) * RE5 + RE5[1];
RE7 = Power(CC, 64) * RE6 + RE6[1];
RE8 = Power(CC, 128) * RE7 + RE7[1];
def EMA_Signal = EMA – AA * RE8;
plot FREMA_LED = if !IsNaN(close) then 1 else Double.NaN;
FREMA_LED.SetPaintingStrategy(PaintingStrategy.POINTS);
FREMA_LED.DefineColor("OverZero", Color.GREEN);
FREMA_LED.DefineColor("Normal", GetColor(7));
FREMA_LED.DefineColor("UnderZero", Color.RED);
FREMA_LED.AssignValueColor(if EMA_Signal > zeroLine then FREMA_LED.Color("OverZero") else if EMA_Signal < zeroLine then FREMA_LED.Color("UnderZero") else FREMA_LED.Color("Normal"));
FREMA_LED.SetLineWeight(5);
FREMA_LED.HideBubble();
FREMA_LED.HideTitle();
# PPO Multiple Moving Averages
# Based on earlier PPO FREMAS code from netarchitect
# Revamped by tomsk
# 11.11.2019
input fastPeriod = 12;
input slowPeriod = 26;
input signalPeriod = 9;
input price = close;
input movingAverageType = {"Simple MA", default "Exponential MA", "Wilders Smoothing", "Weighted MA", "Hull MA", "Adaptive MA", "Triangular MA", "Variable MA", "Dema MA", "Tema MA", "EHMA", "THMA"};
def fast;
def slow;
switch (movingAverageType) {
case "Simple MA":
fast = Average(price, fastPeriod);
slow = Average(price, slowPeriod);
case "Exponential MA":
fast = ExpAverage(price, fastPeriod);
slow = ExpAverage(price, slowPeriod);
case "Wilders Smoothing":
fast = WildersAverage(price, fastPeriod);
slow = WildersAverage(price, slowPeriod);
case "Weighted MA":
fast = wma(price, fastPeriod);
slow = wma(price, slowPeriod);
case "Hull MA":
fast = HullMovingAvg(price, fastPeriod);
slow = HullMovingAvg(price, slowPeriod);
case "Adaptive MA":
fast = MovAvgAdaptive(price, fastPeriod);
slow = MovAvgAdaptive(price, slowPeriod);
case "Triangular MA":
fast = MovAvgTriangular(price, fastPeriod);
slow = MovAvgTriangular(price, slowPeriod);
case "Variable MA":
fast = variableMA(price, fastPeriod);
slow = variableMA(price, slowPeriod);
case "Dema MA":
fast = DEMA(price, fastPeriod);
slow = DEMA(price, slowPeriod);
case "Tema MA":
fast = TEMA(price, fastPeriod);
slow = TEMA(price, slowPeriod);
case EHMA:
fast = ExpAverage(2 * ExpAverage(price, fastPeriod / 2) - ExpAverage(price, fastPeriod), Round(Sqrt(fastPeriod)));
slow = ExpAverage(2 * ExpAverage(price, slowPeriod / 2) - ExpAverage(price, slowPeriod), Round(Sqrt(slowPeriod)));
case THMA:
fast = WMA(WMA(price, (fastPeriod / 2) / 3) * 3 - WMA(price, (fastPeriod / 2) / 2) - WMA(price, (fastPeriod / 2)), (fastPeriod / 2));
slow = WMA(WMA(price, (slowPeriod / 2) / 3) * 3 - WMA(price, (slowPeriod / 2) / 2) - WMA(price, (slowPeriod / 2)), (slowPeriod / 2));
}
def periodOK = fastPeriod < slowPeriod;
AddLabel(!periodOK, "ERROR: fastPeriod MUST be less than slowPeriod");
def _ppo = if periodOK then ((fast - slow) / slow) * 100 else 0;
def _signal;
switch (movingAverageType) {
case "Simple MA":
_signal = Average(_ppo, signalPeriod);
case "Exponential MA":
_signal = ExpAverage(_ppo, signalPeriod);
case "Wilders Smoothing":
_signal = WildersAverage(_ppo, signalPeriod);
case "Weighted MA":
_signal = wma(_ppo, signalPeriod);
case "Hull MA":
_signal = HullMovingAvg(_ppo, signalPeriod);
case "Adaptive MA":
_signal = MovAvgAdaptive(_ppo, signalPeriod);
case "Triangular MA":
_signal = MovAvgTriangular(_ppo, signalPeriod);
case "Variable MA":
_signal = variableMA(_ppo, signalPeriod);
case "Dema MA":
_signal = DEMA(_ppo, signalPeriod);
case "Tema MA":
_signal = TEMA(_ppo, signalPeriod);
case EHMA:
_signal = ExpAverage(2 * ExpAverage(_ppo, signalPeriod / 2) - ExpAverage(_ppo, signalPeriod), Round(Sqrt(signalPeriod)));
case THMA:
_signal = WMA(WMA(_ppo, (signalPeriod / 2) / 3) * 3 - WMA(_ppo, (signalPeriod / 2) / 2) - WMA(_ppo, (signalPeriod / 2)), (signalPeriod / 2));
}
def Ppo = _ppo;
def PpoEma = _signal;
def PPOdiff = _ppo - _signal;
plot PPOdiff_LED = if !IsNaN(close) then 0.99 else Double.NaN;
PPOdiff_LED.SetPaintingStrategy(PaintingStrategy.POINTS);
PPOdiff_LED.DefineColor("OverZero", Color.GREEN);
PPOdiff_LED.DefineColor("Normal", GetColor(7));
PPOdiff_LED.DefineColor("UnderZero", Color.RED);
PPOdiff_LED.AssignValueColor(if PPOdiff > zeroLine then PPOdiff_LED.Color("OverZero") else if PPOdiff < zeroLine then PPOdiff_LED.Color("UnderZero") else PPOdiff_LED.Color("Normal"));
PPOdiff_LED.SetLineWeight(5);
PPOdiff_LED.HideBubble();
PPOdiff_LED.HideTitle();
```