Exemplo n.º 1
0
def plotPriceAndBeLong(issue, modelStartDate, modelEndDate, valData):
    from Code.lib.plot_utils import PlotUtility
    plotIt = PlotUtility()
    plotTitle = "Close " + str(modelStartDate) + " to " + str(modelEndDate)
    plotIt.plot_v2x(valData, plotTitle)
    plt.show(block=False)
    plotIt.histogram(valData['beLong'], x_label="beLong signal", y_label="Frequency", 
      title = "beLong distribution for " + issue)        
    plt.show(block=False)
Exemplo n.º 2
0
    show_plot = False
    # IS only
    for i in range(segments):
        print("====================================")
        print("IN SAMPLE")
        print('{0} to {1}'.format(modelStartDate, modelEndDate))

        mmData = dataSet[modelStartDate:modelEndDate].copy()
        nrows = mmData.shape[0]

        if show_plot == True:
            plotTitle = issue + ", " + str(modelStartDate) + " to " + str(
                modelEndDate)
            plotIt.plot_v2x(mmData, plotTitle)
            plotIt.histogram(mmData['beLong'],
                             x_label="beLong signal",
                             y_label="Frequency",
                             title="beLong distribution for " + issue)
            plt.show(block=False)

        # Stationarity tests
#        stationarity_tests(mmData, 'Close', issue)
#        cols = [k for k,v in feature_dict.items() if v == 'Keep']
#        for x in cols:
#            stationarity_tests(mmData, x, issue)

        plot_dict = {}
        plot_dict['Issue'] = issue
        plot_vars = [k for k, v in feature_dict.items() if v == 'Keep']
        plot_dict['Plot_Vars'] = plot_vars
        plot_dict['Volume'] = 'Yes'
        plotIt.price_Ind_Vol_Plot(plot_dict, mmData)