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

Re: EL Lesson #3 for the Pedagoge From France..



PureBytes Links

Trading Reference Links

Dans un courrier daté du 13/11/98 14:47:09 Heure d2iver Pari9 Madrid,
bnm03@xxxxxxx a écrit :

> 
>  I SUGGEST YOU LOOK AT SAY, THE ADX (AND ALL THE OTHER BUILT INDICATORS)
>  INDICATOR,  THAT OMEGS SHIPS WITH THEIR PRODUCT.
>  
>  IN THERE YOU WILL FIND THAT THEY ALWAYS ALWAYS ALWAYS INITIALIZE THEIR
>  VARIABLES!!!
>  
They do in some case.

>  HERE'S JUST A TANTELIZING EXCERPT FROM ADX (I COULD HAVE PICKED Accum
>  Distribution, CCI Average -- the list goes on and on like your BS)
>  
>  ...
>  
>  #BeginCmtry
>  	{Intialize variables}
>  	BullKeyReversal=FALSE;
>  	BearKeyReversal=FALSE;
>  	BearKeyReversal=FALSE;
>  	LTHighestUder=FALSE;
>  	LongTermDays=45;
>  	ShortTermTrend=0;
>  
>  Etc.

Your example is wrong.
The above values are flag that needs to be initialized to control what they do
if they are updated to true.
THhs techniqque is used because they want to turn the flag on (true) to true
on a specific bar ( where the alert  was met).
Next par, the variable must be reset to false to avod a new alert ( du to the
fact that EL carries previous values of the variable to the next bar).

In other cases, they no not uually reset their values.
That's aside, there are some wrong programming examples in the EL code
provided ( mean that they work , but coding is not always clever)

This CCI example do not reset variable Avg or CCI user function because there
is no reason to do so:
	Study		: CCI
		Last Edit	: 7/7/95
	Provided By	: Omega Research, Inc. (c) Copyright 1995

********************************************************************}
inputs : Length(NumericSimple);
vars   : Sum(0),Counter(0),MD(0),Avg(0);

if Length > 0 
then begin
	Avg = Average(High+Low+Close,Length);
	MD = 0;
	for counter = 0 to Length - 1 
	begin
		MD = MD + AbsValue(High[counter] + Low[counter] + Close[counter] - Avg);
	end;
	MD = MD / Length;
	if MD = 0 then 
		CCI = 0 
	else
		CCI = (High + Low + Close - Avg) / (0.015 * MD);
end
else 
	CCI = 0;

>  
>  The King Of EL Coding,
>  Brian
>  

And a new battle lost...
I admire your worthless courage.

Rgds,

Pierre Orphelin