To All, is it possible to name a custom formula/indicator, and then use this name in "min" and "max" statements?
I don't think so. As I recall, you're limited to the "tokens" of which the given functions are cognizant.
Part of the reason for this is that QP2 script doesn't have full-fledged arrays as data types, which is, in my opinion, one of its biggest faults. (Others being no cross-security variables and no user-written functions. That and the "check for divide by zero at compile time" oddity. An interesting feature, but...)
Anyway, if we HAD arrays, you could fill it up with whatever data you wanted, then pass it to the min/max functions and voila.
For the record, I like QP script; it's closer to what I want to see in a language than Metastock script, though MS has some interesting features I'd like to see in QP also.
Short story is you'll have to code your own. I'm sure Brooke's archive contains MANY examples of this. |