def plot_percent_return_lines(self):
        """Plot percent returns for each symbol for the entire time period as a
        line plot.
        """
        percent_returns = self._get_percent_returns(True)
        title = 'Symbol Returns\n'

        plot = percent_returns.plot(kind='line', ax=plt.gca())
        plot.set_title(title, color=self._TEXT_COLOR)
        plot_utils.format_x_ticks_as_dates(plot)
        plot_utils.format_y_ticks_as_percents(plot)
        plot_utils.format_legend(plot, self._TEXT_COLOR)
        return plot
Exemple #2
0
    def plot_percent_return_lines(self):
        """Plot percent returns for each symbol for the entire time period as a
        line plot.
        """
        percent_returns = self._get_percent_returns(True)
        title = 'Symbol Returns\n'

        plot = percent_returns.plot(kind='line', ax=plt.gca())
        plot.set_title(title, color=self._TEXT_COLOR)
        plot_utils.format_x_ticks_as_dates(plot)
        plot_utils.format_y_ticks_as_percents(plot)
        plot_utils.format_legend(plot, self._TEXT_COLOR)
        return plot
    def plot_profit_and_loss_lines(self):
        """Plot the profit and loss of the portfolio for the entire time period
        as a line plot.

        Args:
            group: Whether to aggregate based on symbol_groups in config.
        """
        profit_and_loss = self._get_profit_and_loss()
        title = ('Cumulative P&L | ' + self._TITLE_DOLLAR_FORMAT + (
            '\n')).format(profit_and_loss[-1])

        plot = profit_and_loss.plot(kind='line', ax=plt.gca())
        plot.set_title(title, color=self._TEXT_COLOR)
        plot_utils.format_x_ticks_as_dates(plot)
        plot_utils.format_y_ticks_as_dollars(plot)
        return plot
Exemple #4
0
    def plot_profit_and_loss_lines(self):
        """Plot the profit and loss of the portfolio for the entire time period
        as a line plot.

        Args:
            group: Whether to aggregate based on symbol_groups in config.
        """
        profit_and_loss = self._get_profit_and_loss()
        title = ('Cumulative P&L | ' + self._TITLE_DOLLAR_FORMAT +
                 ('\n')).format(profit_and_loss[-1])

        plot = profit_and_loss.plot(kind='line', ax=plt.gca())
        plot.set_title(title, color=self._TEXT_COLOR)
        plot_utils.format_x_ticks_as_dates(plot)
        plot_utils.format_y_ticks_as_dollars(plot)
        return plot
    def plot_dollar_value_lines(self, group=False):
        """Plot the dollar value of portfolio holdings for the entire time
        period as a line plot.

        Args:
            group: Whether to aggregate based on symbol_groups in config.
        """
        dollar_values = self._get_dollar_values(group)
        dollar_values['TOTAL'] = dollar_values.sum(1)
        title = ('Portfolio Value | ' + self._TITLE_DOLLAR_FORMAT + (
            '\n')).format(dollar_values['TOTAL'].ix[-1])

        plot = dollar_values.plot(kind='line', ax=plt.gca())
        plot.set_title(title, color=self._TEXT_COLOR)
        plot_utils.format_x_ticks_as_dates(plot)
        plot_utils.format_y_ticks_as_dollars(plot)
        plot_utils.format_legend(plot, self._TEXT_COLOR)
        return plot
Exemple #6
0
    def plot_dollar_value_lines(self, group=False):
        """Plot the dollar value of portfolio holdings for the entire time
        period as a line plot.

        Args:
            group: Whether to aggregate based on symbol_groups in config.
        """
        dollar_values = self._get_dollar_values(group)
        dollar_values['TOTAL'] = dollar_values.sum(1)
        title = ('Portfolio Value | ' + self._TITLE_DOLLAR_FORMAT +
                 ('\n')).format(dollar_values['TOTAL'].ix[-1])

        plot = dollar_values.plot(kind='line', ax=plt.gca())
        plot.set_title(title, color=self._TEXT_COLOR)
        plot_utils.format_x_ticks_as_dates(plot)
        plot_utils.format_y_ticks_as_dollars(plot)
        plot_utils.format_legend(plot, self._TEXT_COLOR)
        return plot