Tradestation User Group Germany (http://www.tradernet.org/wbb/index.php)
|- Posts aus dem alten Userforum (http://www.tradernet.org/wbb/board.php?boardid=15)
|-- Mesa Sine Wave (http://www.tradernet.org/wbb/threadid.php?boardid=15&threadid=325)


Geschrieben von _Thomas Rossa am 05.09.2001, 11:10:

  Mesa Sine Wave

Hallo,

ich suche bislang vergeblich nach dem "Mesa Sine Wave" Zyklusindikator von John Ehlers und der entsrechenden Trade Station Syntax dazu. Vielleicht kann mir ja jemand von Euch
weiterhelfen.

Vielen Dank



Geschrieben von _Michael am 05.09.2001, 13:10:

  RE: Mesa Sine Wave

hi,

{*************************}
Inputs: Price((H+L)/2);

Vars: InPhase(0),
Quadrature(0),
Phase(0),
DeltaPhase(0),
count(0),
InstPeriod(0),
Period(0),
DCPhase(0),
RealPart(0),
ImagPart(0);

If CurrentBar > 5 then begin

{Compute InPhase and Quadrature components}
Value1 = Price - Price[6];
Value2 = Value1[3];
Value3 = .75*(Value1 - Value1[6]) + .25*(Value1[2] - Value1[4]);
Inphase = .33*Value2 + .67*InPhase[1];
Quadrature = .2*Value3 + .8*Quadrature[1];

{Use ArcTangent to compute the current phase}
If AbsValue(InPhase +InPhase[1]) > 0 then Phase = ArcTangent(AbsValue((Quadrature+Quadrature[1]) / (InPhase+InPhase[1])));

{Resolve the ArcTangent ambiguity}
If InPhase < 0 and Quadrature > 0 then Phase = 180 - Phase;
If InPhase < 0 and Quadrature < 0 then Phase = 180 + Phase;
If InPhase > 0 and Quadrature < 0 then Phase = 360 - Phase;

{Compute a differential phase, resolve phase wraparound, and limit delta phase errors}
DeltaPhase = Phase[1] - Phase;
If Phase[1] < 90 and Phase > 270 then DeltaPhase = 360 + Phase[1] - Phase;
If DeltaPhase < 1 then DeltaPhase = 1;
If DeltaPhase > 60 then Deltaphase = 60;

{Sum DeltaPhases to reach 360 degrees. The sum is the instantaneous period.}
InstPeriod = 0;
Value4 = 0;
For count = 0 to 40 begin
Value4 = Value4 + DeltaPhase[count];
If Value4 > 360 and InstPeriod = 0 then begin
InstPeriod = count;
end;
end;

{Resolve Instantaneous Period errors and smooth}
If InstPeriod = 0 then InstPeriod = InstPeriod[1];
Value5 = .25*InstPeriod + .75*Value5[1];

{Compute Dominant Cycle Phase, Sine of the Phase Angle, and Leadsine}
Period = IntPortion(Value5);
RealPart = 0;
ImagPart = 0;
For count = 0 To Period - 1 begin
RealPart = RealPart + Sine(360 * count / Period) * (Price[count]);
ImagPart = ImagPart + Cosine(360 * count / Period) * (Price[count]);
end;
If AbsValue(ImagPart) > 0.001 then DCPhase = Arctangent(RealPart / ImagPart);
If AbsValue(ImagPart) <= 0.001 then DCPhase = 90 * Sign(RealPart);
DCPhase = DCPhase + 90;
If ImagPart < 0 then DCPhase = DCPhase + 180;

Plot1(Sine(DCPhase), "Sine");
Plot2(Sine(DCPhase + 45), "LeadSine");

end;
{***************************}

grüsse

micha


Geschrieben von _Thomas Rossa am 05.09.2001, 16:10:

  RE: Mesa Sine Wave

Hallo Michael,

hab vielen vielen Dank - Wish you nice profits.


Geschrieben von _Abe am 08.09.2001, 04:10:

  RE: Mesa Sine Wave

John Ehlers hat die Formel zur Berechnung des "Sine Wave" Indikators korrigiert !!!
Alle die mehr wissen wollen, sollten sich auf jeden Fall seine Internetseite anschauen.
http://www.mesasoftware.com.
Dort kann man sich Powerpoint Dokumente downloaden, die auch den aktualisierten Easy Language Code enthalten !!!

Sehr empfehlenswert !!!

Powered by: Burning Board 1.1.1 © 2001 by WoltLab