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

Re: [RT] in search of the grail



PureBytes Links

Trading Reference Links

Gary,
 
I never said FFT.  FFT is a very nasty word in my vocabulary.
 
There is a process called the "Singleton Approximation" which
yields the amplitude and phase for any period wave over any
given period.  Given that information then you can calculate
the projection of where the wave will be the next (or any number
of bars) ahead.  By combining these estimates you may get a
better estimate than for any single cycle.
 
My FOURLINE routine, which uses the Singleton approximation
is as follows.  Today the classical sine/cosine transform is not
much slower than this because of buildin sine/cosine functions.
 
Modified to TS2 you would probably have NumericRef parameters
to return both phase and amplitude.
 
Clyde
 
{= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =}
{
Function: FourLine
 
Purpose:    Calculate the Fourier amplitude and phase
            Values at a selected period over a given
            zone of time.
 

Author:       Clyde Lee, SYTECH/Futuresmagic.
Copyright:    Clyde Lee, 1998-2003.
 
This is a conversion of a Professional Basic routine that
is used in the DOS veersion of the SwingMachine software
to perform and display Fourier analyses and projections.
 
Basic concepts from work of Professor Singleton. 
Singleton first published the method in the late 1960's.
I found this solution in a book by Enders A. Robinson.
 
After conversion returns either amplitude or phase in
degrees. Set input variable  DoPhas  to true to get phase
data or to false to get amplitude Value.
 
The evaluation, as currently programmed, removes a linear
trend from the beginning to the end of the analyzed data.
 
  EFHold=EFHold+EFSlope;
  EF = AF * XF - GF * YF + (PRICE[Indx]-EFHold);
 
If you wish to use another method of removing the longer
term "bias" in the data then compute EFHold by your favorite
"trend estimation" method rather than the linear trend that
is shown.
 
This routine was written to work with TS4 or later versions.
}
 
{= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =}
 
INPUTS:  
Price(numericseries),  {Price on which to compute             }
Period(numericsimple), {Period of wave for analysis.          }
NumBars(numericsimple),{number of bars to use in computation  }
                       {This is recommended to be some integer}
                       {multiple of period.                   }
DoPhas(truefalse);     {false=return amplitude, true=phase    }
 
VARS:   PeakA(0),Degs(0);
VARS:   AF(0),XD(0),XDD(0),XF(0),YF(0),GF(0),EF(0), Indx(0);
Vars:   EFHold(0),EFSlope(0);
 

AF = 360 / PERIOD;
XF = COSINE(AF); YF = SINE(AF);
GF = 0; EF = PRICE[NumBars-1];
 
EFHold=EF;
EFSlope = (Price-EF)/(NumBars-1);
EF=0;
 
FOR Indx = NumBars - 2 DOWNTO  0 BEGIN
  AF = EF;
  EFHold=EFHold+EFSlope;
  EF = AF * XF - GF * YF + (PRICE[Indx]-EFHold);
  GF = AF * YF + GF * XF;
END;
 
EF = 2 * EF / NumBars; GF = 2 * GF / NumBars;
 
PEAKA = SQUAREROOT(AbsValue(EF * EF + GF * GF));
IF EF=0 THEN Degs=0 ELSE Degs=Arctangent(GF/EF) ;
IF GF>0 THEN Value1=1 ELSE Value1=-1;
IF 0>EF THEN Value2=1 ELSE Value2=-1;
 
{ADJUST ATAN PHASE FOR QUADRANT}
If GF<0 and EF>0  then degs=degs+360;
If EF<0           then degs=degs+180;
 
{Constrain Phase Angle to be 0-360}
WHILE degs > 360 begin
 degs = degs - 360;
END;
WHILE degs < 0 begin
  degs = degs + 360;
END;
 
If DoPhas THEN FourLine = Degs
          ELSE FourLine=PeakA;
 
 
- - - - - - - - - - - - - - - - - - - - -  - - - - - - -
Clyde Lee   Chairman/CEO          (Home of SwingMachine)
SYTECH Corporation          email:
clydelee@xxxxxxxxxxxx 
7910 Westglen, Suite 105       Office:    (713) 783-9540
Houston,  TX  77063               Fax:    (713) 783-1092
Details at:                     
www.theswingmachine.com
- - - - - - - - - - - - - - - - - - - -  - - - - - - - -
 
 
----- Original Message -----
From: "Gary Funck" <gary@xxxxxxxxxxxx>
Sent: Thursday, March 03, 2005 5:06 PM
Subject: RE: [RT] in search of the grail

>
>
> Clyde,
>
> I was wondering if you could elaborate on the method described below?
> If I take the FFT of the past 3 days, and then an FFT of the past 5 days,
> I end up with two arrays of complex values each giving amplitude and
> phase at a given cycle (ie, wave) length.  How would those be combined?
> Would I take the average of each complex coefficient in the the
> 3 bar, and the 5 bar FFT calculation, and then use the resulting
> composite to perform an inverse FFT to extrapolate the next day's
> direction/amplitude?
>
> -----Original Message-----
> From: Clyde Lee [mailto:clydelee@xxxxxxxxxx]
> Sent: Tuesday, March 01, 2005 11:30 AM
>
> If we take a combination of a 3 bar cycle and a 5 bar cycle, using
> only one cycle back to determine phase and amplitude, we are able
> to predict the direction of the next close with a 66.98% accuracy.
>
>
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor --------------------~-->
> In low income neighborhoods, 84% do not own computers.
> At Network for Good, help bridge the Digital Divide!
>
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/zMEolB/TM
> --------------------------------------------------------------------~->
>

> Yahoo! Groups Links
>
> <*> To visit your group on the web, go to:
>   
http://groups.yahoo.com/group/realtraders/
>
> <*> To unsubscribe from this group, send an email to:
>   
realtraders-unsubscribe@xxxxxxxxxxxxxxx
>
> <*> Your use of Yahoo! Groups is subject to:
>   
http://docs.yahoo.com/info/terms/

>
>
>
>
>

Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links