Access portfolio Cash curve in code for position sizing?
Author: mlyon37
Creation Date: 4/16/2014 10:35 PM
profile picture

mlyon37

#1
Hi,

Is there a way to access the portfolio cash position by bar within a script?

Starting with a cash position I was hoping to size a position in a backtest with something like

Shares = floor (.2* Cash / Price)

and then feed that into a buy order. I've looked at PosSize but it didn't have exactly what I was looking for and thought there may be a more flexible method.

Thanks,
M
profile picture

Eugene

#2
An alternative solution to access the Cash series exists but programming a PosSizer is exactly what you're looking for. Leaving these pointers here only for completeness' sake:

How to access Cash Curve from strategy
Investing cash (How to program strategies based on available portfolio cash?)
profile picture

mlyon37

#3
Ok. Let me check that out. Thanks
profile picture

mlyon37

#4
Got this to work, thanks again. I'll clean up and post the code this weekend.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).