Forum: help


RE: Using PnL as a signal [ Reply ] By: Thomas Dieu on 2015-02-02 15:02 | [forum:42216] |
Hi Brian, Thanks for your answer. If you already answered this question sorry about that, I couldn't find it on my own, and I really tried before posting on the forum. Thanks for the rebalance rule, I have actually done something similar for positioning, but I didn't connect the dots. I will do some test with the getSymbols, I am maintaining my own wrapper and would be happy to instead help with the getSymbols. Thanks again, Thomas |
RE: Using PnL as a signal [ Reply ] By: Brian Peterson on 2015-01-27 14:00 | [forum:41847] |
I have a weird sense I answered this question already somewhere else... Signals are never path dependent. You have a few options. As described in the documentation, quantstrat loops over symbols when applying rules (which are almost always path dependent, more on this later). To have a P&L dependent rule is certainly possible. As described in the documentation, the rule functions have access to the entire current state of the position, orders, trades, etc for this instrument. What is much harder is a rule that wants up to the moment portfolio state. The design decision that was made was to loop on symbols for performance reasons, not contewxt switching all the time. To get around this, you can use a 'rebalance' rule. these will syncronize the state of all the instruments. There is a prototype Bloomberg getSymbols function in the quantmod sources, testing and feedback would be appreciated. Regards, Brian |
Using PnL as a signal [ Reply ] By: Thomas Dieu on 2015-01-20 13:14 | [forum:41846] |
Hi Quantstrat team, I left quantstrat for a little while, and I am pleased to use it again. But of course nothing is easy. And I have been on a problem for a little while. I need to use the total portfolio PnL as a signal to exit positions. Meaning that when all recent trades are too bad -> exit all positions. My underestanding is that you can usually add signals to the mktdata object, but would it be possible to add a path dependant variable like PnL to the signals ? Or any other way to do it ? Thomas PS : I read on a old message on stackoverflow that you might interested by R developpers with access to Bloomberg (Add src to getSymbols?). If that is still the case, I will be happy to help as I have an access to Bloom. |