test: add "ohlcv_limit" live test

This commit is contained in:
Matthias
2025-01-31 18:27:47 +01:00
parent d530527f11
commit 35f7c97c76
2 changed files with 28 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ EXCHANGES = {
"use_ci_proxy": True,
"hasQuoteVolume": True,
"timeframe": "1h",
"candle_count": 1000,
"futures": True,
"futures_pair": "BTC/USDT:USDT",
"hasQuoteVolumeFutures": True,
@@ -96,6 +97,7 @@ EXCHANGES = {
"stake_currency": "USDT",
"hasQuoteVolume": True,
"timeframe": "1h",
"candle_count": 1000,
"futures": False,
"skip_ws_tests": True,
"sample_order": [
@@ -136,6 +138,7 @@ EXCHANGES = {
"stake_currency": "USD",
"hasQuoteVolume": True,
"timeframe": "1h",
"candle_count": 720,
"leverage_tiers_public": False,
"leverage_in_spot_market": True,
"trades_lookback_hours": 12,
@@ -162,6 +165,7 @@ EXCHANGES = {
"stake_currency": "USDT",
"hasQuoteVolume": True,
"timeframe": "1h",
"candle_count": 1500,
"leverage_tiers_public": False,
"leverage_in_spot_market": True,
"sample_order": [
@@ -229,6 +233,7 @@ EXCHANGES = {
"stake_currency": "USDT",
"hasQuoteVolume": True,
"timeframe": "1h",
"candle_count": 1000,
"futures": True,
"futures_pair": "BTC/USDT:USDT",
"hasQuoteVolumeFutures": True,
@@ -345,6 +350,7 @@ EXCHANGES = {
"stake_currency": "USDT",
"hasQuoteVolume": True,
"timeframe": "1h",
"candle_count": 300,
"futures": True,
"futures_pair": "BTC/USDT:USDT",
"hasQuoteVolumeFutures": False,
@@ -358,6 +364,7 @@ EXCHANGES = {
"hasQuoteVolume": True,
"use_ci_proxy": True,
"timeframe": "1h",
"candle_count": 1000,
"futures_pair": "BTC/USDT:USDT",
"futures": True,
"orderbook_max_entries": 50,
@@ -398,6 +405,7 @@ EXCHANGES = {
"stake_currency": "USDT",
"hasQuoteVolume": True,
"timeframe": "1h",
"candle_count": 200,
"orderbook_max_entries": 50,
},
"htx": {
@@ -405,13 +413,14 @@ EXCHANGES = {
"stake_currency": "BTC",
"hasQuoteVolume": True,
"timeframe": "1h",
"futures": False,
"candle_count": 1000,
},
"bitvavo": {
"pair": "BTC/EUR",
"stake_currency": "EUR",
"hasQuoteVolume": True,
"timeframe": "1h",
"candle_count": 1440,
"leverage_tiers_public": False,
"leverage_in_spot_market": False,
},
@@ -420,6 +429,7 @@ EXCHANGES = {
"stake_currency": "USDT",
"hasQuoteVolume": True,
"timeframe": "1h",
"candle_count": 1000,
"futures": False,
"sample_order": [
{
@@ -482,6 +492,7 @@ EXCHANGES = {
"hasQuoteVolume": False,
"timeframe": "1h",
"futures": True,
"candle_count": 5000,
"orderbook_max_entries": 20,
"futures_pair": "BTC/USDC:USDC",
"hasQuoteVolumeFutures": True,

View File

@@ -48,6 +48,22 @@ class TestCCXTExchange:
}
)
def test_ohlcv_limit(self, exchange: EXCHANGE_FIXTURE_TYPE):
exch, exchangename = exchange
expected_count = EXCHANGES[exchangename].get("candle_count")
if not expected_count:
pytest.skip("No expected candle count for exchange")
assert exch.ohlcv_candle_limit("1m", CandleType.SPOT) == expected_count
def test_ohlcv_limit_futures(self, exchange_futures: EXCHANGE_FIXTURE_TYPE):
exch, exchangename = exchange_futures
expected_count = EXCHANGES[exchangename].get("candle_count")
if not expected_count:
pytest.skip("No expected candle count for exchange")
assert exch.ohlcv_candle_limit("1m", CandleType.SPOT) == expected_count
def test_load_markets_futures(self, exchange_futures: EXCHANGE_FIXTURE_TYPE):
exchange, exchangename = exchange_futures
pair = EXCHANGES[exchangename]["pair"]