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

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

百度搜索

[求助]求老師指正錯誤之處,策略區沒人回答無人值班嗎不?急。。 [金字塔]

  • 咨詢內容: 圖表交易
    參照論壇示例,寫了一套止損、止盈策略, 老師們請批改以下策略語法是否正確。附合多條件開多,但開倉策略錯誤,導致止盈后符合多條件又開多倉,再止再開,重復輪回,請求正確寫法。
    variable:maxprofit=0,qc=0;exittime:=time>=145000;
    ND:```````````; XD:```````````;
    平空開多條件:=ND>XD;平多開空條件:=ND<XD;
    錯誤策略語句,求助修正。[buycond:=count(平空開多條件,0);if holding=0 and buycond then begin  buy(1,1,MARKET); maxprofit:=0; end      ]
    //限時清倉if exittime then begin   sell(1,0,MARKET); sellshort(1,0,MARKET); qc:=0;end
    //多倉止損 if holding>0 and low<enterprice-3 then sell(1,0,market);
    //預設性條件止盈win:=0;ht:=0;if holding > 0 and enterbars > 0 thenbegin win:=(high-enterprice); //記錄多倉浮動盈利 if win > maxprofit then  maxprofit:=win;   //最大獲利  ht:=maxprofit-win; //最大盈利后的回調幅度end
    if maxprofit<3 and holding>0 then  平多:SELL(平多開空條件,0,market);// 盈利小于3點,采用指標平倉。
    if maxprofit>=3 and maxprofit<10 and holding>0 then  止贏1:SELL(ht<1+0.1*(maxprofit-2),0,market); // 3至10點盈利保護1點幾利潤盈平
    if maxprofit>=10 and maxprofit<20 and holding>0 then  止贏2:SELL(ht<0.5*maxprofit,0,market);  // 10至20點盈利保50%浮盈利潤
    if maxprofit>=20 and maxprofit<40 and holding>0 then  止贏3:SELL(ht<maxprofit-10,0,market); // 20點至40點盈利,浮盈回撤10點
    if maxprofit>40 and holding>0 then  止贏4:SELL(ht<maxprofit-5 or 平多開空條件,0,market);   // 大于40點盈利,浮盈回撤5點或指標平倉,哪個先達到執行哪個
    關于SELL()里面的maxprofit,這里三種用法{1+0.1*(maxprofit-2)}{0.5*maxprofit}{maxprofit-10}是否正確?為什么要在前面加上“ht<”呢?
    另外止盈止損后滿足某條件之后重新恢復持倉策略怎么寫?例:即持多倉時,如果止盈(止損)后,趨勢沒有向空條件發展,在仍然保持多條件情況下,價格重新回調到大于止盈價(止損價)時,重新恢復持多倉。不可行,即放棄。
    請老師幫修改一個上述完整策略。
    開平空倉盈損,是否是將上述策略中的low,high和開平空改一下即可?還有什么要改變的嗎?

     

  • 金字塔客服: 我去看看

     

  • 用戶回復: jin版,策略版有回復,還是不行。

     

  • 網友回復: buycond:=count(平空開多條件,0);

     

     

    這個啥意思?為了實現什么目的?


    正是因為錯誤啊,沒法實現策略。所以請求正確的寫法。再發一遍吧,漏了。


    variable:maxprofit=0,qc=0,win:=0,ht:=0;

    exittime:=time>=145000;


    ND:stkindi('','A',0,22,45);

    XD:stkindi('',''B,0,11,0);


    平空開多條件:=ND>XD;

    平多開空條件:=ND<XD;


    if holding=0 and 平空開多條件 then

     begin 

     buy(1,1,MARKET);

     maxprofit:=0;

     end


    //限時清倉

    if exittime then begin  

     sell(1,0,MARKET);

     sellshort(1,0,MARKET);

     qc:=0;

    end


    //多倉止損 

    if holding>0 and low<enterprice-3 then sell(1,1,market);

    win:=0;

    ht:=0;

    if holding > 0 and enterbars > 0 then

    begin

     win:=(high-enterprice); //記錄多倉浮動盈利

     if win > maxprofit then

      maxprofit:=win;   //最大獲利 

     ht:=maxprofit-win; //最大盈利后的回調幅度

    end


    if maxprofit<3 and holding>0 then  平多:SELL(平多開空條件,0,market);// 盈利小于3點,采用指標平倉。
    if maxprofit>=3 and maxprofit<10 and holding>0 then  止贏1:SELL(ht<1+0.1*(maxprofit-2),0,market); // 3至10點盈利保護1點幾利潤盈平
    if maxprofit>=10 and maxprofit<20 and holding>0 then  止贏2:SELL(ht<0.5*maxprofit,0,market);  // 10至20點盈利保50%浮盈利潤
    if maxprofit>=20 and maxprofit<40 and holding>0 then  止贏3:SELL(ht<maxprofit-10,0,market); // 20點至40點盈利,浮盈回撤10點
    if maxprofit>40 and holding>0 then  止贏4:SELL(ht<maxprofit-5 or 平多開空條件,0,market);   // 大于40點盈利,浮盈回撤5點或指標平倉,哪個先達到執行哪個
    關于SELL()里面的maxprofit,這里三種用法{1+0.1*(maxprofit-2)}{0.5*maxprofit}{maxprofit-10}是否正確?為什么要在前面加上“ht<”呢?
    另外止盈止損后滿足某條件之后重新恢復持倉策略怎么寫?例:即持多倉時,如果止盈(止損)后,趨勢沒有向空條件發展,在仍然保持多條件情況下,價格重新回調到大于止盈價(止損價)時,重新恢復持多倉。不可行,即放棄。
    請老師幫修改一個上述完整策略。
    開平空倉盈損,是否是將上述策略中的low,high和開平空改一下即可?還有什么要改變的嗎?


     

      


    [此貼子已經被作者于2014/3/13 17:28:57編輯過]

     

  • 網友回復: 不是你的思路是什么?這個開倉條件為什么要這么寫?

 

有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友

可聯系技術人員 QQ: 1145508240  點擊這里給我發消息進行 有償 編寫!不貴!點擊查看價格!


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 韩国伦理片免费观看 | 狠狠操免费视频 | 免费看黄色三级毛片 | 免费的黄色影片 | 男人趴在女人身上曰皮免费 | 狠狠干夜夜爱 | 亚洲图片欧美色图 | 国产精品成人观看视频国产奇米 | 亚洲精品无码专区在线播放 | 欧美大胆性生话 | 中国一级淫片bbb | 久久99精品久久久久久欧洲站 | 欧美午夜一艳片欧美精品 | 你懂得在线观看 | www.妞干网.com| 男女爱视频免费高清在线观看 | 视频在线你懂的 | www.瑟瑟| 中文字幕天天躁日日躁狠狠躁免费 | 国产一级片免费视频 | 色在线视频观看 | 国外成人在线视频网站 | 亚洲性视频网站 | 亚洲无线乱码高清在线观看一区 | 涩涩色视频在线播放 | 日本乱人伦免费播放 | 看真人视频a级毛片 | 精品在线视频一区 | 性性影院在线观看 | 好吊色综合网天天高清 | 日韩欧美高清视频 | 久久精品九九 | 欧美伊人久久综合网 | 国产精品一国产精品免费 | 在线亚洲欧洲国产综合444 | 黄色性情视频 | 欧美伊人网 | 午夜小福利| 色香蕉在线观看网站 | 7m福利视频导航精品 | 在线亚洲观看 |
网站统计