Files
lowkey_backtest/check_symbols.py
Simon Moisy 1e4cb87da3 Add check_symbols.py for ETH perpetuals filtering and enhance backtester with size handling
- Introduced `check_symbols.py` to load and filter ETH perpetual markets from the OKX exchange using CCXT.
- Updated the backtester to normalize signals to a 5-tuple format, incorporating size management for trades.
- Enhanced portfolio functions to support variable size and leverage adjustments based on initial capital.
- Added a new method in `CryptoQuantClient` for chunked historical data fetching to avoid API limits.
- Improved market symbol normalization in `market.py` to handle different formats.
- Updated regime strategy parameters based on recent research findings for optimal performance.
2026-01-14 09:46:51 +08:00

29 lines
809 B
Python

import ccxt
import sys
def main():
try:
exchange = ccxt.okx()
print("Loading markets...")
markets = exchange.load_markets()
# Filter for ETH perpetuals
eth_perps = [
symbol for symbol, market in markets.items()
if 'ETH' in symbol and 'USDT' in symbol and market.get('swap') and market.get('linear')
]
print(f"\nFound {len(eth_perps)} ETH Linear Perps:")
for symbol in eth_perps:
market = markets[symbol]
print(f" CCXT Symbol: {symbol}")
print(f" Exchange ID: {market['id']}")
print(f" Type: {market['type']}")
print("-" * 30)
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
main()