Hi Dan,
I am trying to have my algo rebalance every monday and friday within the same week. However, when I use the below code I can see from my logs that this does not happen.
For example if I begin on 6/27/2016 (monday) i would expect my next rebalance to be Friday 7/1/2016 but my logs show 6/27/2016 & 7/05/2016.
MINUTES_AFTER_OPEN_TO_TRADE = 300 #2:30pm Eastern
MINUTES_AFTER_OPEN_TO_TRADE_2 = 400 #3:30pm Eastern
# Schedule a function, 'do_portfolio_construction'.
algo.schedule_function(
do_portfolio_construction,
date_rule=algo.date_rules.week_start(days_offset= 0),
time_rule=algo.time_rules.market_open(minutes=MINUTES_AFTER_OPEN_TO_TRADE),
half_days=True,
)
algo.schedule_function(
do_portfolio_construction,
date_rule=algo.date_rules.week_end(days_offset= 0),
time_rule=algo.time_rules.market_open(minutes=MINUTES_AFTER_OPEN_TO_TRADE_2),
half_days=True,
)