braverock / blotter

blotter provides transaction infrastructure for defining transactions, portfolios and accounts for trading systems and simulation. Provides portfolio support for multi-asset class and multi-currency portfolios. Actively maintained and developed.
114 stars 50 forks source link

[R-Forge #1114] add corporate actions to blotter/FinancialInstrument #26

Open joshuaulrich opened 8 years ago

joshuaulrich commented 8 years ago

Submitted by: Mark Breman Assigned to: Nobody R-Forge link

It was last seen in rev: 308, but seems to be gone now.

Is it dropped for something else?

Thank you,

-Mark-

Followups:

Date: 2010-10-08 11:46 Sender: Brian Peterson moving to feature requests. I'll try to make some progress on this today along with other things. - Brian

Date: 2010-10-08 06:10 Sender: Mark Breman Maybe corporate actions resulting from M&A needs to be supported in the future, but I'm not sure.What happens for instance if a company listing is ended due to an acquisition?All open positions have to be closed at the takeover price?Regards,-Mark-

Date: 2010-10-07 19:58 Sender: Brian Peterson The method you suggest could certainly work. It would be easy enough to put a text->numeric lookup into some internal function in blotter that would keep the numeric codes.So, just to think through some other types:cash additions and withdrawals go in at the account level, no transaction needed.interest paid probably belongs at the account level as well, for simplicitysplits don't realize any P&L, they are changes to positions (and multipliers as well with most derivatives). the simplest way to implement them is to simply adjust the position, leaving the position average cost the sameWith options, we need ASSIGN and EXERCISE transactions, which have some fun characteristics that I'd have to go dig out of my design notes from the last portfolio accounting system we did.Were there any other types you wanted to think about?Regards, - Brian

Date: 2010-10-07 17:50 Sender: Mark Breman Ok I will do some testing with it tomorrow.Why can't Txn.Type not be numeric (like buy/sell = 0, cash dividend = 1 etc.)? What I did in pnl is create an entire new slot for corporate actions ($corp) as I anticipated supporting a lot more types of corporate actions in the future (stock dividends, stock splits etc.) and mixing it all in one slot would clutter the code/data beyond comprehension.Regards,-Mark-

Date: 2010-10-07 17:33 Sender: Brian Peterson It's not exposed in the NAMESPACE, but it's still there.You can access it with blotter:::addDiv()Honestly, it needs more testing, and we should probably add a Txn.Type column to the $txn slot. I'm a little befuddled about how to do that 'safely', as we currently have an all-numeric data store, and adding Txn.Type would make it a character storage mechanism, which I'm afraid would cause bugs in other places.Let us know if you have any feedback or need modifications to this function, as it isn't publicly exposed, it should be easy to change without breaking working code for other people.Regards, - Brian