A simple All Weather Portfolio with ETF and Leverage
A simple All Weather Portfolio with ETF and Leverage
This is All Weather Portfolio by Ray Dalio my version, was published somewhere on this forum sometime in the past.
# -------------------------------------------------------------------------------------------------
assets = symbols('SPY', 'TLT', 'IEF', 'GLD', 'DBC'); wt = [0.30, 0.40, 0.15, 0.075, 0.075]; M = [1]
# -------------------------------------------------------------------------------------------------
def initialize(context):
schedule_function(trade, date_rules.month_start(), time_rules.market_open(minutes = 65), True)
context.invested = False
def trade(context,data):
if get_open_orders() or (context.invested and get_datetime().month not in M): return
for i in range(len(assets)):
if data.can_trade(assets[i]):
order_target_percent(assets[i], wt[i])
context.invested = True