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

Functions in EL



PureBytes Links

Trading Reference Links

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