大伊人青草狠狠久久-大伊香蕉精品视频在线-大伊香蕉精品一区视频在线-大伊香蕉在线精品不卡视频-大伊香蕉在线精品视频75-大伊香蕉在线精品视频人碰人

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

加入交易次數限制后結果異常 [金字塔]

  • 咨詢內容:

    早盤突破系統,1分鐘上測試2年,

    剛開始寫完交易次數是1700多;后來添加了一個每天只能交易一手的條件,結果交易次數只有3次了!

    添加了交易次數限制的代碼如下,是我寫的邏輯出錯了嗎?

     

    input:T(30,5,60,5),
    SS(1,1,10,1),
    U(1,1,10,1),
    D(1,1,10,1),
    CS(1,1,5,1);//交易次數限制
    VARIABLE:NUM=0;//統計開倉動作

     

    n:=barslast(date<>ref(date,1))+1;//開盤以來的K線數量
    hh:=hhv(high,n);//開盤以來的高價
    H30:=valuewhen(time>=opentime(1) and time<=opentime(1)+T*100,hh);//30分鐘內的高價
    ll:=llv(low,n);//開盤以來的低價
    L30:=valuewhen(time>=opentime(1) and time<=opentime(1)+T*100,ll);//30分鐘內的低價
    上軌:H30+U*MINDIFF,linethick2;
    下軌:L30-D*MINDIFF,linethick2;
    buycond:=cross(high,上軌);//做多條件
    buyshortcond:=cross(下軌,low);//做空條件
    buyprice:=max(open,上軌)+1*mindiff;//開多價格
    buyshortprice:=min(open,下軌)-1*mindiff;//開空價格

     

    stopbuy:max(valuewhen(n=1,open),ref(high,1)*(1-0.5/100)),linedot;//多頭止損價位

    stopshort:min(valuewhen(n=1,open),ref(low,1)*(1-0.5/100)),linedot;//空頭止損價位
    sellcond:=cross(stopbuy,low);//平多條件
    sellshortcond:=cross(high,stopshort);//平空條件
    sellprice:=min(open,stopbuy)-1*mindiff;//平多價格
    sellshortprice:=max(open,stopshort)+1*mindiff;//平空價格


    entertime:=time>opentime(1)+T*100 and time<closetime(0)-10*100;//入場交易時間
    exittime:=time>=closetime(0)-10*100;//平倉離場時間

     

    if entertime and holding=0 and num<CS then  {開倉入場}
    begin 
     if buycond then
        BEGIN
        buy(1,ss,limitr,buyprice);
        NUM:=NUM+1;
        END
     else if buyshortcond then
        BEGIN
        buyshort(1,ss,limitr,buyshortprice);
        NUM:=NUM+1;
        END
    end

     

    if enterbars>1 and holding<>0 then {止損離場}
    begin
     if holding>0 and sellcond then
        sell(1,ss,limitr,sellprice);
     else if holding<0 and sellshortcond then
        sellshort(1,ss,limitr,sellshortprice);
    end

     

    if exittime and holding<>0 then  {收盤平倉}
    begin
      sell(holding>0,ss,limitr,open-1*mindiff);
      sellshort(holding<0,ss,limitr,open+1*mindiff);
      NUM:=0;
    end

     

    持倉:holding,linethick0;
    凈利潤:netprofit,linethick0;
    資產:asset,linethick0;
    資金:cash(0),linethick0;


     
     

     

     

     

     

     

     

     

     

     

  • 金字塔客服: 并且檢查了一下圖表,本來當天是數據是滿足交易條件的,卻沒有顯示也沒有執行交易信號。

     

  • 用戶回復:

    if exittime and holding<>0 then  {收盤平倉}
    begin
      sell(holding>0,ss,limitr,open-1*mindiff);
      sellshort(holding<0,ss,limitr,open+1*mindiff);
      NUM:=0;
    end

     

    改成

     

    if exittime and holding<>0 then  {收盤平倉}
    begin
      sell(holding>0,ss,limitr,open-1*mindiff);
      sellshort(holding<0,ss,limitr,open+1*mindiff);
    end

    if exittime then   NUM:=0;

     

  • 網友回復:

    試了一下,的確糾正過來了謝謝、、

 

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

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


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 国产精品久久久久不卡绿巨人 | 日日干日日摸 | 亚洲精品9999久久久久 | 日韩欧美亚洲精品 | 在线观看免费黄色小视频 | 欧美成人毛片在线视频 | 日本中文不卡 | 欧美日韩成人在线 | 网站久久 | 超清中文乱码精品字幕在线观看 | 日韩欧国产精品一区综合无码 | 中文国产成人精品久久水 | 久久福利精品 | 亚洲狠狠成人综合网 | 久久综合综合久久狠狠狠97色 | 色哦色哦哦色天天综合 | 久久久成人网 | 国产a自拍 | 国产乱码亚洲精品一区二区 | 一个色中文字幕 | 奇米第四色在线观看 | 日日操日日射 | 四虎免费大片aⅴ入口 | 久爱www成人网免费视频 | 国内自拍网红在线综合 | 国产精品四虎在线观看免费 | 日韩国产欧美一区二区三区在线 | 我不卡老子影院午夜伦我不卡四虎 | 日日操天天 | 色婷婷六月桃花综合影院 | 国产精品香蕉成人网在线观看 | 国产精品品福利视频 | 免费观看日本特色做爰视频在线 | 在线 | 一区二区三区四区 | 亚洲欧美日韩精品中文乱码 | 色接久久| 成人国产激情福利久久精品 | 久久亚洲精品玖玖玖玖 | 亚洲欧美日韩不卡一区二区三区 | 99影视| 看免费一级毛片 |