STUB: result_vector = ADJUSTFORSPLITS( source_vector, Type )

The function ADJUSTFORSPLITS, as the name suggests, returns a new vector that has been adjusted for any splits.

The field Type must be either PRICE or VOLUME.

Function ADJUSTFORSPLITS adjusts for splits by adjusting prices and volume before a split to "look like" prices and volume after the split. So, if a stock was trading at 40 dollars and then it splits 2-for-1, and now trades\ at 20 dollars, past prices should be divided by 2 (so they now look like current prices) and past volume needs to  multiplied by 2 (again, so past volume "looks like"  present volume values). Thus the need to specify in the second file the Type of adjustment needed.

How StockWiz handles splits

StockWiz 5 stores price and volume data as they were reported the date they were reported. Split factors are stored in a  different table. When price and volume are adjusted, the adjustment is done in memory. In other words, if you make a mistake with one of the split factors, your price database will not be corrupted. This also give you the flexibility to work with data as split-adjusted or as split-unadjusted. For example, in the Export module of StockWiz, you are given the option to export the data as split-adjusted or split- unadjusted.

This also brings up another point. How does ADJUSTFORSPLITS know the ticker symbol for the current vector so as to look up the splits for that ticker? The answer is that each vector is stored by a unique name (such as OPEN, MA20, etc.) and that the ticker symbol of the original data is also stored in the vector. If you run a formula and then you click on 'Formula Data' under the 'Formulas' tab, you will use all the data stored in the matrix (i.e., you will see the contents of all defined vectors). In the second row, you can see the ticker symbol that is assigned to each vector. The ticker symbol in this case, is not a unique identifier. The unique identifier is the entry in the first row.