crypto_quant/config.py

37 lines
1.3 KiB
Python
Raw Normal View History

2025-07-21 05:05:59 +00:00
# OKX API 配置
# 请将以下信息替换为你的实际API密钥
# API密钥配置
API_KEY = "your_api_key_here"
SECRET_KEY = "your_secret_key_here"
PASSPHRASE = "your_passphrase_here"
# 交易配置
TRADING_CONFIG = {
"symbol": "BTC-USDT", # 交易对
"position_size": 0.001, # 每次交易数量BTC
"sandbox": True, # 是否使用沙盒环境(建议先用沙盒测试)
# 策略参数
"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.02, # 网格范围2%
# 风险控制
"max_position": 0.01, # 最大持仓量BTC
"stop_loss_pct": 0.05, # 止损百分比5%
"take_profit_pct": 0.10, # 止盈百分比10%
}
# 时间间隔配置
TIME_CONFIG = {
"strategy_interval": 60, # 策略执行间隔(秒)
"kline_interval": "5m", # K线数据间隔
"kline_limit": 100, # K线数据条数
}