PandasTraderRunner#
tradeexecutor.strategy.pandas_trader.runner.PandasTraderRunner class.
- class PandasTraderRunner[source]#
Bases:
StrategyRunner
A trading executor for Pandas math based algorithm.
- __init__(*args, decide_trades, max_data_age=None, **kwargs)[source]#
- Parameters
decide_trades (TradeDecider) –
Methods
__init__
(*args, decide_trades[, max_data_age])check_position_triggers
(clock, state, ...)Check stop loss/take profit for positions.
on_clock
(clock, executor_universe, ...)Run one strategy tick.
on_data_signal
()pretick_check
(ts, universe)Check the data looks more or less sane.
report_after_execution
(clock, universe, ...)report_after_sync_and_revaluation
(clock, ...)report_before_execution
(clock, universe, ...)report_strategy_thinking
(clock, universe, ...)Strategy runner subclass can fill in.
revalue_portfolio
(ts, state, valuation_method)Revalue portfolio based on the data.
setup_routing
(universe)Setups routing state for this cycle.
sync_portfolio
(ts, universe, state, ...)Adjust portfolio balances based on the external events.
tick
(clock, universe, state, debug_details)Perform the strategy main tick.
- __init__(*args, decide_trades, max_data_age=None, **kwargs)[source]#
- Parameters
decide_trades (TradeDecider) –
- on_clock(clock, executor_universe, pricing_model, state, debug_details)[source]#
Run one strategy tick.
- Parameters
clock (datetime) –
executor_universe (TradingStrategyUniverse) –
pricing_model (PricingModel) –
state (State) –
debug_details (dict) –
- Return type
- pretick_check(ts, universe)[source]#
Check the data looks more or less sane.
- Parameters
ts (datetime) –
universe (TradingStrategyUniverse) –