DummyTestTrader#

tradeexecutor.testing.dummy_trader.DummyTestTrader class.

class DummyTestTrader[source]#

Bases: object

Helper class to generate trades for tests.

This trade helper is not connected to any blockchain - it just simulates txid and nonce values.

__init__(state, lp_fees=2.5, price_impact=0.99)[source]#
Parameters

state (State) –

Methods

__init__(state[, lp_fees, price_impact])

buy(pair, quantity, price)

buy_with_price_data(pair, quantity, ...)

create(pair, quantity, price)

Open a new trade.

create_and_execute(pair, quantity, price)

prepare_buy(pair, quantity, price)

sell(pair, quantity, price)

sell_with_price_data(pair, quantity, ...)

time_travel(timestamp)

__init__(state, lp_fees=2.5, price_impact=0.99)[source]#
Parameters

state (State) –

create(pair, quantity, price)[source]#

Open a new trade.

Parameters
Return type

Tuple[TradingPosition, TradeExecution]