crypto_quant/config.py

132 lines
3.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# OKX API 配置
# 请将以下信息替换为你的实际API密钥
# API密钥配置
# API_KEY = "7286d434-225b-401f-b3af-fd595e15d23f"
# SECRET_KEY = "80B95C5757F9208F70282A85C9DDBC86"
# PASSPHRASE = "Bengbu_2001"
# SANDBOX = False
# 实盘读取API密钥配置
API_KEY = "a73f9096-8e76-49ff-947c-a4f4edf657ec"
SECRET_KEY = "F7AD69272FBF7C44E69CC110D2EDDB7A"
PASSPHRASE = "Bengbu!2001"
SANDBOX = False
# 模拟盘API密钥配置
# API_KEY = "f309e789-3497-4ed3-896f-d18bdc4d9817"
# SECRET_KEY = "9152809391B110E2E647FDE12A37E96D"
# PASSPHRASE = "Bengbu@2001"
# SANDBOX = True
# 交易配置
TRADING_CONFIG = {
"symbol": "BTC-USDT", # 交易对
"position_size": 0.001, # 每次交易数量BTC
# 策略参数
"sma_short_period": 5, # 短期移动平均线周期
"sma_long_period": 20, # 长期移动平均线周期
"rsi_period": 14, # RSI计算周期
"rsi_oversold": 30, # RSI超卖阈值
"rsi_overbought": 70, # RSI超买阈值
# 网格交易参数
"grid_levels": 5, # 网格数量
"grid_range": 0.005, # 网格范围0.5%
# 风险控制
"max_position": 0.01, # 最大持仓量BTC
"stop_loss_pct": 0.005, # 止损百分比0.5%
"take_profit_pct": 0.01, # 止盈百分比1%
}
# 时间间隔配置
TIME_CONFIG = {
"strategy_interval": 30, # 策略执行间隔(秒)
"kline_interval": "5m", # K线数据间隔
"kline_limit": 100, # K线数据条数
}
OKX_MONITOR_CONFIG = {
"volume_monitor": {
"symbols": [
"XCH-USDT",
"BTC-USDT",
"SOL-USDT",
"ETH-USDT",
"DOGE-USDT",
],
"bars": ["5m", "15m", "30m", "1H"],
"initial_date": "2025-05-15 00:00:00",
},
"price_monitor": {
"symbols": ["XCH-USDT"],
"bats": [
{"bar": "5m", "threshold": 0.025},
{"bar": "15m", "threshold": 0.5},
{"bar": "1H", "threshold": 0.1},
],
},
}
BINANCE_MONITOR_CONFIG = {
"volume_monitor": {
"symbols": [
"BTC-USDT",
"ETH-USDT",
"SOL-USDT",
"DOGE-USDT",
"XRP-USDT",
"BNB-USDT",
],
"bars": ["5m", "30m", "1H"],
"initial_date": "2017-08-16 00:00:00",
},
}
US_STOCK_MONITOR_CONFIG = {
"volume_monitor": {
"symbols": [
# "QQQ",
# "TQQQ",
# "MSFT",
# "AAPL",
# "GOOG",
# "NVDA",
# "META",
# "AMZN",
# "AVGO",
# "TSLA",
"PLTR",
"COIN",
"MSTR",
"HOOD",
"MARA",
"CVNA",
"XYZ",
],
"bars": ["5m", "15m", "30m", "1H"],
"initial_date": "2014-11-30 00:00:00",
}
}
WINDOW_SIZE = {"window_sizes": [50, 80, 100, 120]}
BAR_THRESHOLD = {
"5m": 1000 * 60 * 5,
"15m": 1000 * 60 * 15,
"30m": 1000 * 60 * 30,
"1H": 1000 * 60 * 60,
"4H": 1000 * 60 * 60 * 4,
"1D": 1000 * 60 * 60 * 24,
}
MYSQL_CONFIG = {
"host": "localhost",
"port": 3306,
"user": "xch",
"password": "xch_okx_2025",
"database": "okx",
}
WECHAT_CONFIG = {"key": "11e6f7ac-efa9-418a-904c-9325a9f5d324"}
ITICK_API_KEY = "dfd4bc0caed148d6bc03b960224754ffb5356349e389431f828702b3a27e8a2b"