Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
View names and weight after optimizer in long/short equity template

Dear Experts,

I am using the long/short equity template. Is it possible to view the names and their weight after optimizer is used?

Thank you
L

2 responses

Would this do?

show_opt_weights()
Making optimize weights visible

Direct: https://www.quantopian.com/posts/optimization-weights-logging

Like:

Changes  
   alpha      old         new       pct  
 -0.0011    0.0331 =>  -0.0333    -100.8%    AVP  
  0.0118    0.0300 =>   0.0333     111.0%    UPL  
  0.0032    0.0321 =>   0.0333     103.9%    PDLI  
 -0.0118   -0.0323 =>  -0.0333     103.2%    NGD  
 -0.0269   -0.0325 =>  -0.0333     102.5%    APRN  
  0.0183    0.0328 =>   0.0333     101.5%    LC  
  0.0075    0.0329 =>   0.0333     101.3%    OPK  
 -0.0226   -0.0329 =>  -0.0333     101.2%    SGYP  
  0.0269    0.0330 =>   0.0333     101.0%    BLDP  
  0.0011   -0.0357 =>   0.0333     -93.5%    PDS  
  0.0290    0.0335 =>   0.0333      99.6%    ZNGA  
 -0.0247   -0.0335 =>  -0.0333      99.4%    PLUG  
 -0.0290   -0.0337 =>  -0.0333      99.0%    EGO  
 -0.0140   -0.0338 =>  -0.0333      98.6%    ASNA  
 -0.0172   -0.0340 =>  -0.0333      98.0%    MUX  
 -0.0043   -0.0341 =>  -0.0333      97.7%    AUY  
  0.0097    0.0343 =>   0.0333      97.3%    CHK  
 -0.0172   -0.0343 =>  -0.0333      97.1%    NVAX  
  0.0054    0.0344 =>   0.0333      96.9%    TRQ  

@Blue

It works wonderfully. I only can see the weights for 10 assets but I have about 200 assets. How to view them all?

Thanks
L