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

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

請問怎么解決反手不開倉的問題 [金字塔]

  • 咨詢內容: 老師你好,下面是我的交易代碼示例,其中,平多條件(PD)想表達的意思是:如果開空條件已成立,即使持有多單也馬上平多開空(PK亦然),這時候系統就只有平倉,沒有開倉,請問是什么原因?
    dif:=ema(c,12)-ema(c,26);dea:=ema(dif,9);macd:=2*(dif-dea);cpx:=ma(c,14);entertime:=time<150000 and time>091600;exittime:=time>=151400;
    //交易條件kd:=cross(c,cpx) and cpx>ref(cpx,1) and macd>0 and entertime;//開多條件kk:=cross(cpx,c) and cpx<ref(cpx,1) and  macd<0 and entertime;//開空條件pd:=(macd<0 and cpx<ref(cpx,1)) or kk or exittime;//平多條件(如果開空條件成立,即使持有多單,馬上平多開空pk:=(macd>0 and cpx>ref(cpx,1)) or kd or exittime;//平空條件(如果開多條件成立,即使持有空單,馬上平空開多
    //交易系統 if holding<>0 then begin   sell(pd,0,limit,c),orderqueue;   sellshort(pk,0,limit,c),orderqueue;end
    if holding=0 then begin   buy(kd,1,limit,c),orderqueue;   buyshort(kk,1,limit,c),orderqueue;end

     

  • 金字塔客服: if holding<>0 then begin    sell(pd,0,limit,c),orderqueue;    sellshort(pk,0,limit,c),orderqueue; end
    if holding=0 then begin    buy(kd,1,limit,c),orderqueue;    buyshort(kk,1,limit,c),orderqueue; end

     

     

    這樣的順序是不正確的,軟件的公式編輯界面有說明是如何寫的。而且,用戶是不是不明白ORDERQUEUE是用來干什么的?加上來是不是為了好看?

     

    dif:=ema(c,12)-ema(c,26); dea:=ema(dif,9); macd:=2*(dif-dea); cpx:=ma(c,14); entertime:=time<150000 and time>091600; exittime:=time>=151400;   kd:=cross(c,cpx) and cpx>ref(cpx,1) and macd>0 and entertime;//開多條件 kk:=cross(cpx,c) and cpx<ref(cpx,1) and  macd<0 and entertime;//開空條件 pd:=(macd<0 and cpx<ref(cpx,1)) or exittime;//平多條件(如果開空條件成立,即使持有多單,馬上平多開空 pk:=(macd>0 and cpx>ref(cpx,1)) or exittime;//平空條件(如果開多條件成立

     

    if kd then begin

       sellshort(1,0,thisclose);

       buy(holding=0,1,thisclose);

    end

     

    if kk then begin

       sell(1,0,thisclose);

       buyshort(holding=0,1,thisclose);

    end

     

    if pd then sell(1,0,thisclose);

    if pk then sellshort(1,0,thisclose);

     

     

  • 用戶回復: 謝謝老師,我改過來了!如果我加上移動止贏的全局變量(YDZY),麻煩老師看一下下面的格式和邏輯對不對呢?

    if ydzy=1 and holding<>0 then begin   if h>highprice then highprice:=h;   if (highprice-enterprice>=49 and highprice-h>=6) or (highprice-enterprice>=19 and h-enterprice<=17) then sell(1,0,limitr,c);   if l<lowprice then lowprice:=l;   if (enterprice-lowprice>=30 and l-lowprice>=16) or (enterprice-lowprice>=19 and enterprice-l<=13) then sellshort(1,0,limitr,c);end

     

  • 網友回復: 謝謝老師,我改過來了,如果加上移動止贏變量,麻煩老師再看看下面的公式格式和邏輯對不對?謝謝!
    variable:ydzy=1;                 //移動止盈開關variable:highprice=0,lowprice=0; //記錄開倉價
    if kd  then begin   sellshort(1,0,limitr,c);   buy(holding=0,1,limitr,c);   highprice:=enterprice; end if kk  then begin   sell(1,0,limitr,c);   buyshort(holding=0,1,limitr,c);   lowprice:=enterprice;end if pd or enterprice-c>=10 then sell(1,0,limitr,c);if pk or c-enterprice>=10 then sellshort(1,0,limitr,c);
    if ydzy=1 and holding<>0 then begin   if h>highprice then highprice:=h;   if (highprice-enterprice>=49 and highprice-h>=6) or (highprice-enterprice>=19 and h-enterprice<=17) then sell(1,0,limitr,c);   if l<lowprice then lowprice:=l;   if (enterprice-lowprice>=30 and l-lowprice>=16) or (enterprice-lowprice>=19 and enterprice-l<=13) then sellshort(1,0,limitr,c);end

     

  • 網友回復: 現在是哪里不對的問題?

 

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

可聯系技術人員 QQ: 1145508240  有需要幫忙請點擊這里留言?。?!進行 有償 編寫!不貴!點擊查看價格!


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 一级毛片在线观看视频 | 四虎免费影院在线播放 | 婷婷激情在线视频 | 午夜一级精品免费毛片 | 一本伊大人香蕉久久网手机 | 99精品久久精品一区二区 | 奇米影视中文字幕 | 欧美精品一区在线看 | 深夜在线免费视频 | 大尺度毛片 | 日本高清影院 | 欧美狠狠入鲁的视频极速 | 免费在线一区二区三区 | 国产精品二区在线 | 我想看一级毛片免费的 | 91免费国产在线观看尤物 | 久久久这里有精品999 | 免费一级特黄欧美大片久久网 | 国产欧美日韩在线播放 | 亚欧精品在线观看 | 就草草在线观看视频 | 日日摸夜夜 | 国产一国产一级毛片视频在线 | 国产亚洲欧美精品久久久 | 91爱爱视频 | 午夜国产在线观看 | 亚洲人人爱 | 欧美在线播放一区二区 | 999国产视频 | 久久精品亚洲牛牛影视 | 亚洲精品久久久久久久久久久网站 | 日本在线不卡免费视频一区 | 国产精品6 | 国产精品所毛片视频 | 欧美一级日韩在线观看 | 99久久精品国产免看国产一区 | aaaaa级毛片 aaaa级毛片欧美的 | 波多野结衣免费一区二区三区香蕉 | 欧美影院 | 色女孩综合 | 在线欧美亚洲 |