Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. total_pnl_list = [(total_today_pnl, total_today_kpi), (total_mtd_pnl, total_mtd_kpi), (total_ytd_pnl + 73462, total_ytd_kpi)]
  2. total_roi_list = [(total_today_pnl / (total_ytd_kpi / 0.3) * 252 , 0.3),
  3. (total_mtd_pnl / (total_ytd_kpi / 0.3) * 252 / 20, 0.3),
  4. ((total_ytd_pnl + 73462) / (total_ytd_kpi / 0.3), 0.3)]
  5. if include_KPI:
  6. print ';'.join(['Total', '', '|'.join([' / '.join(["{:,}".format(int(i[0])), "{:,}".format(int(i[1]))]) for i in total_pnl_list]), '|'.join([' / '.join(["%s %%" % round(i[0] * 100,2), "%s %%" % round(i[1] * 100,2)]) for i in total_roi_list])])
  7. else:
  8. print ';'.join(['Total', '', '|'.join(["{:,}".format(int(i[0])) for i in total_pnl_list])])
  9.  
  10. for output in output_list:
  11. if include_KPI:
  12. if to_management:
  13. print ';'.join([STRATEGY_DUMMY_NAME_MAPPING[output[0]], ','.join(output[1]), '|'.join([' / '.join(["{:,}".format(int(i[0])), "{:,}".format(int(i[1]))]) for i in output[2]]), '|'.join([' / '.join(["%s %%" % round(i[0] * 100, 2), "%s %%" % round(i[1] * 100, 2)]) for i in output[3]])])
  14. # print output[3]
  15. # print '|'.join(['/'.join(["%s %%" % (i[0] * 100), "%s %%" % (i[1] * 100)]) for i in output[3]])
  16. else:
  17. print ';'.join([output[0], ','.join(output[1]), '|'.join([' / '.join(["{:,}".format(int(i[0])), "{:,}".format(int(i[1]))]) for i in output[2]]), '|'.join([' / '.join(["%s %%" % round(i[0] * 100,2), "%s %%" % round(i[1] * 100,2)]) for i in output[3]])])
  18. else:
  19. if to_management:
  20. print ';'.join([STRATEGY_DUMMY_NAME_MAPPING[output[0]], ','.join(output[1]), '|'.join(["{:,}".format(int(i[0])) for i in output[2]])])
  21. else:
  22. print ';'.join([output[0], ','.join(output[1]), '|'.join(["{:,}".format(int(i[0])) for i in output[2]])])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement