You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
FactorSimulator/config/settings.py

53 lines
1.2 KiB

# -*- coding: utf-8 -*-
"""配置文件"""
import os
class Settings:
"""应用配置"""
# 数据库配置
DATABASE_CONFIG = {
# "host": "192.168.31.201",
"host": "127.0.0.1",
"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()