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

TJ: AWK like BEGIN/END structure in AA for Composites?



PureBytes Links

Trading Reference Links

Tomasz, when constructing composites, such as a simple buy/sell ratio it
would be very useful to have a BEGIN/END structure in the AA window. I
presume you are familiar with AWK but for the happily uninitiated the
structure of awk and the AA are similar: the AA runs over each series behind
the scenes - there is an implied "for each selected". What is lacking is
the BEGIN/END control structure, for example:

BEGIN: {" perhaps import Foreign function one time to scale each by"}

// create #buys and sells based on ma
B = IIF(C>MA(C,len),1,0);
S = IIF(C<MA(C,len),1,0);

Addtocomposite(B,"Buys",C);
Addtocomposite(S,"Sells",C);

END: { BSR = Foreign("BUYS",C)/Foreign("Sells",C) }


This would perform a single operation at the end. Another example would be
to scale the result by the max of the series.

I personally feel this would enhance the already strong composite
capabilities of AB significantly. I realize you are just sitting around
trying to think of something to do....

Comments?

Richard