def notifyTrade(security): currentTimeString = util.getYMDHMS() duo = str(int(dao.readDuoPosition(security=security))) kon = str(int(dao.readKongPosition(security=security))) max = str(int(dao.readMaxPosition(security=security))) a = '<p>duo: <strong>' + duo + '</strong></p><p>kon: <strong>' + kon + '</strong></p><p>max: <strong>' + max + '</strong></p>' sendEmail(subject='[' + str(currentTimeString) + '] 触发交易动作_' + security, content='' + a)
def __init__(self, security, ctaEngine): self.security = security self.ctaEngine = ctaEngine self.lockActionToken = False # 瞬间动作标记 self.unlockActionToken = False # 瞬间动作标记 self.maxPosition = dao.readMaxPosition(security=security) print "RickControl初始化:已从DB读取maxPosition:" + str(self.maxPosition) self.realOpenKonPrice = dao.readRealOpenKonPrice( security=self.security) print "RickControl初始化:已从DB读取realOpenKonPrice:" + str( self.realOpenKonPrice) self.realOpenDuoPrice = dao.readRealOpenDuoPrice( security=self.security) print "RickControl初始化:已从DB读取realOpenDuoPrice:" + str( self.realOpenDuoPrice) self.locking = dao.readLocking(security=self.security) print "RickControl初始化:已从DB读取locking:" + str(self.locking) print('RickControl初始化:完成')