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

Re: EL code - Normalizing data



PureBytes Links

Trading Reference Links

Dear Maz,

One way is to scale it based on the range of the indicator over a 
look-back window.  Here is an example of a user function "Norm" which 
normalizes On Ballance Volume, OBV.  This produces an oscillator 
that varies from +1.0 to -1.0  I like to plot the 10 bar moving 
Xaverage of this normalized function.  Try it   .... you may like it.

{User Function Norm, set up to normalize OBV.  Can use any function.}
VARS:  AX(0), HX(0), LX(0);

AX = OBV;
HX = Highest(OBV, 45);
LX = Lowest(OBV, 45);
IF (HX - LX) <> 0 Then Norm = 2*(HX - AX)/(HX - LX)-1 Else Norm = 0;



> Date:          Sat, 10 Jan 1998 04:47:29 GMT
> From:          tagteam@xxxxxxx (James F. Mazzulla)
> To:            omega-list@xxxxxxxxxx
> Subject:       EL code - Normalizing data

> Sheesh, all I wanted to do is create an indicator which
> would plot data on a scale of -1 through +1 (otherwise known
> as normalizing the data). This can certainly be accomplished
> mathematically but I don't know how to translate it to EL
> code. 
> 
> Consequently, I made an "EasyLanguage Help Request" on the
> Omega website. I thought it would be a rather simple matter
> to write the code. I merely asked if they had the code or,
> alternatively, how I would go about writing it. The
> following is the response I received:
> 
> >>Dear Mr. Mazzulla,
> >>TradeStation goes through the entire code for every bar so
> >>before it gets to the last bar how will it know the highest or lowest value for
> >>the whole data field?
> 
> I'm sure someone will correct me if I'm in error but didn't
> they answer my question with a question? Further, I'm not
> even sure the answer or, more appropriately, question makes
> sense.
> 
> Is coding this in EL such a big deal. I'd sure appreciate
> some feedback from members of the LIST concerning this
> matter. TIA
> 
> Best regards,
> Jim
> 
>