[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: re:help with MA's



PureBytes Links

Trading Reference Links


This question is interesting and we may have an AFL answer.
For every TEMA(C,n) we may find the closest Ti3 approximation for the 
last X bars.

price=C; 
//the Ti3 function
function T3(periods,s)
{
e1=EMA(price,periods);
e2=EMA(e1,Periods);
e3=EMA(e2,Periods);
e4=EMA(e3,Periods);
e5=EMA(e4,Periods);
e6=EMA(e5,Periods);
c1=-s*s*s;
c2=3*s*s+3*s*s*s;
c3=-6*s*s-3*s-3*s*s*s;
c4=1+3*s+s*s*s+3*s*s;
Ti3=c1*e6+c2*e5+c3*e4+c4*e3;
return ti3;
}
//The closest Ti3 approximation for the last N bars
T=TEMA(C,5);//your smoothing function here
Plot(T,"TEMA",1,1);
BARS=100;
SUM0=10^6;
for(PERIODS=2;PERIODS<10;PERIODS=PERIODS+1)
{
for(S=0.1;S<1.5;S=S+0.01)
{
SUM1=LastValue(Sum(abs(T3(PERIODS,S)-T),BARS));
if(SUM1<SUM0)
{
SUM0=SUM1;
PER1=PERIODS;
S1=S;
}
}
}
Plot(T3(PER1,S1),"T3["+WriteVal(PER1,1.0)+", "+WriteVal(S1,1.2)
+"]",2,1);

A TEMA(C,5) is closest to a T3(2,0.95), a DEMA(C,20) may be 
approximated by a T3(5,0.35) for the last 100 ^NDX bars, but a T3
(7,0.72) is needed for the last 1000 bars.
Unfortunately there is no universal relation, the results are 
different for various stock histories.
A T3 user could come to the same trading results by using the TEMA or 
DEMA approximation. But, if he makes some money with his T3, there is 
no reason to change it !!
Another interesting detail : If somebody uses his T3 10 or 50 times a 
day, some experience is accumulated to "see" things quickly, even 
before the typical indicator signal. I look at MACD divergences with 
the very first morning coffee, every day. It was "obvious" to me that 
CLZ04 futures would fail to give an MACD div some days ago. I could 
not prove it, I had to wait for the signal [or better the absence of 
the signal in this case...], but, in the mean time, oil was moving 
higher and higher....
Dimitris
--- In amibroker@xxxxxxxxxxxxxxx, "raven4ns" <raven4ns@xxxx> wrote:
> 
> Hi Corey,
>  Thank you for taking the time to try and help. Here is the T3 
> formula:
> 
> /* T3 trading system */
> a = 0.7;
> n = 2;
> 
> alpha = 2/(n + 1);
> e1 =  ema(close, n);
> e2 = ema (e1, n);
> e3 = ema (e2, n);
> e4 = ema (e3,  n);
> e5 = ema (e4, n);
> e6 = ema (e5, n);
> 
> T3 = -a^3 * e6 + (3 * a^2 +3 * a^3) * e5 + (-6 * a^2 - 3 *
>  a - 3 * a^3) * e4 + (1 + 3 * a + a^3 + 3 * a^2) * e3;
> 
> graph0 = close;
> graph1 = T3;
> 
> SELL = cross ( Close, T3 );
> BUY = cross (T3, Close );
> SHORT = cross ( Close, T3);
> COVER = cross (T3, Close );
> 
> I looked at the TEMA (3,5) and this formula and didn't see a great 
> deal of difference. With the T3,however, I couldn't figure out how 
> to change the periods and which periods it was using. My computer 
> skills are very limited,unfortunately, and most of you are head & 
> shoulders above me in such knowledge. Maybe one day I will be able 
> to help but right now it would be the blind leading the 
blind....LOL.
>  I thought,perhaps, I could adapt the T3 to show MA's built around 
> the fibonacci numbers. However, If the TEMA is an equivalent then I 
> will use it. I need to keep it as simple as possible....LOL.
>  Once again, Corey, thank you for taking the time and trouble to 
try 
> and help. I do appreciate it. My questions/problems must seem very 
> simple to most of the people on this list.
> 
> Kindest regards,
> 
> Tim 
> 
> 
> 
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Corey Saxe" <res1wgwl@xxxx> 
wrote:
> > This is the formula for a 26 day TEMA of the close:
> > A1= ((3*EMA(C,26)) - (3*EMA(EMA(C,26),26))) + EMA(EMA(EMA
> (C,26),26),26);
> > A2=TEMA(C,26);
> > Plot(A1,"Manual",2,1);Plot(A2,"AB Tema",3,1);
> > 
> > What do you have for T3?
> > 
> > For more info on TEMA, see Stocks & Commodities V. 12:2 (72-80): 
> Smoothing Data With Less Lag by Patrick G. Mulloy.
> > 
> > -CS
> >   ----- Original Message ----- 
> >   From: raven4ns 
> >   To: amibroker@xxxxxxxxxxxxxxx 
> >   Sent: Thursday, October 14, 2004 3:14 PM
> >   Subject: [amibroker] re:help with MA's
> > 
> > 
> > 
> >   Hello,
> >   I'm wondering what the difference would be between a TEMA and 
the
> >   T3? As I was reading Mr Tillson's report on the T3, I thought 
> about
> >   the TEMA and wondered if they were the same thing. I'm 
> particularly
> >   interested in the smoothing aspect to avoid getting tossed 
> around as
> >   other MA's tend to do as I will be using this short term. I'm
> >   looking for trades from 2,3-21+ days as I'm looking to swing 
> trade.
> >   Included in the report were comments from Mr. Karnish which 
> leads me
> >   to believe the T3 is what I appear to need for a stable short-
> term
> >   indicator and this is why my interest. Coupled with that, Mr.
> >   Tsokakis's formula for anticapating the cross suggests an 
> excellent
> >   indicator for my uses and style of trading.
> >   A little while back I posted a message thanking everyone for 
> their
> >   kindness and patience. I meant it then and I mean it now. Thank 
> you.
> >   Any and all help is very much appreciated.
> > 
> >   Kindest regards,
> > 
> >   Tim
> > 
> > 
> > 
> > 
> > 
> > 
> >   Check AmiBroker web page at:
> >   http://www.amibroker.com/
> > 
> >   Check group FAQ at: 
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> > 
> > 
> >         Yahoo! Groups Sponsor 
> >               ADVERTISEMENT
> >              
> >        
> >        
> > 
> > 
> > ------------------------------------------------------------------
-
> -----------
> >   Yahoo! Groups Links
> > 
> >     a.. To visit your group on the web, go to:
> >     http://groups.yahoo.com/group/amibroker/
> >       
> >     b.. To unsubscribe from this group, send an email to:
> >     amibroker-unsubscribe@xxxxxxxxxxxxxxx
> >       
> >     c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms 
> of Service. 
> > 
> > 
> > 
> > [Non-text portions of this message have been removed]





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/