Hi all,

I'm after a general form for doing a particular type of algorithm 
in AFL - and I'm happy to admit that I might be going about it 
the totally wrong way...

I am attempting to extract an evolving "profile" of a stock over 
time.

Using "median" as an example, lets say I want calculate the median
percentage price change for the life of the stock. To give an 
example:
     
    The 1st trading day - do nothing.
    The 2nd trading day - calc median for 2 days
    The 3rd trading day - calc median for 3 days
    Last traded day     - calc median for n days.

For simple functions, I have used a construct similar to;
    for ( i=0; i < BarCount; i++ ){
       myArray[ i ] = simpleFunc( i );
       .....
    }

However, in this case, I would have to write a new median function,
and this is irritating, since there is a perfectly good one 
taunting me from the users manual! That's why I suspect that I 
might be doing something in the wrong way.

Any help or pointers would be much appreciated. A pointer to 
a message in the user group would be fine too! ( Yes I am still
trawling through the email group as I write this....)

TIA

Robert Z

Reply via email to