Hello all!
For those who may be interested, here is my winning algo from Contest 3. It certainly doesn’t pass the rules today and a very simple template copy but I used this as my IB and contest algo back in January. The ETF’s were chosen with an expectation of a rising interest rate environment and EDV/BIV in case of market weakness. I also wanted to have a lower beta portfolio and this tends to run at about .5. While the submission didn’t win anything I’ve certainly learned a lot in the process. :) Peace!
def initialize(context):
# Define the instruments in the portfolio:
context.sids = {
sid(26981): 0.10, # IAU Gold
sid(35248): 0.25, # SCZ global ex-US
sid(19920): 0.20, # QQQ NASDAQ 100
sid(32521): 0.15, # VOE Mid Cap Value
sid(33650): 0.09, # BIV Intermediate Bond
sid(33370): 0.10, # UUP DB Dollar Bull
sid(22887): 0.05, # EDV Extended Duration
sid(32304): 0.05, # FXC Canadian FX hedge with weak dollar/market
}
# Schedule rebalance to run on the 18th trading day of each month 60 minutes after the market opens.
schedule_function(rebalance, date_rules.month_start(18), time_rules.market_open(minutes=60))
def handle_data(context, data):
pass
def rebalance(context,data):
for sid in context.sids:
if sid in data:
order_target_percent(sid, context.sids[sid])