Hi,I am trying to insert min max values of variance and return into the objective function but I could not. No,I reviewed but I want to insert min-max normalization values into the risk adjusted return objective function.I want to define normalization for return and variance into one equation.I wrote

stocks_in_sample = data[stocks][t - tau : t]

# n = 19

```
mu = expected_returns.mean_historical_return(stocks_in_sample,frequency=1)
Sigma = risk_models.sample_cov(stocks_in_sample, frequency=1)
risk_aversion=lr_predictions
weight=generate_random_weights(19, seed=None)
min_return=np.min(np.sum((weight*mu)))
max_return=np.max(np.sum((weight*mu)))
min_variance=np.min(np.sum((weight*mu*np.transpose(weight))))
max_variance=np.max(np.sum((weight*mu*np.transpose(weight))))
m = AMPL()
m.eval(
r"""
set A ordered;
param risk_aversion;
param Sigma{A, A};
param mu{A};
param lb default 0;
param ub default 1;
var w{A} >= lb <= ub;
param min_return{A};
param max_return{A};
param min_variance{A};
param max_variance{A};
maximize risk_adjusted_return:
risk_aversion*((sum {i in A} mu[i] * w[i]-min_return)/(max_return-min_return)+(1-risk_aversion)*((sum {i in A, j in A} w[i] * Sigma[i, j] * w[j]-min_variance)/(max_variance-min_variance));
s.t. portfolio_weights:
sum {i in A} w[i] = 1;
"""
```

)

m.set[“A”] = stocks_in_sample

m.param[“mu”] = mu

m.param[“risk_aversion”] = risk_aversion

m.param[“Sigma”] = Sigma

m.param[“min_return”]=min_return

m.param[“max_return”]=max_return

m.param[“min_variance”]=min_variance

m.param[“max_variance”]=max_variance

m.option[“solver”] = “gurobi”

m.solve()

m.solve(verbose=False)

I got Error: line 17 offset 380 syntax error context: risk_aversion*((sum {i in A} mu[i] * >>> w[i]-min_return) <<< /(max_return-min_return)+(1-risk_aversion)*((sum {i in A, j in A} w[i] * Sigma[i, j] * w[j]-min_variance)/(max_variance-min_variance));