PureBytes Links
Trading Reference Links
|
Try this instead make ATR a Var, instead of a Price.
Input: Price1(NumericSeries), ATRLen(NumericSimple),
DifFlag(NumericSimple), Len(NumericSimple);
Var:MyATR(0);
MyATR = AverageTrueRange(ATRLen);
Then use MyATR where ever you would use Price2. This is as close a
guess as I can make without seeing the rest of the formula, do you
use an offset anyplace like MyATR[1].
____________________Reply Separator____________________
Subject: Re: Functions in EL
Author: tvpresearch
Date: 5/24/99 8:21 AM
Hi,
the problem is that TS calculates the input ONE TIME if it's a function.
Open, Hi, Low, Close are seen ass numericseries in the input automatically.
Your AVGTRUERANGE(3) will be calculated for the first bar.
You could fix that by using a string input an calculating the Real Value in
your code.
Not really good, because you would have to compute the string.
Any other ideas?
Greetings from Germany,
Yann
-----Ursprüngliche Nachricht-----
Von: Bill Vedder <bved01@xxxxxxx>
An: <omega-list@xxxxxxxxxx>
Gesendet: Monday, May 24, 1999 1:46 PM
Betreff: Functions in EL
> Can someone help me understand and fix this?
>
> I created a function that uses two input variables designated as type
> NumericSeries. They are named Price1 and Price2. The input line looks
> like this:
> Input: Price1(NumericSeries), Price2(NumericSeries),
> DifFlag(NumericSimple), Len(NumericSimple);
>
> I then created an indicator to plot the results of the funtion's
> calculation. The indicator's input line looks like this:
> Inputs: Price1(C), Price2(AvgTrueRange(3)), DifFlag(1), Len(10);
>
> When I designate Price1 to be Close and Price2 to be AvgTrueRange(3) the
> function's results are incorrect. After some digging and adding print
> statements to the funtion to print the Date, Close, and AvgTrueRange(3),
> I found that, for reasons that are way beyong me, there is a consistent
> offset of 5 days between the AvgTrueRange(3) printed from the function
> and of that printed from a simple AvgTrueRange(3) indicator added to my
> chart. I find this when comparing the Date, Close, and AvgTrueRange(3)
> shown in the Data window vs the Date, Close, and AvgTrueRange(3) in the
> PrintLog.
>
> Can anyone tell me what the heck is going on here?
>
> Regards,
>
> Bill Vedder
>
>
>
|