Hi Michael,
Metastock is powerful, but only to a certain degree. The language is extremely poor for writing very complex systems.
For example, the 'If' statement does not allow you to execute more than 1 statement in the 'then' or else' parts of the block. (i.e. IF(expr,expr,expr) where expr is a single statement) What I would have hoped is that the language would work more like If(expr, {statement block} ,{statement block}) where statement block can be comprised of multiple lines of code or other expressions. This is what I assume Tradestation can allow you to do (more like a real programming language)
I too am very surprised that MS won't allow you to input anything other than a constant for PERIODS, (and other fields) in their canned functions. I would have considered rewriting the ones I need (the math library is extensive) but many of the support functions which are used to create things like Stochastics (i.e. Sum(price,periods), LLV(price,periods) {lowest value in periods}, etc) are bound by the same limitation as the higher functions (Mov(), Stoch()). That is to say, that If I want to calculate the sum of the price over X periods, In MS, X *must* be a constant. It can be a variable, but that variable must also be an integer constant. It cannot vary according to some other parameter (like Sum(C,(int)myperiodsfunc())...)
I assume from your last response, that this is trivial for TradeStation?
Thanks so much for your help. All of you guys on this thread seem very helpful.
Regards,
Robert |