Hi Data
I’ve never heard of ValueWhen() slowing MetaStock down but I certainly know about PREV having that effect. The P variable (INDICATOR is it’s other name) also apparently causes explorations to slow. Well, actually it might not be the P variable but just the fact that something on the active chart is highlighted.
I’ve discovered in a number of situations that ValueWhen() can be used to eliminate PREV without having any impact on the indicators result. If the code has more than one PREV then there is probably not going to be any possible solution down this road.
There is a simple trick that you can use with explorations to mitigate the effects of PREV. Limit the exploration to the minimum number of records – never use 10,000 when 500 will also give the correct result. (In this context “minimum records” does not mean using the Explorer Minimum Records setting.)
If you’re using the same PREV-based formula result in several columns then transferring the formula result to the GV DLL at the beginning of column A and then reading back from the DLL in subsequent columns should limit a PREV bottleneck.
Drop me a line if you need more specific help with this problem. I’ve been battling against PREV for a number of years now, so while I might not have a total solution I can probably come up with a few more ideas if I have more information. On the surface the ValueWhen() thing doesn’t make sense.
Roy