Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information
{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;
If DCPhase > 315 then DCPhase = DCPhase - 360;
For mt3 indicators of RST sinewave/phase/homodyn listed above ,I have done some test and personally think they may have some errors in the programs because there is wrong performance corelative with price according to John's explanation in the book.
BRs
Stl
Thanks,
I got them from the SBFX site in some old MT3 forums. They seemed to be working for them, just by their comments, but there is no way of me knowing.
I was hoping someone might be able to convert them.
Interested to know more about John Elhers (or Ehlers??) Center of Gravity Indicators / method, how it is used and more about it generally, can anyone suggest any links?
Interested to know more about John Elhers (or Ehlers??) Center of Gravity Indicators / method, how it is used and more about it generally, can anyone suggest any links?
I was looking for the Sinewave indicator also and couldn't find it. Comparing the tradestation code and the code for the Instant Trendline.mq4, the first two thirds are the same. I added code and I am posting the indicator. Note that the result seems to be more jagged than it should, so I don't know if it's right. Does anybody have any suggestions?
I was looking for the Sinewave indicator also and couldn't find it. Comparing the tradestation code and the code for the Instant Trendline.mq4, the first two thirds are the same. I added code and I am posting the indicator. Note that the result seems to be more jagged than it should, so I don't know if it's right. Does anybody have any suggestions?
Hi Newman
The jagged results you obtain are caused by the fact that there are no discernible cycles at the time..you will see almost perfect cycles at times followed by minitrends that cause the jagged results you see
It is interesting to use sinewave(or cybercycle) jointly with the instantaneous trendline,mama,and frama..then it becomes discretional but you have all the important info at your fingertips..there are several ,free,papers by ehlers on his website www.mesasoftware.com
Ehler was a true mystic and a genius able to see the "signs and the numbers" like DeMark & Darvas. Here's a handful from the archives that I use in my EA's. Coded by the brilliant Luis Guilherme Damiani.