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

平倉信號出來后隔2根K線再啟動開倉條件怎么寫? [金字塔]

  • 咨詢內容:

    buycondition:=c>ma(c,20);

    sellcondition:=c<ma(c,20);

    buycond:=cross(ma(c,5),ma(c,10));

    sellcond:=cross(ma(c,10),ma(c,5));

    if holding>0 and c<enterprice-20 then sell(1,1,limitr,c);

    if holding<0 and c>enterprice+20 then sellshort(1,1,limitr,c);

    if holding>0 and sellcondition then sell(1,1,limitr,c);

    if holding<0 and buycondition then sellshort(1,1,limitr,c);

    if holding>0 and sellcond then sell(1,1,limitr,c);

    if holding<0 and buycond then sellshort(1,1,limitr,c);

    if holding=0 and buycond then buy(1,1,limitr,c);

    if holding=0 and sellcond then buyshort(1,1,limitr,c);

     

    問題:

    多單平倉后(多種平倉策略)如果滿足做空條件,不馬上做空,而是等過2根K線之后,滿足做空條件則做空

    空單平倉后(多種平倉策略)如果滿足做多條件,不馬上做多,而是等過2跟K先之后,滿足做多條件則做多

    以上思路如何實現?

     

    [此貼子已經被作者于2012-1-16 0:37:33編輯過]

     

  • 金字塔客服:

    參考

    得到當前位置之前上N次信號指定類型距當前周期
    用法:
    TYPEBAR(N,TYPE)N表示上次信號,
    TYPE表示信號類型 0、無信號1、開多2、平多3、開空;4、平空
    例如:TYPEBAR(2,1)表示:倒數第2個開多信號歷時
    該函數僅在逐K線計算模式下有效, 并且只能用在BUY,SELL等新圖表交易系統中,不能與舊圖表交易系統ENTERLONG,EXITLONG等混用。
    所屬函數組:交易系統

    [此貼子已經被作者于2012-1-16 8:46:54編輯過]

     

  • 用戶回復:

    單獨在開多語句中加入 typebar(1,4)>2  或者在開空語句中加入typebar(1,2)>2 信號都能正常顯示。可是在開多和開空語句中同時加入條件后,信號都消失了,這是為什么?

     

  • 網友回復: 估計是您使用有誤,直接把代碼貼出來看看--附帶簡要文字說明

     

  • 網友回復:

    buycondition:=c>ma(c,20);

    sellcondition:=c<ma(c,20);

    buycond:=cross(ma(c,5),ma(c,10));

    sellcond:=cross(ma(c,10),ma(c,5));

    if holding>0 and c<enterprice-20 then sell(1,1,limitr,c);

    if holding<0 and c>enterprice+20 then sellshort(1,1,limitr,c);

    if holding>0 and sellcondition then sell(1,1,limitr,c);

    if holding<0 and buycondition then sellshort(1,1,limitr,c);

    if holding>0 and sellcond then sell(1,1,limitr,c);

    if holding<0 and buycond then sellshort(1,1,limitr,c);

    if holding=0 and buycond and typebar(1,4)>2 then buy(1,1,limitr,c);

    if holding=0 and sellcond and typebar(1,2)>2 then buyshort(1,1,limitr,c);


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 免费大学生国产在线观看p| 国产视频xxxx| 九一制片厂免费传媒果冻| 管家婆有哪些版本| 国产在线播放网址| 91蝌蚪在线视频| 成**人免费一级毛片| 九九热在线视频观看这里只有精品| 特级做a爰片毛片免费看| 国产v亚洲v天堂a无码| 日本3p视频在线看高清| 夜栋病勤1一12在线观看| 中日韩精品无码一区二区三区| 樱桃视频影院在线播放| 亚洲色成人网一二三区| 绿巨人app入口| 国产在线精品一区二区不卡麻豆| 91在线视频一区| 岛国在线免费观看| 久久久综合久久| 欧美三级在线观看视频| 亚洲色图狠狠干| 精品国精品自拍自在线| 国产人与禽zoz0性伦多活几年| 窝窝午夜看片七次郎青草视频 | 波多野结衣99| 大学生久久香蕉国产线看观看| 中文字幕在线观看亚洲| 日韩人妻精品一区二区三区视频| 亚洲国产成人久久一区二区三区| 牛牛在线精品观看免费正| 午夜精品福利视频| 西西大胆午夜人体视频| 国产成人精品视频福利app| 18禁裸男晨勃露j毛免费观看| 大bbwbbwbbwvideos| 一本大道香蕉在线高清视频| 抱着娇妻让粗黑人人玩3p| 久久天堂AV综合合色蜜桃网 | avtt在线播放| 孩交精品xxxx视频视频|