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

arrays



PureBytes Links

Trading Reference Links

Just cannot get a grip on arrays.

Here in Aus the Bonds tick value varies with their yield to maturity. IE:
"price is quoted as 100 - yield to maturity expressed in % per annum".

So, eg: from 95.000   to   95.005 is A$40.82      and,
            from 84.000   to   84.005 is A$15.42.

Difficult to deal with, to say the least, in TS.

To attain some control I've built an incremental rounding expression to deal
with the 0.005 tick movment. The Print Log confirms correct values. {   Var:
xc(0);   }

To 'normalise' price from different price levels/dates a table has been
built containing various factors  an price levels. I have put the table into
an array in two different ways to try and capture the price related factor
{    BnF(0)    } from the array;

#1.   SINGLE-DIMENSIONAL ARRAY.
BP[0] = 99.000;
BP[1] = 0.67;
BP[2] = 99.750;
BP[3] = 0.69;
BP[4] = 99.500;
BP[5] = 0.7;
BP[6] = 99.250;
BP[7] = 0.72;
etc., With a variable {  y(0)  }, and the following.......

y = BP[xc];
Bnf = BP[y + 1];

the print log shows a wild range of results, some about the price and some
about the factor.

#2.  MULTI-DIMENSIONAL ARRAY.
BP[0,0] = 99.000;
BP[0,1] = 0.67;
BP[1,0] = 99.750;
BP[1,1] = 0.69;
BP[2,0] = 99.500;
BP[2,1] = 0.7;
BP[3,0] = 99.250;
BP[3,1] = 0.72;
etc

y = BP[xc,0];
BnF = BP[y,1];

I figured this type of array might work but only to find an error
message......"Tried to reference data in an array past the end or befroe the
beginning of the array"

Any help would be greatly appreciated.
Jon Macmichael