Hello. I'm new to this website, and trying to code my first algorithm. Very new to this process. I'm trying to figure out how to establish the initial weighting for my portfolio, before my re-balancing strategy kicks in thereafter. So...
I put my underlyings of choice under def initialize(context):
And under it I insert schedule_function(my_rebalance, date_rules.month_end(), time_rules.market_open()) in order to rebalance monthly according to whatever strategy I insert under def my_rebalance (context, data):
But If I have two underlyings (say DIA and SPY), and I want to put 20% in DIA and 80% in SPY to start off, how do I do that? I'd guess I have to use some heading before and above def my_rebalance (context, data):?
Thank you very much in advance.