コード例 #1
0
    def test_hurst_regions(self):
        one_nine = Evaluation.load_csv(self.corr_root + "1-9.csv")

        nine_seventeen = Evaluation.load_csv(self.corr_root + "9-17.csv")

        seventeen_twenty_two = Evaluation.load_csv(self.corr_root +
                                                   "17-22.csv")

        Evaluation.compare_returns(one_nine.append(seventeen_twenty_two))
コード例 #2
0
    def test_compare_order_metrics(self):
        sim_root = self.config.sim_root + self.sim_st.date().isoformat(
        ) + "/" + self.sim_st.time().isoformat() + "/"
        all_sims = DataLoader().load_sim_data(sim_root)
        all_sim_limit_orders = list(
            map(lambda sim: DataSplitter.get_limit_orders(sim[0].compute()),
                all_sims))
        all_sim_market_orders = list(
            map(lambda sim: DataSplitter.get_market_orders(sim[0].compute()),
                all_sims))
        all_sim_trades = list(map(lambda sim: sim[1].compute(), all_sims))
        all_sim_cancels = list(map(lambda sim: sim[2].compute(), all_sims))

        feed_df = DataLoader().load_feed(
            self.config.real_root, self.sim_st,
            self.sim_st + timedelta(seconds=self.config.simulation_window),
            self.config.product)
        real_orders = DataSplitter.get_orders(feed_df)
        real_limit_orders = DataSplitter.get_limit_orders(real_orders)
        real_market_orders = DataSplitter.get_market_orders(real_orders)
        real_trades = DataSplitter.get_trades(feed_df)
        real_trades['size'] = pd.to_numeric(real_trades['remaining_size'])
        real_cancels = DataSplitter.get_cancellations(feed_df)
        real_cancels['size'] = pd.to_numeric(real_cancels['remaining_size'])

        print("Order Buy/Sell limit metrics")
        Evaluation.compare_order_metrics(real_limit_orders,
                                         all_sim_limit_orders)
        print("Order Buy/Sell market metrics")
        Evaluation.compare_order_metrics(real_market_orders,
                                         all_sim_market_orders)
        print("Cancel metrics")
        Evaluation.compare_order_metrics(real_cancels, all_sim_cancels)
        print("Trade metrics")
        Evaluation.compare_metrics(real_trades, all_sim_trades)
コード例 #3
0
    def test_correlate_100_percentiles_midprice_inv(self):
        df = Evaluation.load_csv(self.corr_root +
                                 "LTC-USD-100-inv-midprice.csv")

        Evaluation.compare_returns(df, compare_lyapunov_exponent=True)
コード例 #4
0
    def test_correlate_100_percentiles_trades_fix(self):
        df = Evaluation.load_csv(self.corr_root + "LTC-USD-100-fix-trades.csv")

        Evaluation.compare_returns(df)
コード例 #5
0
    def test_correlate_100_percentiles_midprice(self):
        df = Evaluation.load_csv(self.corr_root +
                                 "LTC-USD-100-percentiles-midprice.csv")

        Evaluation.compare_returns(df)
コード例 #6
0
    def test_can_correlate_50(self):
        df = Evaluation.load_csv(self.corr_root + "LTC-USD-50-sims.csv")

        Evaluation.compare_returns(df)
コード例 #7
0
    def test_can_correlate_10(self):
        df = Evaluation.load_csv(self.corr_root + "LTC-cov.csv")

        Evaluation.compare_returns(df)
コード例 #8
0
    def test_correlate_LTC_USD_26_05_2018_all(self):
        df = Evaluation.load_csv(self.corr_root +
                                 "LTC-USD/26-05-2018-all-midprice.csv")

        Evaluation.compare_returns(df)
コード例 #9
0
    def test_correlate_ETH_USD_all(self):
        df = Evaluation.load_csv(self.corr_root +
                                 "ETH-USD/17-05-2018-all-midprice.csv")

        Evaluation.compare_returns(df, window=100)
コード例 #10
0
    def test_correlate_BCH_USD_trade(self):
        df = Evaluation.load_csv(self.corr_root +
                                 "BCH-USD/17-05-2018-trade.csv")

        Evaluation.compare_returns(df, window=100)
コード例 #11
0
    def test_correlate_cancel_relative(self):
        df = Evaluation.load_csv(self.corr_root +
                                 "LTC-USD/cancel-relative-midprice.csv")

        Evaluation.compare_returns(df)
コード例 #12
0
    def test_correlate_report_LTC_USD_2_day(self):
        df = Evaluation.load_csv(self.corr_root +
                                 "report/LTC-USD-17-18-5-2018.csv")

        Evaluation.compare_returns(df)
コード例 #13
0
    def test_correlate_report_LTC_USD_some_removed(self):
        df = Evaluation.load_csv(
            self.corr_root + "report/LTC-USD-sims-some-removed-17-5-2018.csv")

        Evaluation.compare_returns(df)
コード例 #14
0
    def test_correlate_utc_mid_trade(self):
        df = Evaluation.load_csv(self.corr_root + "LTC-USD-mid-trade.csv")

        Evaluation.compare_returns(df)
コード例 #15
0
    def test_correlate_utc_midprice(self):
        df = Evaluation.load_csv(self.corr_root + "LTC-USD-utc.csv")

        Evaluation.compare_returns(df)