PureBytes Links
Trading Reference Links
|
Ross Bond wrote:
>>I am plotting two price-based indicator values and I would like to
>>normalize them so that I can see them both displayed over a similar
>>scale regardless of the actual price of the market being tested,
>>but while still retaining the relationship between the two values.
>>
>>I can normalize them using the formula:
>>[(Series - SeriesLL)/(SeriesHH - SeriesLL)] * 100
>>
>>but that scales both indicator values from 0-100, while I really want
>>to preserve the relationship between them - if value1 is really half
>>the size of value2 then I would like to be able to see that.
Bob Fulks responded:
>You can normalize them to some date in the past as follows:
>
>Var: DoInit(TRUE);
>
>if DoInit and Date >= 1040101 then begin
> DoInit = FALSE; {Save prices as of this date}
> Price1 = Close data1;
> Price2 = Close data2;
>end;
>
>Plot1(Close data1 / Price1, "D1");
>Plot2(Close data2 / Price2, "D2");
However, that won't preserve the scale. It will just divide future
values by the first value.
And the above won't preserve the relative differences between the
two prices either, unless both are divided by the same constant. If
data2 starts out half of data1, then the code above will cause them
both to start out the same, which isn't what Ross wanted.
I don't know if Ross wants to restrict the scale to 0-100, but if
that's desired and the relative values of the indicator are to be
preserved, then he can do it his original way -- the only change
needed is to set SeriesLL to the lowest low of BOTH indicators, and
SeriesHH to the highest high of BOTH indicators.
--
,|___ Alex Matulich -- alex@xxxxxxxxxxxxxx
// +__> Director of Research and Development
// \
// __) Unicorn Research Corporation -- http://unicorn.us.com
|