Investing cash (How to program strategies based on available portfolio cash?)
Author: innertrader
Creation Date: 3/18/2014 11:19 PM
profile picture

innertrader

#1
I would like to program a strategy where uninvested cash generated from equity sales can be invested in bonds. I found the following in the programmers guide:

QUOTE:
Strategy Code Limitations

Strategies based on Portfolio Equity, Cash, or Drawdown

Due to the Wealth-Lab Pro Version 6 architecture, it is not possible to create trading strategies that enter or exit trades as a function of Portfolio Equity, which includes Portfolio Cash and Drawdown. Refer to the QuickRef when selecting WealthScript functions or object properties for information regarding their use in Strategy code.


Do I correctly interpret that to mean that it is not possible to program trading strategies that are triggered based on available cash in the portfolio? Does it also imply that there is no way currently to access or determine the amount of cash in the portfolio bar by bar to initiate a trade based on available cash (and selling bonds to generate cash when needed to buy equities)?

If I am incorrect and there is some model of how this could be done, i would appreciate a pointer to it. Thanks.
profile picture

Eugene

#2
While the premise remains true in general, there are two workarounds:

1. Track "shadow" portfolio equity (cash) using this technique:

Interacting Dynamically with Portfolio Level Equity

2. Using SetShareSize in your strategy, keep track of portfolio equity in a DataSetSymbols loop like Cone's examples in posts #12 and #15 illustrate:

Limit Monthly Drawdown / Portfolio Equity Tracker
profile picture

innertrader

#3
Thank you, Eugene. I'll look into these.
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).