| | | | | | | | | | | | | | | | | | | Test |
| 10 points total | | | | | | | | | | | | | | Close | Previous Close | Daily Volume | Average Volume | Rule1 | RULE2 | Rule3 |
| Create a UDF for each of the following Rules. Test your UDF with the data that appears in the table. | | | | | | | | | | | | | Ford | $ 9.58 | $ 9.54 | 17,476,800 | 46,539,346 |
| Daily price change measured from Previous Close to Close. | | | | | | | | | | | | | TWTR | $ 37.70 | $ 34.42 | 10,757,870 | 26,252,670 |
| a. One line if | | RULE 1 | 4 points | | | | | | | | | | MSFT | $ 111.86 | $ 107.72 | 20,912,023 | 29,216,547 |
| | If daily price change is larger than 1% then buy. | | | | | | | | | | | | DNKN | $ 73.14 | $ 72.94 | 250,931 | 752,540 |
| | | | | | | | | | | | | | FB | $ 151.57 | $ 149.94 | 12,742,307 | 24,825,293 |
| b. Block if | | RULE 2 | 4 points |
| | If daily price change is negative than sell |
| | If daily price change is greater than 0, but less than 1/2 percent, then hold |
| | If daily price change is greater than 1/2 percent than buy |
| c. Nested if | | RULE 3 | 2 points |
| | If daily price change is negative and daily volume is greater than average then sell but if daily volume is less than average then hold |
| | If daily price change is greater than 0, but less than 1/2 percent and daily volume is less than average than hold; if daily volume is greater than average then sell |
| | If daily price change is greater than 1/2 percent than buy unless daily volume is less than average, then sell |
| | Hint: compute Close/Previous Close and Daily Volume/Average Volume |