Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Inputting money values

I was wondering, this maybe very trivial, but how could I set up my code such that I can create a variable with X amount of money in it. And then using that run a backtest and the final return value I get from my backtest I can use this to see how much my money would have grown by?

1 response

Take a look at the 'portfolio' object (https://www.quantopian.com/help#api-portfolio). If all you are looking for is the return on your portfolio from the beginning of a backtest to a point in time then use the portfolio.returns method. There are also some other handy values like 'starting_cash' and 'portfolio_value' which you may find useful.