Пример #1
0
    def call_prom(self, other_args: List[str]):
        """Process prom command"""
        parser = argparse.ArgumentParser(
            add_help=False,
            formatter_class=argparse.ArgumentDefaultsHelpFormatter,
            prog="prom",
            description=
            "Display dark pool (ATS) data of tickers with growing trades activity",
        )
        parser.add_argument(
            "-n",
            "--num",
            action="store",
            dest="n_num",
            type=check_positive,
            default=1_000,
            help=
            "Number of tickers to filter from entire ATS data based on the sum of the total weekly shares quantity.",
        )
        parser.add_argument(
            "-t",
            "--top",
            action="store",
            dest="n_top",
            type=check_positive,
            default=5,
            help=
            "List of tickers from most promising with better linear regression slope.",
        )
        parser.add_argument(
            "--tier",
            action="store",
            dest="tier",
            type=str,
            choices=["T1", "T2", "OTCE"],
            default="",
            help="Tier to process data from.",
        )
        parser.add_argument(
            "--export",
            choices=["csv", "json", "xlsx"],
            default="",
            dest="export",
            help="Export dataframe data to csv,json,xlsx file",
        )
        try:
            ns_parser = parse_known_args_and_warn(parser, other_args)
            if not ns_parser:
                return

            finra_view.darkpool_otc(
                num=ns_parser.n_num,
                promising=ns_parser.n_top,
                tier=ns_parser.tier,
                export=ns_parser.export,
            )

        except Exception as e:
            print(e, "\n")
Пример #2
0
def test_darkpool_otc(mocker):
    mocker.patch.object(target=finra_view.gtff, attribute="USE_ION", new=False)
    mocker.patch("matplotlib.pyplot.show")

    finra_view.darkpool_otc(
        num=2,
        promising=2,
        tier="T1",
        export="",
    )
def test_darkpool_otc(mocker):
    # MOCK VISUALIZE_OUTPUT
    mocker.patch(
        target=
        "gamestonk_terminal.helper_classes.TerminalStyle.visualize_output")

    finra_view.darkpool_otc(
        num=2,
        promising=2,
        tier="T1",
        export="",
    )
Пример #4
0
 def call_prom(self, other_args: List[str]):
     """Process prom command"""
     parser = argparse.ArgumentParser(
         add_help=False,
         formatter_class=argparse.ArgumentDefaultsHelpFormatter,
         prog="prom",
         description=
         "Display dark pool (ATS) data of tickers with growing trades activity using linear regression.",
     )
     parser.add_argument(
         "-n",
         "--num",
         action="store",
         dest="n_num",
         type=check_positive,
         default=1_000,
         help=
         "Number of tickers to filter from entire ATS data based on the sum of the total weekly shares quantity.",
     )
     parser.add_argument(
         "-l",
         "--limit",
         action="store",
         dest="limit",
         type=check_positive,
         default=10,
         help="Limit of most promising tickers to display.",
     )
     parser.add_argument(
         "-t",
         "--tier",
         action="store",
         dest="tier",
         type=str,
         choices=["T1", "T2", "OTCE"],
         default="",
         help="Tier to process data from.",
     )
     if other_args and "-" not in other_args[0][0]:
         other_args.insert(0, "-l")
     ns_parser = parse_known_args_and_warn(parser, other_args,
                                           EXPORT_ONLY_RAW_DATA_ALLOWED)
     if ns_parser:
         finra_view.darkpool_otc(
             num=ns_parser.n_num,
             promising=ns_parser.limit,
             tier=ns_parser.tier,
             export=ns_parser.export,
         )