def plot_signal(self, start=None, end=None):
        """
        使用热力图画出买卖信号
        """
        start = self.account.start_date if start is None else start
        end = self.account.end_date if end is None else end
        _, ax = plt.subplots(figsize=(20, 18))
        sns.heatmap(
            self.account.trade.reset_index().drop(
                'account_cookie',
                axis=1
            ).set_index('datetime').loc[start:end],
            cmap="YlGnBu",
            linewidths=0.05,
            ax=ax
        )
        ax.set_title(
            'SIGNAL TABLE --ACCOUNT: {}'.format(self.account.account_cookie)
        )
        ax.set_xlabel('Code')
        ax.set_ylabel('DATETIME')
        return plt
def plot_signal ( self , start = None , end = None ) : start = self . account . start_date if start is None else start end = self . account . end_date if end is None else end _ , ax = plt . subplots ( figsize = ( 20 , 18 ) ) sns . heatmap ( self . account . trade . reset_index ( ) . drop ( 'account_cookie' , axis = 1 ) . set_index ( 'datetime' ) . loc [ start : end ] , cmap = "YlGnBu" , linewidths = 0.05 , ax = ax ) ax . set_title ( 'SIGNAL TABLE --ACCOUNT: {}' . format ( self . account . account_cookie ) ) ax . set_xlabel ( 'Code' ) ax . set_ylabel ( 'DATETIME' ) return plt
使用热力图画出买卖信号