I've read the forum posts about the reasons for not open sourcing optimize and the removal paper trading. Quantopian has built an amazing community and it's allowing people like myself to get started, which is amazing. Super appreciative for that.
Since my goal is to take an algorithm and deploy it to production to test and end to end flow I was wondering what's the best way to achieve something similar to optimize? Something that could be backtested in the IDE, and that could be used with pylivetrader for instance.
Watched most of the lectures, and looked through the mlfinlab library which has some optimization methods but I haven't been able to figure out a path forward yet.
Looking to do reimplement the code below. Any suggestions on how to start? Docs/tutorials would be super appreciated.
# Our objective is to maximize alpha, where 'alpha' is defined by the negative of # recent_returns_zscore factor. objective = opt.MaximizeAlpha(context.adx_with_interest) # We want to constrain our portfolio to invest a maximum total amount of money # (defined by MAX_GROSS_EXPOSURE). max_gross_exposure = opt.MaxGrossExposure(MAX_GROSS_EXPOSURE) # We want to constrain our portfolio to invest a limited amount in any one # position. To do this, we constrain the position to be between +/- # MAX_POSITION_CONCENTRATION (on Quantopian, a negative weight corresponds to # a short position). max_position_concentration = opt.PositionConcentration.with_equal_bounds( -MAX_POSITION_CONCENTRATION, MAX_POSITION_CONCENTRATION ) # Stores all of our constraints in a list. constraints = [ max_gross_exposure, max_position_concentration, ] algo.order_optimal_portfolio(objective, constraints)