What is the code snippet to get the total amount of cash in my account after I sell all holdings?
QUANTCONNECT COMMUNITY
What is the code snippet to get the total amount of cash in my account after I sell all holdings?
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.
Michael Manus
try decimal cash = Portfolio.Cash;
and check what
Portfolio.MarginRemaining
and Portfolio.TotalPortfolioValue
returns.
Michael Manus
Jared Broad the docu section "Securities and Portfolio" describes securities but no portfolio....there is not even a link to portfolio...i tried to find the correct class description but failed.... :(
maybe it could be added one day only the main things like
he needs portfolio.cash but there is no direct link for a user....a developer knows what he needs but no description what i could also use/need. Using the LAB and typing "Portfolio." does not answer his question too :(
Michael Manus
the university in orders section ":( no general information section for portfolio infos or something" does also not provide this infos :(
Iman Mohtashemi
thanks for the feedback. So currently there is no way to know?
Michael Manus
learning by doing.......if you clone one of the algos and take a look what it is doing you would have seen it......
Iman Mohtashemi
I've clones several and looked at the source of many
Michael Manus
oh :(
there is everywhere star wars now so lets answer this question with a yoda quote:
"When you summon the courage to do what others won't, you will have in life what others don't."
:)
too few algos you looked at :)
na they will add some infos everywhere i am sure.
Michael Manus
there is an example missing in the university that shows the differences between MarginRemaining & cash & TotalPortfolioValue & others.....
because if someone has 20 years of experience in trading but no programming skills its maybe not a beginner.... i dont know, depends
Michael Manus
the API Tab in the ALGO Lab does list portfolio memebers like MarginRemaining and others !!!!!!!!!!!!!!!!!!!!
Iman Mohtashemi
Don't get your pantyhose in a bunch. The solution is quite large and these are quite simple questions just to get started
Iman Mohtashemi
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!