Price on Date
I think you might have one of two questions:
* To get the price on a date, you really can do it, but as far as I've experienced during a trial last week for another purpose, there is a catch. (Having said that, someone else here will come up with a more elegant way)
If you run say:
Close(-512)
or
Date (-512)
you'd get the close or date from 512 market days ago. Trouble is, "512 days ago" changes to a different date every market day. Trouble is also, calculating "market days ago" to get a date isn't a QP2 function - and doing it using excel has errors due to holidays, etc. So what I did was a kluge that worked.
I did a QP2 run that printed out the date for (-x) where -x was a range of dates to find out the correct x. (Using a manually adjusted (-i) in the form of (-i-x) you can readjust this for any future date you run this on - getting a price list for a group of dates (which is what I was doing when I did this last week)).
* If you are really wanting to do TA tests, you can do them in the same manner. Again, the only problem is that, if you want to test specific dates as opposed to just -x days ago, you have to make a daily adjustment.
The Help on Date() shows only a (0) day date, but any minus number will work. Setting i as an interger variable is shown well.
If you want to calculate -x, one what is to make a QP2 report in ASCII that dumps the date out. Then read the report in Financial Suite Beta, QP2 or excel and get the line count number of the dates you want. |