StockWiz Forum > Thanks for the Formula Info
1. I'll edit the documentation for BACKTEST to explain the BUYWHEN and SELLWHEN rules. The EVALUATE_ALL simply tells the program to either stop evaluating the list of trading rules if some rule has already "fired" or to continue evaluating and fire more than one. The problem with the latter is that you may end up buying and selling at the same day for two different reasons.
2. There are really two MIN and MAX. If you use it by itself (such as Rank1=MAX(CLOSE), where CLOSE is a vector, it will return the highest value in CLOSE). But if you use it within an expression, such as the case when using LOOPCALC or CALC, then it expects 2 or more numbers - not a vector. For example, you can say RANK1 = CALC(max(1,2,3,4,5)) or you can say "RANK1=CALC(max(CLOSE(0),CLOSE(1),CLOSE(2))
3. Actually the documentation was wrong. When you calculate a linear regression or a slope, you need to provide an explicit range. I'll post a sample formula under the documentation of the LINREG.
For the latest version of StockWiz please click on the 'Contact us' form to request a copy.

Dear Stockwiz,
Thanks you for posting the Stockwiz 5 formula explanations. It has been quite helpful.
You said there is an updated version where this information can be accessed in the "help" button. I have the November 07 CD which does not have this feature. How do I download the latest Stockwiz 5 version?
Also, you did not explain very much about the most important function - BACKTEST. How does the syntax work for BUYWHEN and SELLWHEN? What exactly does EVALUTE_ALL do?
Other questions:
Does MIN and MIX take only literal values? I can't seem to get it to work inside loopcalc. Here is the formula:
MAXHIGH = LOOPCALC(MAX(CLOSE(i-1),HIGH(i)))
I get an error on this formula.
I also need a way to calculate the slope of only the last part of a moving average. How can I do this?
Thanks
R Virzi