quantstrat - model transactions on specific dates
On 10/09/2014 03:05 PM, Mark Knecht wrote:
I would like to do something in quantstrat like set up an initial buy for all symbols in a portfolio on a certain date. To that end I want a signal column that says the date is matching my buy date and then I'l execute a specific rule. However signals need to match columns which led me to wanting the index in a column as a value. To that end the code below basically does this but returns a numerical value which (I think) is referenced to 1970-01-01.
It seems to me that the simplest thing would be to just establish your initial portfolio. Initialize the portfolio, then construct a data.frame for the txnData argument of addTxns. Call addTxns before calling applyStrategy. Alternately, you could modify sigFlatten to essentially do the opposite, and initiate on a certain time. Regards, Brian
Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock