# 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[1]

endif

return mm as"exponentielle T3. zillig"

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.

@+

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[1]

endif

return mm as "EMA"

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[1]

endif

bb=ExponentialAverage[4](customclose)

return mm as"exponentielle T3. zillig",bb

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

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[1]

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

Filt1 = Filt0 + Phase*Det0

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

endif

return Filt2

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[1]

endif

bb=ExponentialAverage[4](customclose)

return mm as"exponentielle T3. zillig",bb

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

7. oups sorry not divide by 5 but by 3 .

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

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...................

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[1]

endif

return mm as "EMA"

Page 4 of 33 First ... 2 3 4 5 6 14 ... Last

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
03-01-2013, 03:24 PM