Added tests to freqtradebot

This commit is contained in:
Sam Germain 2021-09-14 15:38:26 -06:00
parent 49acfc887f
commit 5f6384a961
4 changed files with 445 additions and 205 deletions

View File

@ -726,6 +726,7 @@ class Exchange:
if not self.exchange_has('fetchL2OrderBook'):
return True
ob = self.fetch_l2_order_book(pair, 1)
breakpoint()
if side == 'buy':
price = ob['asks'][0][0]
logger.debug(f"{pair} checking dry buy-order: price={price}, limit={limit}")

View File

@ -1467,7 +1467,7 @@ class FreqtradeBot(LoggingMixin):
self.wallets.update()
if fee_abs != 0 and self.wallets.get_free(trade_base_currency) >= amount:
# Eat into dust if we own more than base currency
# TODO-lev: won't be in (quote) currency for shorts
# TODO-lev: won't be in base currency for shorts
logger.info(f"Fee amount for {trade} was in base currency - "
f"Eating Fee {fee_abs} into dust.")
elif fee_abs != 0:

View File

@ -2115,3 +2115,30 @@ def market_sell_order_usdt():
'remaining': 0.0,
'status': 'closed'
}
@pytest.fixture(scope='function')
def open_order(limit_buy_order_open, limit_sell_order_open):
# limit_sell_order_open if is_short else limit_buy_order_open
return {
True: limit_sell_order_open,
False: limit_buy_order_open
}
@pytest.fixture(scope='function')
def limit_order(limit_sell_order, limit_buy_order):
# limit_sell_order if is_short else limit_buy_order
return {
True: limit_sell_order,
False: limit_buy_order
}
@pytest.fixture(scope='function')
def old_order(limit_sell_order_old, limit_buy_order_old):
# limit_sell_order_old if is_short else limit_buy_order_old
return {
True: limit_sell_order_old,
False: limit_buy_order_old
}

File diff suppressed because it is too large Load Diff