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

NO DMI bug: Try this and make your own opinion



PureBytes Links

Trading Reference Links

I will not try to answer point by point to someone who is mistaking himself
because he does not take the elementary precautions when verifying
something, so was Mat's case.

As explaied, the DMI bug cannot exist, because the PlusDM and MinusDM values
have the LONG precision and the FLOAT epsilon error is not involved in any
manner.

The modification to Mat's trap obviously shows that a  calculation derived
from prices as it is the case in my example or the DMI example is not
affected by the bug precison, because FLOAT is to used here.

Those who cannot agree will run the following test ans see by themselves
that the PlusDM and MinusDM have more than requested precision and that the
If MinusDM >= PlusDM Then
			PlusDM = 0;
test cannot fail with the = condition, so there is no TS bug at all for any
indicator like DMI, RSI and so on..

Here is the fracportion of  PlusDM and MinusDM displayed by the code with
15 digits

 0.000000000000000    0.000000000000000
  0.000000000000000    0.000000000000000
  0.000000000000000    0.500000000000000
  0.000000000000000    0.500000000000000
  0.000000000000000    0.000000000000000
  0.000000000000000    0.000000000000000
  0.000000000000000    0.000000000000000

I have run it over  50,000 bars, various markets and have never been able to
find one single line in error, eg  a digit other than "0" after the price
scale precision.
This means that the direct price calculation is mahematically infinite with
the  basic +-* operations ( what is normal because price are LONG (math
integers) and we only perform arithmetic that yields to am math integer too.

Again and to end this thread,Mats should consider that there is a problem
with his data reading that are not correctly read or passed to TS.
It has nothing to do with EL precison limitation and the bugs that could
occur due to the lack of precison
EL has been around since 1987, so it's curious that 14 years after a monster
bug  could have been discovered!!!

Now you can remove the  200 or so message sent  to finally demonstrate that
the bug is only existing in the mind of those who are not confident enough
in the software and too confident in their own hate of it.

Sincerely,

Pierre Orphelin
www.sirtrade.com
TradeStation Technologies representative in France





{*******************************************************************
Description: Directional Movement Index Plus
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: Length(10) ;
Variables:Dmiplus2(0),Counter(0), TRange(0), MyRange(Length), PlusDM14(0),
PlusDM(0), MinusDM(0);

If CurrentBar = 1 Then Begin
	MyRange = Length;
	DMIPlus2 = 0;
	PlusDM14 = 0;
	TRange = 0;
	For Counter = 0 To MyRange - 1 Begin
		If High[Counter] - High[Counter+1] < 0 Then
			PlusDM = 0
		Else
			PlusDM = High[Counter] - High[Counter+1];
		If Low[Counter+1] - Low[Counter] < 0 Then
			MinusDM = 0
		Else
			MinusDM = Low[Counter+1] - Low[Counter];
		If MinusDM >= PlusDM Then
			PlusDM = 0;
		{MinusDM not set to 0 because it is not used}
		TRange = TRange + TrueRange[Counter];
		PlusDM14 = PlusDM14 + PlusDM;
	End;
	If TRange <> 0 Then
		DMIPlus2 = 100 * PlusDM14 / TRange
	Else
		DMIPlus2 = 0 ;
End
Else
	If CurrentBar > 1 Then Begin
		If High[0] - High[1] < 0 Then
			PlusDM = 0
		Else
			PlusDM = High[0] - High[1];
		If Low [1] - Low [0] < 0 Then
			MinusDM = 0
		Else
			MinusDM = Low[1] - Low[0];
		If MinusDM >= PlusDM Then
			PlusDM = 0;
		{MinusDM not set to 0 because it is not used}
		If MyRange > 0 Then Begin
			TRange = TRange[1] - (TRange[1] / MyRange) + TrueRange;
			PlusDM14 = PlusDM14[1] - (PlusDM14[1] / MyRange) + PlusDM;
		End;
		If TRange <> 0 Then
			DMIPlus2 = 100 * PlusDM14 / TRange
		Else
			DMIPlus2 = 0 ;
	End ;


	print(fracportion(plusdm):3:15,"  ",fracportion(minusdm):3:15);


You may also use
print(plusdm:3:15,"  ",minusdm:3:15);