I have a strategy to divide my total portfolio into thirds and trade every single day of the week. I've been able to implement this in python on another platform but find it a little more difficult on QC. total cash = $6000 target percent return = 3-5% day 1 buy - $2000 day 2 buy - $2000 day 3 buy - $2000 day 4 buy - $2060 *day1 settlement* day 5 buy - $2060 *day2 settlement* weekend weekend day 1 buy - $2060 *day3 settlement* Any ideas of how this can be done?
Michael Handschuh
In QC you can directly model the T+3 day equity settlement rules. Here's an example algorithm that shows how to set u the T+3 modelling. Of special note are the Portfolio.CashBook and Portfolio.UnsettledCashBook properties. These cash books contain the information on how much cash you have in a settled, ready to use state or an unsettled, pending state. Take a look at the log, where I'm dumping each cashbook on each day so you can see how funds transfer from on to the other. In the purchasing schedule above you didn't label any 'sells' - so in the attached algorithm I just sell everything via MarketOnClose orders to fire at EOD.
Travis Teichelmann
Michael Handschuh
Happy to be of help!
Travis Teichelmann
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!