J Li·Follow1 min read·Nov 29, 2018--ListenShareYou can use scypi.optimize to find the optimal. You need to define a function you want to optimize first. In this case, you need a function to compute sharp ratio. Then optimize with optimizer, you can get the optimal allocation of each stocks.