コード例 #1
0
 def with_multipe_files():
     res_list = [
         load_csv_results('backtestd/tests/files/ash_EURUSD.csv'),
         load_csv_results('backtestd/tests/files/ash_AUDCAD.csv')
     ]
     merged = merge_csv_results(res_list)
     assert isinstance(merged, pd.DataFrame)
     assert "HitMiss" in merged
     assert len(merged) == 10472
コード例 #2
0
ファイル: run.py プロジェクト: stfl/backtestd.py
 def load_csv_results_from_path_list(self, csv_paths):
     """Load the csv results into a pandas Dataframe"""
     results = []
     for p in csv_paths:
         res = load_csv_results(p)
         results.append(res)
     self.results = merge_csv_results(results)
コード例 #3
0
ファイル: run.py プロジェクト: stfl/backtestd.py
 def __load_csv_results_after_exec(self):
     results = []
     for sym in self.symbols:
         p = construct_accessible_csv_path(self.name + "_" + sym + ".csv")
         log.debug("trying to load csv results {}".format(p))
         if p.exists():
             res = load_csv_results(p)
             if isinstance(res, pd.DataFrame):
                 log.debug("loaded {} results from {}".format(len(res), p))
                 results.append(res)
     if len(results) == 0:
         log.error("no results loaded")
         # TODO exception?
     else:
         self.results = merge_csv_results(results)
コード例 #4
0
def test_load_csv_results():
    res = load_csv_results('backtestd/tests/files/ash_EURUSD.csv')
    assert isinstance(res, pd.DataFrame)
    assert len(res) == 10472