 AllAverages

This is a discussion on AllAverages within the Trading tools forums, part of the Trading Forum category; Hi sohocol, Perhaps I haven't understand, but I thought you say that to calculate an EMA we can use this ...

 Tweet
1. Hi sohocol,

Perhaps I haven't understand, but I thought you say that to calculate an EMA we can use this code, but as you see, in green your code, and in green and EMA (lengh of 10 for both), and it's not quite the same

An idea ?

Thanks

Zilliq  Originally Posted by sohocool Hi Zilliq ,

We can do moving exponential like this :

Regards.

p.s. : also we can choose period =decimal.

///variable period = periode moyenne

len = MAX((period + 5.0)/3.0-1,1)

alpha=(2/(len+1))

if barindex >2 then

mm= alpha*customclose + (1-alpha)*mm

endif

return mm as"exponentielle T3. zillig"  Reply With Quote

2. hi ,

i think your have normal exponential alpha (2/11)

Mine have the T3 Igor alpha .

Please check yours expo with period = 4 ,and check normaly the both have same values.

@+  Reply With Quote

3. Gloups not the same with n=4

///variable period = periode moyenne

len = MAX((period + 5.0)/3.0-1,1)

alpha=(2/(len+1))

if barindex >2 then

mm= alpha*customclose + (1-alpha)*mm

endif

return mm as "EMA"   Reply With Quote

4. Hi Zilliq,

I just Check :

When mine T3 Zilliq have period =10 ,the normal Prt Exponential Must have period =4 (period +5)/5-1 == 4.

period =10

len = MAX((period + 5.0)/3.0-1,1)

alpha=(2/(len+1))

if barindex >2 then

mm= alpha*customclose + (1-alpha)*mm

endif

bb=ExponentialAverage(customclose)

return mm as"exponentielle T3. zillig",bb

Ps : why ? because is two different exponential due to not same alpha calculation .  Reply With Quote

5. Ok I will see

First try to "adapt" Jsmooth there is like a problem...

//Inputs: Price(NumericSeries),
//Period(NumericSimple),
//Pow(NumericSimple),
//Phase(NumericSimple),
//Opt(NumericSimple);

Price=close

bet=(0.45*(Period-1)/(0.45*(Period-1)+2))

//Filt0(0),alpha(0),Det0(0),Filt1(0),Det1(0),Filt2(0 );

If barindex < 10 then
Filt0 = Price
Filt1 = Price
Filt2 = Price

else
alpha = SQRT(bet)[Pow]

Filt0 = (1-alpha)*Price + alpha*Filt0

Det0 = (Price - Filt0)*(1 - bet) + bet*Det0

Filt1 = Filt0 + Phase*Det0

Det1 = (Filt1 - Filt2) * SQRT(2)[(1 - alpha)] + alpha*alpha*Det1
Filt2 = Filt2 + Det1

endif

return Filt2  Reply With Quote

6. When mine T3 Zilliq have perios =10 ,the normal Prt Exponential Must have period =4 (period +5)/5-1 == 4.

if period=10

((period+5)/5)-1=2 not 4 I think I know where is the problem it calculates an EMA of your T3 zillig, not on close

I test Originally Posted by sohocool Hi Zilliq,

I just Check :

When mine T3 Zilliq have period =10 ,the normal Prt Exponential Must have period =4 (period +5)/5-1 == 4.

period =10

len = MAX((period + 5.0)/3.0-1,1)

alpha=(2/(len+1))

if barindex >2 then

mm= alpha*customclose + (1-alpha)*mm

endif

bb=ExponentialAverage(customclose)

return mm as"exponentielle T3. zillig",bb

Ps : why ? because is two different exponential due to not same alpha calcul .  Reply With Quote

7. oups sorry not divide by 5 but by 3 .  Reply With Quote

8. I was right,

On a chart your T3 zillig=EMA but with different period 10/4

Thanks a lot

I will see how we can adapt the Jsmooth. Semmes to be difficult...

Zilliq   Reply With Quote

9. hi Zilliq,

why squareroot ???( alpha = SQRT(bet)[Pow])

if pow = 1 then alpha = bet

elseif pow =2then alpha = bet*bet

elseif pow =3 then alpha = bet*bet*bet

etc...................  Reply With Quote

10. This PRT code calculates exactly an EMA (same period)

Zilliq

len = MAX(period,1)

alpha=(2/(len+1))

if barindex >2 then

mm= alpha*customclose + (1-alpha)*mm

endif

return mm as "EMA"  Reply With Quote

1. ?????????? ????????? MetaTrader 4 build 745 - MQL4 ?????
11-19-2014, 12:16 PM
2. AllAverages indicator for Metatrader 4 build 600 | Newdigital Life
02-16-2014, 09:15 AM
3. All Averages v3 template for MT4 | Newdigital Life
03-05-2013, 03:55 PM
4. AllAverages new version of the indicator | Newdigital Life
allaverages, alma, consensus, dema, ema, hma, itrend, laguerre, lsma, lwma, moving average, mq5, mt5, quad ema, sinewma, sma, t3 basic, t3 correct, tema, trima, wilder, zerolagma 