21 lines
626 B
Python
21 lines
626 B
Python
# coding:utf-8
|
|
from core import strategy_db
|
|
from core.main_controller import SFGridController
|
|
from core.logger import LogLevel, PrintLog
|
|
import sfgrid_constants as sdConstants
|
|
|
|
def startTrade(index: int):
|
|
ctrl.start_stock_trade(index)
|
|
|
|
def pauseTrade(index: int):
|
|
ctrl.pause_stock_trade(index)
|
|
|
|
if __name__ == '__main__':
|
|
sdConstants.initConfig()
|
|
strategy_db.db.connect()
|
|
strategy_db.db.create_tables([strategy_db.TradeTarget])
|
|
PrintLog(LogLevel.INFO, '- [成功]数据库模块初始化')
|
|
ctrl: SFGridController = SFGridController(sdConstants.account_no, sdConstants.miniQMTPath)
|
|
|
|
ctrl.hold()
|