[Add] function for get backtesting trade/order data
This commit is contained in:
parent
3ecd3f7e9f
commit
6c24d46d6a
@ -390,3 +390,11 @@ class BacktesterEngine(BaseEngine):
|
||||
self.thread.start()
|
||||
|
||||
return True
|
||||
|
||||
def get_all_trades(self):
|
||||
""""""
|
||||
return self.backtesting_engine.get_all_trades()
|
||||
|
||||
def get_all_orders(self):
|
||||
""""""
|
||||
return self.backtesting_engine.get_all_orders()
|
||||
|
@ -1019,6 +1019,18 @@ class BacktestingEngine:
|
||||
"""
|
||||
print(f"{datetime.now()}\t{msg}")
|
||||
|
||||
def get_all_trades(self):
|
||||
"""
|
||||
Return all trade data of current backtesting result.
|
||||
"""
|
||||
return self.trades.values()
|
||||
|
||||
def get_all_orders(self):
|
||||
"""
|
||||
Return all limit order data of current backtesting result.
|
||||
"""
|
||||
return self.limit_orders.values()
|
||||
|
||||
|
||||
class DailyResult:
|
||||
""""""
|
||||
|
Loading…
Reference in New Issue
Block a user