Advertisement
Guest User

code_api_v2/Var_MVO.py

a guest
Sep 2nd, 2015
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. w = max_ret_MVO(returns, cust_ind, names,0.05,10000)
  2. print w
  3. sp5 = np.load("SP500.npy")
  4. sp5 = sp5[1:]
  5. plt.plot(sp5)
  6.  
  7. dee = np.sum((p2*w.reshape((len(p2),-1))), axis = 0)[1:]
  8. multiplier = sp5[0]/dee[0]
  9. plt.plot(dee*multiplier)
  10. #print multiplier
  11. plt.xlabel('Weeks into the year')
  12. plt.ylabel('Price')
  13. plt.title('DFY output performance vs S&P500')
  14. plt.legend(["S&P500", "DFY Output"], loc = 0)
  15. plt.show()
  16.  
  17.  
  18. #Just Plotting price for one
  19. #print names[0]
  20. #plt.plot(p2[0])
  21. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement