This commit is contained in:
jack
2025-11-26 18:06:29 +08:00
parent 0b84cb8222
commit d4e55e9aca
32 changed files with 1303 additions and 1886 deletions
-8
View File
@@ -1,8 +0,0 @@
# -*- coding: utf-8 -*-
"""
配置模块 - 包含配置常量
"""
from .settings import DEFAULT_SIMULATION_SETTINGS
__all__ = ['DEFAULT_SIMULATION_SETTINGS']
+51 -17
View File
@@ -1,19 +1,53 @@
# -*- coding: utf-8 -*-
"""
模拟配置常量
"""
"""配置文件"""
DEFAULT_SIMULATION_SETTINGS = {
'instrumentType': 'EQUITY',
'region': 'USA',
'universe': 'TOP3000',
'delay': 1,
'decay': 0,
'neutralization': 'INDUSTRY',
'truncation': 0.08,
'pasteurization': 'ON',
'unitHandling': 'VERIFY',
'nanHandling': 'OFF',
'language': 'FASTEXPR',
'visualization': False,
}
import os
from typing import Dict, Any
class Settings:
"""应用配置"""
# 数据库配置
DATABASE_CONFIG = {
"host": "localhost",
"port": "5432",
"user": "jack",
"password": "aaaAAA111",
"database": "alpha"
}
# API配置
BRAIN_API_URL = "https://api.worldquantbrain.com"
# 模拟配置
SIMULATION_SETTINGS = {
'instrumentType': 'EQUITY',
'region': 'USA',
'universe': 'TOP3000',
'delay': 1,
'decay': 0,
'neutralization': 'INDUSTRY',
'truncation': 0.08,
'pasteurization': 'ON',
'unitHandling': 'VERIFY',
'nanHandling': 'OFF',
'language': 'FASTEXPR',
'visualization': False,
}
# 批处理配置
BATCH_SIZE = 3
CHECK_INTERVAL = 300 # 5分钟
TOKEN_REFRESH_THRESHOLD = 1800 # 30分钟
# 通知配置
GOTIFY_URL = "https://gotify.erhe.top/message?token=AvKJCJwQKU6yLP8"
@property
def credentials_file(self) -> str:
"""获取凭证文件路径"""
return os.path.join(os.path.dirname(os.path.dirname(__file__)), 'account.txt')
settings = Settings()