Back

Get total cash value

What is the code snippet to get the total amount of cash in my account after I sell all holdings?

Update Backtest








try decimal cash = Portfolio.Cash;

and check what

Portfolio.MarginRemaining

and Portfolio.TotalPortfolioValue

returns.

0

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 :(

0

the university in orders section ":( no general information section for portfolio infos or something" does also not provide this infos :(

0

thanks for the feedback. So currently there is no way to know?

0

learning by doing.......if you clone one of the algos and take a look what it is doing you would have seen it......

0

I've clones several and looked at the source of many 

0

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.

0

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

0

the API Tab in the ALGO Lab does list portfolio memebers like MarginRemaining and others !!!!!!!!!!!!!!!!!!!!

0

Don't get your pantyhose in a bunch. The solution is quite large and these are quite simple questions just to get started

0

Update Backtest





0

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.


Loading...

This discussion is closed