人人爽天天爽夜夜爽qc-人人爽天天爽夜夜爽曰-人人天天爱天天做天天摸-人人天天夜夜-色网站在线-色网站在线看

您現在的位置:程序化交易>> 期貨公式>> 金字塔等>> 金字塔知識>>正文內容

context對象在Cython下的傳遞 [金字塔]

:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">def handle_bar(context)是可以正常運行的:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">但現在需要用:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">settimer來自己控制,實際運行的程序是:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">def run(context),如果不編譯也是正常的,但是編譯以后: none; text-indent: 0px; letter-spacing: normal; font-family: Verdana; font-size: 14px; font-variant: normal; word-spacing: 0px; display: inline=" inline"="" !important;="" white-space:="" normal;="" orphans:="" 2;="" float:="" none;="" -webkit-text-stroke-width:="" 0px;="" background-color:="" rgb(255,="" 255,="" 255);"="">: none; text-indent: 0px; letter-spacing: normal; font-family: Verdana; font-size: 14px; font-variant: normal; word-spacing: 0px; display: inline=" inline"="" !important;="" white-space:="" normal;="" orphans:="" 2;="" float:="" none;="" -webkit-text-stroke-width:="" 0px;="" background-color:="" rgb(255,="" 255,="" 255);"="">: none; text-indent: 0px; letter-spacing: normal; font-family: Verdana; font-size: 14px; font-variant: normal; word-spacing: 0px; display: inline=" inline"="" !important;="" white-space:="" normal;="" orphans:="" 2;="" float:="" none;="" -webkit-text-stroke-width:="" 0px;="" background-color:="" rgb(255,="" 255,="" 255);"="">:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">settimer(run,1000)這句代碼無法帶入:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">context參數,報一個錯誤,說是要求是str的類型,但實際上是: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">context類型: none; text-indent: 0px; letter-spacing: normal; font-family: Verdana; font-size: 14px; font-variant: normal; word-spacing: 0px; display: inline=" inline"="" !important;="" white-space:="" normal;="" orphans:="" 2;="" float:="" none;="" -webkit-text-stroke-width:="" 0px;="" background-color:="" rgb(255,="" 255,="" 255);"="">: none; text-indent: 0px; letter-spacing: normal; font-family: Verdana; font-size: 14px; font-variant: normal; word-spacing: 0px; display: inline=" inline"="" !important;="" white-space:="" normal;="" orphans:="" 2;="" float:="" none;="" -webkit-text-stroke-width:="" 0px;="" background-color:="" rgb(255,="" 255,="" 255);"="">: none; text-indent: 0px; letter-spacing: normal; font-family: Verdana; font-size: 14px; font-variant: normal; word-spacing: 0px; display: inline=" inline"="" !important;="" white-space:="" normal;="" orphans:="" 2;="" float:="" none;="" -webkit-text-stroke-width:="" 0px;="" background-color:="" rgb(255,="" 255,="" 255);"="">有什么辦法解決這個問題:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">問題在于:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">settimer和:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">killtimer要求函數必須有:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">context參數,但是帶參數編譯過后的pyd又報類型不對:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"=""> :="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"=""> :="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"=""> :="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"=""> :="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">Argument 'context' has incorrect type (expected str, got context):="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"=""> :="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"=""> :="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"=""> :="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"=""> :="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">我在想是否能夠指定一下:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">context這個參數的類型?: none; text-indent: 0px; letter-spacing: normal; font-family: Verdana; font-size: 14px; font-variant: normal; word-spacing: 0px; display: inline=" inline"="" !important;="" white-space:="" normal;="" orphans:="" 2;="" float:="" none;="" -webkit-text-stroke-width:="" 0px;="" background-color:="" rgb(255,="" 255,="" 255);"=""> : none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">settimer 設定計時器—定時觸發:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"=""> : none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">函數原型:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"=""> : none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: inherit; word-spacing: 0px;"> : none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">設定計時器—定時觸發,僅"paper_trading"模式有效:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"=""> 注意:function函數一定要包含(并且只能包含)context
?


?

  • 網友回復:
    還有一個辦法就是自己寫一個死循環,這樣可以運行,但是退出的時候怎么結束這個進程?def init(context):
    ??? while True:
    ??????? run(context)
    ??????? time.sleep(1)

    ?

  • 網友回復:

    import time
    definit(context):
    ??? # 設置計時器
    ??? settimer(msg,10)

    defmsg(context):
    ??? #輸出現在時間
    ??? a = time.asctime( time.localtime(time.time()) )
    ??? print(a)
    #退出程序后殺死計時器
    defexit(context):
    ??? killtimer(msg)

    ?

    ?

    ?

    ?

    不是很明白范例里這個不是可以的嗎?退出時候殺死計時器

  •  

    有思路,想編寫各種指標公式,交易模型,選股公式,還原公式的朋友

    可聯系技術人員 QQ: 262069696  點擊在線交流或微信號:cxh99cxh99  進行 有償收費 編寫!

    怎么收費,代編流程等詳情請點擊閱讀!

    (注:由于人數限制,QQ或微信請選擇方便的一個聯系我們就行,加好友時請簡單備注下您的需求,否則無法通過。謝謝您!)


    【字體: 】【打印文章】【查看評論

    相關文章

      沒有相關內容
    主站蜘蛛池模板: 黄色在线网站视频 | 天天爽天天爱 | 成人午夜大片 | 免费h片网站 | 99久9在线 | 免费 | 日韩综合区 | 日韩高清影视 | yy4138理论片在线大全 | 伊人久久大香线蕉综合网站 | 激情5月 | 久热久操 | 亚洲美女综合网 | 国产视频一区二 | 天天拍拍天天爽免费视频 | 久久精品成人欧美大片免费 | 成人免费播放器 | 人与鲁牲交持级毛片 | 毛片在线播放视频 | 交在线观看网站视频 | 成人开心激情 | 国产午夜精品一二区理论影院 | 日韩福利片午夜在线观看资源 | 福利一区二区在线观看 | 韩国在线观看日韩 | 嗯灬啊灬用力再用力ca视频 | 日韩激情视频在线观看 | 91se在线看片国产免费观看 | 国产成人精品福利网站在线观看 | 五月激情在线 | 国产精品日产三级在线观看 | 波多野结衣一区二区三区88 | 免费精品国产日韩热久久 | 欧美xxx视频在线观看 | h全彩黄漫网站 | 三国同人h文啪啪高黄 | 国产黄色网 | 亚洲va欧美va人人爽夜夜嗨 | 国产 欧美 日产中文 | 黄色激情视频网站 | 1717she永久精品免费 | 日韩国产欧美精品综合二区 |