结算信息确认成功函数

资金栏里均价和盈亏是每日结算的价格和当天盈亏损…

但如果使用的是低频CTA 策略, 不咋关注每天盈亏和结算价…只想登录时看看整体盈亏,和总体持仓均价…
同时又需要策略里调用平均持仓价格,可以按下面修改….

def onRspSettlementInfoConfirm(self, data: dict, error: dict, reqid: int, last: bool):
        """
        Callback of settlment info confimation.
        """
        self.gateway.write_log("结算信息确认成功")

        while True:
            self.reqid += 1
            n = self.reqQryInstrument({}, self.reqid)

            if not n:
                break
            else:
                sleep(1)

11 Comments

  1. The next time I read a blog, I hope that it does not disappoint me as much as this particular one. After all, Yes, it was my choice to read, nonetheless I truly thought you would probably have something helpful to talk about. All I hear is a bunch of whining about something that you could fix if you werent too busy looking for attention.

  2. An interesting discussion is definitely worth comment. I believe that you ought to write more on this topic, it may not be a taboo matter but usually people dont speak about such subjects. To the next! Cheers!!

  3. Can I simply just say what a relief to uncover someone that truly understands what theyre talking about online. You certainly realize how to bring a problem to light and make it important. A lot more people have to check this out and understand this side of your story. I was surprised you arent more popular given that you definitely have the gift.

  4. I was very pleased to uncover this great site. I need to to thank you for ones time for this fantastic read!! I definitely appreciated every bit of it and I have you bookmarked to look at new information on your blog.

Leave a Reply

Your email address will not be published.