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

Re: Functions in EL



PureBytes Links

Trading Reference Links

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
>
>
>