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
Example #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_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
Example #4
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