optimize() function

Posted By: Jeff1228

optimize() function - 06/29/17 02:45

In the manual, it reads "In portfolio strategies, parameters are optimized for all assets separately. This means when a loop is used, all optimize calls must be inside that loop. If this is not desired, but different assets must still be used, enumerate them in a simple for loop, f.i. for(i=0; Name=Assets[i]; i++) { .... "

I am using MVO script with an assetList of 30 stocks and there is loop() in the script. The problem is, loop() is called in the script to calculate the Return, then, outside the loop, the covariance is calculated and requires the LookBack for all the assets to be the same. So how can I use optimize() to find out the optimal LookBack in this case?

Thank you

Jeff
Posted By: jcl

Re: optimize() function - 06/29/17 11:20

This is one of the mentioned cases in the manual. Replace the loop() with a for() loop.
© 2024 lite-C Forums