Merge branch 'feat/short' into funding-fee-backtesting

This commit is contained in:
Sam Germain
2021-10-20 08:21:12 -06:00
48 changed files with 1765 additions and 907 deletions

View File

@@ -3248,6 +3248,33 @@ def test_validate_trading_mode_and_collateral(
exchange.validate_trading_mode_and_collateral(trading_mode, collateral)
@pytest.mark.parametrize("exchange_name,trading_mode,ccxt_config", [
("binance", "spot", {}),
("binance", "margin", {"options": {"defaultType": "margin"}}),
("binance", "futures", {"options": {"defaultType": "future"}}),
("kraken", "spot", {}),
("kraken", "margin", {}),
("kraken", "futures", {}),
("ftx", "spot", {}),
("ftx", "margin", {}),
("ftx", "futures", {}),
("bittrex", "spot", {}),
("bittrex", "margin", {}),
("bittrex", "futures", {}),
])
def test__ccxt_config(
default_conf,
mocker,
exchange_name,
trading_mode,
ccxt_config
):
default_conf['trading_mode'] = trading_mode
default_conf['collateral'] = 'isolated'
exchange = get_patched_exchange(mocker, default_conf, id=exchange_name)
assert exchange._ccxt_config == ccxt_config
def test_get_mark_price():
return

View File

@@ -164,6 +164,8 @@ def test_get_balances_prod(default_conf, mocker):
ccxt_exceptionhandlers(mocker, default_conf, api_mock, "kraken",
"get_balances", "fetch_balance")
# TODO-lev: All these stoploss tests with shorts
@pytest.mark.parametrize('ordertype', ['market', 'limit'])
@pytest.mark.parametrize('side,adjustedprice', [