'A simple script to plot the balance of the portfolio, or
"equity curve", as a function of time.'

def plot_results(self):

    sns.set_palette('deep', desat=0.6)
    sns.set_context(rc={'figure.figsize': (8, 4)})
    fig = plt.figure()
    fig.patch.set_facecolor('white')
    df = pd.DataFrame()
    df['equity'] = pd.Series(self.equity, index=self.timeseries)
    df['equity_returns'] = pd.Series(self.equity_returns, index=self.timeseries)
    df['drawdowns'] = pd.Series(self.drawdowns, index=self.timeseries)
    ax1 = fig.add_subplot(311, ylabel='Equity    Value')
    df['equity'].plot(ax=ax1, color=sns.color_palette()[0])
    ax2 = fig.add_subplot(312, ylabel='Equity    Returns')
    df['equity_returns'].plot(ax=ax2, color=sns.color_palette()[1])
    ax3 = fig.add_subplot(313, ylabel='Drawdowns')
    df['drawdowns'].plot(ax=ax3, color=sns.color_palette()[2])
    fig.autofmt_xdate()
    plt.show()
