PureBytes Links
Trading Reference Links
|
> -----Message d'origine-----
> De : Wayne Mathews [mailto:wayne@xxxxxxxxx]
> Envoye : mercredi 18 juillet 2001 03:35
> A : =omega list
> Objet : RE: Language problems causes bugs not to be understood as the
> bug s they are
>
>
>
> The code below, on my TS2K, gives a value of 0.11 for plot1 but if a
> plot2(value2) is added then plot1 = 0.1070003510 and plot2 =
> 0.1069993973. Strange!
>
>
> ******************************************
> {Test Indicator, must plot Zero line}
> Value1 = 10.387 - 10.280;
> Value2 = 10.280 - 10.173;
> If Value1 = Value2 Then Value1 = 0;
> plot1 (Value1);
> ******************************************
>
This is what your code gives:
0.107000000000000 0.106999000000000
0.000000000000000
0.107000000000000 0.106999000000000
0.000000000000000
0.107000000000000 0.106999000000000
0.000000000000000
And when adding plot2:
Value1 = 10.387 - 10.280;
Value2 = 10.280 - 10.173;
If Value1 = Value2 Then Value1 = 0;
plot1 (Value1);
plot2(value2);
messagelog(value1:15:15,value2:15:15,value3:15:15);
0.107000000000000 0.106999000000000
0.000000000000000
0.107000000000000 0.106999000000000
0.000000000000000
0.107000000000000 0.106999000000000
0.000000000000000
0.107000000000000 0.106999000000000
0.000000000000000
Cannot see any difference in value 1 and value2 from the message log.
Adding a message log for plot1 and plot2 shows nothing abnormal:
Value1 = 10.387 - 10.280;
Value2 = 10.280 - 10.173;
If Value1 = Value2 Then Value1 = 0;
plot1 (Value1);
plot2(value2);
messagelog(value1:15:15,value2:15:15,plot1:15:15,plot2:15:15);
0.107000000000000 0.106999000000000
0.107000000000000 0.106999000000000
0.107000000000000 0.106999000000000
0.107000000000000 0.106999000000000
0.107000000000000 0.106999000000000
0.107000000000000 0.106999000000000
The error that you reported only appear from the data window ( that should
have a different rounding scheme), but in any case, the errors are not
present in the internal variables, means that a trading system will never
been affected by this error.
As a rule of thumb, if you want to debug something, always use the message
log or print command to display the corect value.
The data window may produce different values where ronding effect may appear
somewhat strange.
Sincerely,
Pierre Orphelin
www.sirtrade.com
TradeStation Technologies representative in France
|