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 ...
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.
@+
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.
please check with this :
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 .
Last edited by sohocool; 08-19-2013 at 05:27 PM. Reason: ps
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
Last edited by zilliq; 08-19-2013 at 05:31 PM.
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...................
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"
Bookmarks