MiniXC / simple-back

A simple daily python backtester that works out of the box.
Mozilla Public License 2.0
59 stars 12 forks source link

target equity weights #25

Open MiniXC opened 4 years ago

MiniXC commented 4 years ago

It could be beneficial for many strategies to assign target weights to a number of assets, e.g. b.long(['AAPL', 'MSFT'], weights=[.5, .5]) I think sensible default behaviour would be to only allow liquidation of tickers in said weight list to achieve the target weights (but liquidation could be forced with an attribute) and that weights must add up to one. Also assets should only be rebalanced when calling long with the same set of weights again (otherwise a rebalance method could be an option as well).