spot_OTA = prices.price.OTA2201.groupby(lambda x: x.date()).mean() spot_BEN = prices.price.BEN2201.groupby(lambda x: x.date()).mean() spot_OTA_EXMEAN = pd.expanding_mean(spot_OTA) # Otahuhu expanding mean spot_BEN_EXMEAN = pd.expanding_mean(spot_BEN) # Benmore expanding mean OTA_BA = ea.CQ_data(otahuhu, ota, spot_OTA_EXMEAN, CQ, "otahuhu") BEN_BA = ea.CQ_data(benmore, ben, spot_BEN_EXMEAN, CQ, "benmore") print "Generate LaTex table" ea.asx_table_maker(otahuhu, benmore, ota, ben, CQ, path + "/tables/asx_table_1.tex") # ea.asx_market_comment(ota,ben,path + '/comments/comment.tex') print "Printing Hedge Market data" ea.forward_price_curve(9, ota, "Reds", path + "/figures/ota_fpc.pdf") ea.forward_price_curve(9, ota, "Reds", path + "/figures/ota_fpc.png") ea.forward_price_curve(10, ben, "Blues", path + "/figures/ben_fpc.pdf") ea.forward_price_curve(10, ben, "Blues", path + "/figures/ben_fpc.png") ea.bid_ask_plot(11, OTA_BA, BEN_BA, path + "/figures/cq_trend.pdf") ea.bid_ask_plot(11, OTA_BA, BEN_BA, path + "/figures/cq_trend.png") ea.plot_monthly_volumes(12, ota, ben, path + "/figures/asx_volumes.pdf") ea.plot_monthly_volumes(12, ota, ben, path + "/figures/asx_volumes.png") ea.plot_open_interest(13, ota, ben, path + "/figures/asx_opint.pdf") ea.plot_open_interest(13, ota, ben, path + "/figures/asx_opint.png") mpl.rcParams["xtick.labelsize"] = 16 # setting tick label size ota_sum, ota_win = ea.filter_last_year(ota, CQ) ben_sum, ben_win = ea.filter_last_year(ben, CQ) ea.plot_last_year(14, ota_sum, ota_win, path + "/figures/asx_ota_year.pdf") ea.plot_last_year(14, ota_sum, ota_win, path + "/figures/asx_ota_year.png") ea.plot_last_year(15, ben_sum, ben_win, path + "/figures/asx_ben_year.pdf")