Jan-12-2023, 07:14 PM
(Jan-12-2023, 03:46 PM)deanhystad Wrote: An indentation error?
for R in returns: constraints = ({'type': 'eq', 'fun': b}, {'type': 'eq', 'fun': lambda w: GR(w) - R}) opt = minimize(minimizeMyvolatility, w0, method = 'SLSQP', bounds = bounds, constraints = constraints) --->volatility_opt.append(opt['fun'])
Yes, that's it, now it works! I've triple-checked everything and as a pure rookie, I haven't considered the indentation...
Thank you very much for real, mr. Deanhystad :)