[size:17pt]Hello. I am recoding the Sine Trend system published in Ehlers book, "Rocket Science for Traders". Now I think there is an obvious error in the code.

This is the orginal EasyLanguage code. I have made the error as I see it in bold and large type.

The variable "Period" doesn't have a value when it is called upon resulting in the undeclared indentifier error.

Am I seeing this right?

{***************************************

Written by: Ehlers - Rocket science for traders
typed by Henry Amand

Description: SineTrend system, page 120

****************************************}

Inputs: Price((H+L)/2);

Vars: Smooth (0),
Detrender (O) ,
I1 (0),
Q1 (O),
jI (O),
JQ (0),
I2 (0),
Q2 (0),
Re (0),
Im (0),
Period (0),
SmoothPeriod (O),
SmoothPrice (O),
DCPeriod (O),
RealPart (0),
Imagpart (O),
count (0),
DCPhase (O),
DCSine (O),
LeadSine (O),
Itrend (O),
Trendline (O),
Trend (0),
DaysinTrend (O);



If CurrentBar > 5 then begin


Smooth = (4*Price + 3*Price[1] + 2*Price[2] + Price[3]) / 10;
Detrender = (.0962 * Smooth + .5769 * Smooth[2] - .5769 *
Smooth[4] - .0962*Smooth[6]) * (.075 * Period[1] + .54);


{Compute InPhase and Quadrature components.}

Q1 = (.0962 * Detrender + .5769 * Detrender[2] - .5769
* Detrender[4] - .0962 * Detrender[6]) * (.075 * Period[1] + .54);
I1 = Detrender[3];

[/size]

Last edited by RTG; 06/21/14 04:14.