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

Re: Arg! Need help resolving 'print' statement discrepancey



PureBytes Links

Trading Reference Links

Hi Bob & Brian,

Upon further examination, I checked to make sure that maxbarsback is set the same for both the indicator and the signal. (50)

I also printed out the Date with the indicator, and noticed  that the dates of printout are in fact beginning at different
times, and with different values:

The indicator looks like this, and prints the following:

Inputs: Length(14), Level(20);

Plot1(ADX(Length), "ADX");
Plot2(Level,"Level");

print ("Date ", Date, " IND Value1 ", ADX(14));

{--------}

Date  990217.00 IND Value1     100.00
Date  990310.00 IND Value1      59.48
Date  990311.00 IND Value1      59.48
Date  990312.00 IND Value1      57.69
Date  990316.00 IND Value1      57.00
Date  990317.00 IND Value1      54.70
Date  990318.00 IND Value1      51.79
Date  990319.00 IND Value1      49.83
Date  990322.00 IND Value1      47.43

And the signal actually has only one line in it to test this bug out and looks like this:


print ("Date ", Date, " SIG Value1 ", ADX(14));


And here are the results snipped:

Date  990430.00 SIG Value1       8.47
Date  990503.00 SIG Value1       5.26
Date  990504.00 SIG Value1       7.65
Date  990505.00 SIG Value1       9.17
Date  990506.00 SIG Value1       8.37
Date  990507.00 SIG Value1       7.16
Date  990510.00 SIG Value1       7.15
Date  990511.00 SIG Value1       8.58
Date  990512.00 SIG Value1       9.69
Date  990513.00 SIG Value1      10.58


You can see that the dates are definitely different, and also the values are different. Even when I look at the data where the
dates *do* line up, the values are wrong. It's almost like the ADX(14) is being computed for an entirely different security?!

Any other thoughts?

TIA,

tnx, rob



Bob Fulks wrote:

> At 2:43 PM -0500 11/18/00, Robert Cavaleri wrote:
> >
> >I am frustrated. I am working on a strategy that tests for ADX(14) to be
> >above a certain level (20) before taking action. I am clearly looking at
> >the chart, and the plot with ADX(14) in there, and I can see that it is
> >way above 20. If I go to put a print statement in the ADX indicator like
> >so:
>
> This sounds exactly like the MaxBarsBack setting for the Strategy is set to a different number than for the Indicator.
>
> If you make then the same, it is highly likely that they will give the same values.
>
> In effect, the two programs are beginning on different bars.
>
> It is a good idea to start each printed line with data an time of each bar so you can quickly spot these kinds of problems.
>
> Bob Fulks