人人爽天天爽夜夜爽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或微信請選擇方便的一個聯系我們就行,加好友時請簡單備注下您的需求,否則無法通過。謝謝您!)


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

    相關文章

      沒有相關內容
    主站蜘蛛池模板: 日本三级免费看 | 中文国产在线观看 | 亚洲全网成人资源在线观看 | 在线中文字幕视频 | 最近中文免费字幕在线播放 | 日本三级免费观看 | 天堂网视频在线 | 激情网站网址 | 91大片淫黄大片.在线天堂 | 香蕉视频网页 | 一级毛片aaa片免费观看 | 久99久爱精品免费观看视频 | 中文字幕在线观看一区二区三区 | 在线播放a| 国产成在线观看免费视频成本人 | 狠狠燥 | 国产黄视频网站 | 久久国产精品免费视频 | 亚洲欧美日韩另类 | 又色又爽又黄的视频女女高清 | 日本视频www | 国产精品久久婷婷六月丁香 | 中国精品久久 | 97影院理伦在线观看 | 国产高清美女一级a毛片久久 | 国产精品久久久久网站 | 韩国19禁在线观看 | 激情五月婷婷开心 | 亚洲黄色一级大片 | 555夜色666夜色精品站 | 亚洲免费视频播放 | 荡娃艳妇系列小说 | www.五月天激情 | 再深点灬舒服灬太大了添a 在线99 | 欧美成人三级一区二区在线观看 | 久久综合狠狠综合狠狠 | 免费成人在线网站 | xxxx久久| 日韩精美视频 | 欧美亚洲综合网 | 日韩h片在线观看 |