This was a test backtest for all-weather portfolio by inspired by Ray Dalio
This was a test backtest for all-weather portfolio by inspired by Ray Dalio
@ Peter,
Try this simple version from my library:
# Ray Dalio All Weather portfolio
# --------------------------------------------------
ASSETS = symbols('VTI', 'TLT', 'IEF', 'GLD', 'DBC')
LEV, WT = 1.0, [0.30, 0.40, 0.15, 0.075, 0.075]
# --------------------------------------------------
def initialize(context):
schedule_function(trade, date_rules.month_start(), time_rules.market_open(minutes = 65))
def trade(context, data):
if get_datetime().month not in [1] or get_open_orders(): return
for i, asset in enumerate (ASSETS):
if data.can_trade(asset):
order_target_percent(asset, LEV*WT[i])