Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
playing with momentum

can't vouch for this, i didn't really scrutinize slippage or results to make sure i'm not screwing up.
maybe someone can use it as a sample

4 responses

It was really $2.5M spent to increase the portfolio from $1M start to only $1.9M.
Couple of things to consider, check context.portfolio.cash before buy and maybe context.portfolio.positions[security].cost_basis before sell.

good catch gary - thanks
i felt like something was off but had to go cook dinner which is why i qualified the results. i think the portfolio allocation and leverage ratio aren't working the way i expected.
that cash plot will be very helpful for debugging thanks again, i'll fix it up and repost

edit:
the summary code you pasted in there is cool thanks

Sure, I think we've all been there, sort of a rite of passage. :)

Ok i got the leverage reset to 1.0. I was intentionally trying to use 2x leverage before - probably should have been more explicit about that. I'm trying to produce a portfolio with returns similar to pure equities but slightly lower volatility - inspired by the risk premia harvesting guy: http://www.amazon.com/Dual-Momentum-Investing-Innovative-Strategy/dp/0071849440

gary does this look more sane?

has someone on the forum already demonstrated a good way simulate impact of borrowing costs for leverage and/or code tax impact of rebalancing? (or tax loss harvesting?)

the tax thing is especially interesting to me