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

平倉信號出來后隔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);


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 陈冰的视频ivk| 久久五月天综合网| 欧式午夜理伦三级在线观看| 年轻帅主玩奴30min视频| 亚洲av无码专区亚洲av桃| 精品久久久久亚洲| 国产国产精品人在线视| 97久视频精品视频在线老司机| 手机在线观看av片| 亚洲av无码专区在线| 澳门永久av免费网站| 国产99视频在线| 免费观看激色视频网站(性色)| 天天干天天干天天| 久久久久亚洲av成人网人人软件| 欧美成人免费一区在线播放| 免费高清a级毛片在线播放| 香港三级午夜理伦三级99| 国产精品综合色区在线观看| 一本一本久久a久久综合精品蜜桃| 日韩在线视频第一页| 亚洲成a人片毛片在线| 粗大猛烈进出高潮视频大全| 国产免费av一区二区三区| 2021国产精品久久久久| 好男人社区www影院在线观看| 久久亚洲精品中文字幕无码| 欧美亚洲国产精品久久第一页| 交换美妇94系列部分| 经典三级四虎在线观看| 国产在线爱做人成小视频| 影音先锋男人看片资源| 天堂√最新版中文在线天堂| 中国大陆高清aⅴ毛片| 日本视频免费在线| 亚洲人成色在线观看| 67194熟妇人妻欧美日韩| 性中国videossex古装片| 久久国产色av免费看| 欧美亚洲视频一区| 亚洲男女性高爱潮网站|