您現(xiàn)在的位置:程序化交易>> 期貨公式>> 金字塔等>> 金字塔知識>>正文內(nèi)容

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

:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">def handle_bar(context)是可以正常運(yùn)行的:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">但現(xiàn)在需要用:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">settimer來自己控制,實(shí)際運(yùn)行的程序是:="" -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參數(shù),報(bào)一個(gè)錯(cuò)誤,說是要求是str的類型,但實(shí)際上是: 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);"="">有什么辦法解決這個(gè)問題:="" -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要求函數(shù)必須有:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"="">context參數(shù),但是帶參數(shù)編譯過后的pyd又報(bào)類型不對:="" -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這個(gè)參數(shù)的類型?: 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 設(shè)定計(jì)時(shí)器—定時(shí)觸發(fā):="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"=""> : none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">函數(shù)原型:="" -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;">設(shè)定計(jì)時(shí)器—定時(shí)觸發(fā),僅"paper_trading"模式有效:="" -webkit-text-stroke-width:="" white-space:="" word-spacing:="" 0px;"=""> 注意:function函數(shù)一定要包含(并且只能包含)context
?


?

  • 網(wǎng)友回復(fù):
    還有一個(gè)辦法就是自己寫一個(gè)死循環(huán),這樣可以運(yùn)行,但是退出的時(shí)候怎么結(jié)束這個(gè)進(jìn)程?def init(context):
    ??? while True:
    ??????? run(context)
    ??????? time.sleep(1)

    ?

  • 網(wǎng)友回復(fù):

    import time
    definit(context):
    ??? # 設(shè)置計(jì)時(shí)器
    ??? settimer(msg,10)

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

    ?

    ?

    ?

    ?

    不是很明白范例里這個(gè)不是可以的嗎?退出時(shí)候殺死計(jì)時(shí)器

  •  

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

    可聯(lián)系技術(shù)人員 QQ: 262069696  點(diǎn)擊在線交流或微信號:cxh99cxh99  進(jìn)行 有償收費(fèi) 編寫!

    怎么收費(fèi),代編流程等詳情請點(diǎn)擊閱讀!

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


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

    相關(guān)文章

      沒有相關(guān)內(nèi)容
    主站蜘蛛池模板: 国产免费拔擦拔擦8x高清在线人| 情欲小说app下载| 免费国产精品视频| 黄页网址大全免费观看12网站 | 中文综合在线观| 欧美激情一区二区三区在线 | 欧美日韩在线视频不卡一区二区三区| 国产av无码久久精品| **真实毛片免费观看| 女性自慰aⅴ片高清免费| 久久人人爽人人爽人人爽| 欧美成人精品第一区首页| 别揉我的胸~啊~嗯~| 黑人巨大videos极度另类| 国产麻豆剧果冻传媒一区| 中国一级特黄毛片| 日韩视频第一页| 亚洲精品国产福利在线观看| 美女扒开胸罩让男生吃乳| 国产无遮挡又黄又爽在线视频 | 国产亚洲色婷婷久久99精品| 1卡二卡三卡四卡在线播放| 奷小罗莉在线观看国产| 久久se精品一区二区影院| 欧洲vodafonewifi14| 亚洲精品中文字幕无码av| 精品综合一区二区三区| 国产午夜视频在线观看第四页| 337p日本大胆欧美人术艺术精品| 娇妻借朋友高h繁交h| 久久99国产精品久久99果冻传媒 | 国产在线精品一区二区在线看| 80yy私人午夜a级国产| 女博士梦莹凌晨欢爱| 中文字幕日韩在线观看| 日韩亚洲欧美综合一区二区三区| 亚洲国产美女视频| 火车上荫蒂添的好舒服视频| 北条麻妃在线观看视频| 草草影院国产第一页| 国产妇女馒头高清泬20P多毛|