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

Re: using arrays



PureBytes Links

Trading Reference Links

Not a big deal but your code could be simplified by eliminating the array.
Also note that your code will print the last 201 prices (0 to 200).

Simpler code is:

if date >= lastcalcdate then begin

for value1 = 0 to 199 begin
     print(value1,Close[value1]);
end;

end;

If you do as a system there is no need for any plot statement.



-----Original Message-----
From: Technical Trends <support@xxxxxxxxxxxxxxxxxxx>
To: Omega-List <omega-list@xxxxxxxxxx>
Date: September 29, 1998 4:25 AM
Subject: using arrays


>In my TS 4.0, I wish to load an array with the last 200 days close.
>The code I wrote is:
>
>{ Load an array into memory and process it }
>
>Array: num[200](0);
>
>if date >= lastcalcdate then begin
>
>for value1 = 0 to 200  begin
> num[value1] = close[value1];
>end;
>
>{ this code is to print what is in the array }
>for value1 = 0 to 200 begin
> print(value1,num[value1]);
>end;
>
>end;
>
>
>{ the plot statement is given only to meet the requirements of EL . Not
>actually needed }
>plot1(close,"close");
>
>Problem: I get two sets of 200 values. The first set contains 200
>values, of the last day's close, and then the second set has the last
>200 days close which is what I wanted.
>
>Why does the first set of values come and how do I prevent it ?
>
>Thanks,
>
>Sudarshan Sukhani
>
>
>
>
>
>