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

Re: calculation of price/frequency distributions



PureBytes Links

Trading Reference Links

You should dimension the array larger than you will ever need (and check the array bounds as you calculate them to assure that you do not exceed the size).

It looks as if the size of the price bins you are using is fixed at 1 point. If so you can use the price less the lower bound as the Index of the array. Something like the following should work:

  Index = IntPortion(Price - LowerBound);
  Index = MaxList(0, MinList(MaxIndex, Index));
  MyArray[Index] = MyArray[Index] + 1;


Bob Fulks



At 8:59 AM +1000 7/25/99, Tim McCaughey wrote:
>
>I am very new to easy language and am currently using tradstation version 4
>and have been having some difficulty in getting my head around the use of
>arrays.
>
>I have one particular problem that I have been attempting to solve with
>little luck and I was wondering of there is somebody out there that might be
>able to shed some light on the situation.
>
>the problems is as follows:
>
>I am trying to determine the frequency distribution for a set of data.
>
>So I have determined the number of ticks in a range by working out the high
>and low of the range in question and dividing the subsequent range by "1
>point". So now I have defined all the possible values for the range in
>question, but how do I set the array to the relevant number of variables
>since this is not a constant function but dependant upon the range of each
>period in question(do I just make the array larger than any expected range).
>After I have set up the array that includes all the price possibles how
>would I go about getting the array to be able to tell me how many times each
>price was hit during the period in question.
>
>So the end result I am looking for is to be able to determine the number of
>times each price was traded during the period in question.
>
>Is arrays the way to go ?
>
>Any help with the easy language side of this problem would be greatly
>appreciated. If this seems a slightly silly request please accept the
>apologies of a native novice.