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

RE: Function NTHighestBar in Tradestation has a bug



PureBytes Links

Trading Reference Links

No, this is still the same in SP3:

Value1 = BarNumArray[value1];

Should be:

Value3 = BarNumArray[value1];


	-----Original Message-----
	From:	Bengtsson, Mats [SMTP:mats.bengtsson@xxxxxxxxxxxx]
	Sent:	Tuesday, November 16, 1999 4:56 PM
	To:	omega-list@xxxxxxxxxx
	Subject:	Function NTHighestBar in Tradestation has a bug

	At least in SP2 for TS2K, is this corrected in SP3?

	(NTHHighestBar code is below, with line pointing to error):


	If Nth <= Length  AND Nth <= 100 Then Begin
		For value1 = 0 To Length - 1 Begin
			PriceArray[value1] = Price[value1];
			BarNumArray[value1] = value1;
		End;
		For value1 = 0 To Nth - 1 Begin
			For value2 =  value1 + 1 To Length - 1 Begin
				If PriceArray[value2] > PriceArray[value1]
Then
	Begin
					Value3 = PriceArray[value1];
					PriceArray[value1] =
PriceArray[value2];
					PriceArray[value2] = Value3;
					Value1 = BarNumArray[value1];
	***************************************^^^^^^^ Error, should read
Value3
	***************
					BarNumArray[value1] =
BarNumArray[value2];
					BarNumArray[value2] = Value3;
				End;
			End;
		End;
		NthHighestBar = BarNumArray[Nth - 1];
	End
	Else
		NthHighestBar = -1;

	--- Mats ---