修复一些导入相关错误
This commit is contained in:
parent
eedcd4e4da
commit
9976ea9c73
@ -4,7 +4,10 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from peewee import DateTimeField, DecimalField, BigIntegerField
|
from peewee import DateTimeField, DecimalField, BigIntegerField
|
||||||
from database_config import BaseModel, get_database
|
try:
|
||||||
|
from database_config import BaseModel, get_database
|
||||||
|
except ImportError:
|
||||||
|
from .database_config import BaseModel, get_database
|
||||||
import logging
|
import logging
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -71,7 +74,7 @@ def create_stock_kline_model(stock_code: str, period: str = "1d"):
|
|||||||
'stock_code': stock_code, # 保存原始股票代码
|
'stock_code': stock_code, # 保存原始股票代码
|
||||||
})
|
})
|
||||||
|
|
||||||
logger.info(f"📊 创建股票K线模型: {class_name} -> {table_name}")
|
logger.debug(f"📊 创建股票K线模型: {class_name} -> {table_name}")
|
||||||
return model_class
|
return model_class
|
||||||
|
|
||||||
def create_tables_for_stocks(stock_codes: list, period: str = "1d"):
|
def create_tables_for_stocks(stock_codes: list, period: str = "1d"):
|
||||||
|
|||||||
@ -10,8 +10,8 @@ import os
|
|||||||
# 添加项目根目录到Python路径
|
# 添加项目根目录到Python路径
|
||||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
from src.strategy import GridStrategy
|
from strategy import GridStrategy
|
||||||
from src.network_model.simple_socket_server import SimpleQTradeSocketServerManager
|
from network_model.simple_socket_server import SimpleQTradeSocketServerManager
|
||||||
|
|
||||||
# 全局策略实例
|
# 全局策略实例
|
||||||
strategy = GridStrategy(
|
strategy = GridStrategy(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user