Module areixio.orchestrators.backtest
Classes
class BackTest (feeds: Union[List[areixio.datafeed.DataFeed], areixio.datafeed.DataFeed], StrategyClass: Strategy, benchmark: areixio.datafeed.DataFeed = None, logger: Any = None, trade_history: list = [], transfer_history: list = [], position_history: list = [], store_path: str = '', broker: areixio.broker.Broker = None, skip_datafeed: bool = False, backtest_mode: str = 'bar', do_print: bool = True, in_daily_basis: bool = False, resample_rule: str = '', hist_trade_skip_checking: bool = False, upload_to_s3: bool = False, debug: bool = False, **kwargs)
-
Orchestrator for conducting backtesting
Args
feeds
:Union[List[DataFeed], DataFeed]
- data feeds
StrategyClass
:Strategy
- Strategy Class
benchmark
:DataFeed
, optional- benchmark. Defaults to None.
logger
:Any
, optional- logger. Defaults to None.
trade_history
:list
, optional- trade history. Defaults to [].
example:
[ { 'symbol':'BTC/USDT', 'datetime': datetime(2021, 3, 30, 20, 58, 8), 'quantity':0.003, 'price':30304, 'side':'BUY', 'assrt_type':'SPOT', 'leverage':10 }, .... ]
position_history
:list
, optional- position history. Defaults to [].
broker
:Broker
, optional- broker. Defaults to None.
skip_datafeed
:bool
, optional- skip_datafeed. Defaults to False.
backtest_mode
:str
, optional- backtest_mode. Defaults to "bar". ['bar', 'tick', 'bar_tick']
do_print
:bool
, optional- do_print. Defaults to True.
in_daily_basis
:bool
, optional- in_daily_basis. Defaults to False.
resample_rule
:str
, optional- resample_rule. Defaults to ''.
Ancestors
- areixio.orchestra.Orchestrator
Methods
def optimize(self, maximize: Union[str, Callable[[pandas.core.series.Series], float]] = 'sqn', constraint: Callable[[dict], bool] = None, return_heatmap: bool = False, return_mean_value: bool = False, method: str = 'grid', max_tries: Union[int, float] = None, random_state: int = None, return_optimization: bool = False, **kwargs) ‑> Union[pandas.core.series.Series, Tuple[pandas.core.series.Series, pandas.core.series.Series]]
def start(self)
-
The function to kick start the backtesting process
Raises
ValueError
- [description]