Another Moving Average for Your Consideration
from:https://www.earnforex.com/metatrader-indicators/3rd-Generation-Moving-Average/#:~:text=3rd Generation Moving Average is,Durchschnitte 3.0 (in German).
Working link to the original document:
https://www.vtad.de/fa/gleitende-du...uf zumindest rechnerisch ohne Zeitverzögerung.
EDIT If you copied this script with an Assert() call, TAKE OUT the Assert() call or it doesn't plot. I put it in as an afterthought, but didn't implement it correctly. I have removed it from the code below. (if you copy now, you're fine)
Code:
declare upper;
input MA_Period = 50;
input MA_Sampling_Period = 220; # MA_Sampling_Period (should be more than 4 * MA_Period)
input MA_Method = AverageType.EXPONENTIAL;
input MA_Applied_Price = CLOSE;
def Lambda = 1.0 * MA_Sampling_Period / (1.0 * MA_Period);
def Alpha = Lambda * (MA_Sampling_Period - 1) / (MA_Sampling_Period - Lambda);
def TotalPeriod = MA_Period + MA_Sampling_Period;
def MA1 = MovingAverage(data = MA_Applied_Price, length = MA_Sampling_Period, Averagetype = MA_Method);
def MA2 = MovingAverage(data = MA1, length = MA_Period, Averagetype = MA_Method);
plot MA3G = (Alpha + 1) * MA1[1] - Alpha * MA2;
ma3g.AssignValueColor(if ma3g <= close then color.blue else color.dark_orange);
Last edited: