def call_acf(self, other_args: List[str]):
     """Process acf command"""
     parser = argparse.ArgumentParser(
         add_help=False,
         formatter_class=argparse.ArgumentDefaultsHelpFormatter,
         prog="acf",
         description="""
             Auto-Correlation and Partial Auto-Correlation Functions for diff and diff diff stock data
         """,
     )
     parser.add_argument(
         "-w",
         "--window",
         dest="lags",
         type=check_positive,
         default=15,
         help="maximum lags to display in plots",
     )
     ns_parser = parse_known_args_and_warn(parser, other_args)
     if ns_parser:
         qa_view.display_acf(
             name=self.ticker,
             df=self.df,
             target=self.target,
             lags=ns_parser.lags,
         )
Exemple #2
0
    def call_acf(self, other_args: List[str]):
        """Process acf command"""
        parser = argparse.ArgumentParser(
            add_help=False,
            formatter_class=argparse.ArgumentDefaultsHelpFormatter,
            prog="acf",
            description="""
                Auto-Correlation and Partial Auto-Correlation Functions for diff and diff diff stock data
            """,
        )
        parser.add_argument(
            "-l",
            "--lags",
            dest="lags",
            type=check_positive,
            default=15,
            help="maximum lags to display in plots",
        )
        ns_parser = parse_known_args_and_warn(parser, other_args)
        if ns_parser:
            if self.target != "AdjClose":
                console.print(
                    "Target not AdjClose.  For best results, use `pick AdjClose` first."
                )

            qa_view.display_acf(
                name=self.ticker,
                df=self.stock,
                target=self.target,
                lags=ns_parser.lags,
            )