SimulatedTestTrader#
API documentation for tradeexecutor.testing.simulated_trader.SimulatedTestTrader Python class in Trading Strategy framework.
- class SimulatedTestTrader[source]#
Bases:
object
Create trades.
- __init__(state, pricing_model)[source]#
- Parameters:
state (State) –
pricing_model (PricingModel) –
Methods
__init__
(state, pricing_model)buy
(ts, pair, amount_in_usd)Buy token (trading pair) for a certain value.
sell
(pair, quantity)Sell token token (trading pair) for a certain quantity.
simulate_execution
(state, trade[, price_impact])- __init__(state, pricing_model)[source]#
- Parameters:
state (State) –
pricing_model (PricingModel) –
- buy(ts, pair, amount_in_usd)[source]#
Buy token (trading pair) for a certain value.
- Parameters:
ts (datetime) –
pair (TradingPairIdentifier) –
amount_in_usd (Decimal) –
- Return type:
- sell(pair, quantity)[source]#
Sell token token (trading pair) for a certain quantity.
- Parameters:
pair (TradingPairIdentifier) –
quantity (Decimal) –
- Return type: