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

您現(xiàn)在的位置:程序化交易>> 期貨公式>> 金字塔等>> 金字塔知識(shí)>>正文內(nèi)容

請(qǐng)問(wèn)怎么解決反手不開(kāi)倉(cāng)的問(wèn)題 [金字塔]

  • 咨詢內(nèi)容: 老師你好,下面是我的交易代碼示例,其中,平多條件(PD)想表達(dá)的意思是:如果開(kāi)空條件已成立,即使持有多單也馬上平多開(kāi)空(PK亦然),這時(shí)候系統(tǒng)就只有平倉(cāng),沒(méi)有開(kāi)倉(cāng),請(qǐng)問(wèn)是什么原因?
    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;//開(kāi)多條件kk:=cross(cpx,c) and cpx<ref(cpx,1) and  macd<0 and entertime;//開(kāi)空條件pd:=(macd<0 and cpx<ref(cpx,1)) or kk or exittime;//平多條件(如果開(kāi)空條件成立,即使持有多單,馬上平多開(kāi)空pk:=(macd>0 and cpx>ref(cpx,1)) or kd or exittime;//平空條件(如果開(kāi)多條件成立,即使持有空單,馬上平空開(kāi)多
    //交易系統(tǒng) 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

     

     

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

     

    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;//開(kāi)多條件 kk:=cross(cpx,c) and cpx<ref(cpx,1) and  macd<0 and entertime;//開(kāi)空條件 pd:=(macd<0 and cpx<ref(cpx,1)) or exittime;//平多條件(如果開(kāi)空條件成立,即使持有多單,馬上平多開(kāi)空 pk:=(macd>0 and cpx>ref(cpx,1)) or exittime;//平空條件(如果開(kāi)多條件成立

     

    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);

     

     

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

    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

     

  • 網(wǎng)友回復(fù): 謝謝老師,我改過(guò)來(lái)了,如果加上移動(dòng)止贏變量,麻煩老師再看看下面的公式格式和邏輯對(duì)不對(duì)?謝謝!
    variable:ydzy=1;                 //移動(dòng)止盈開(kāi)關(guān)variable:highprice=0,lowprice=0; //記錄開(kāi)倉(cāng)價(jià)
    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

     

  • 網(wǎng)友回復(fù): 現(xiàn)在是哪里不對(duì)的問(wèn)題?

 

有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友

可聯(lián)系技術(shù)人員 QQ: 1145508240  有需要幫忙請(qǐng)點(diǎn)擊這里留言!!!進(jìn)行 有償 編寫!不貴!點(diǎn)擊查看價(jià)格!


【字體: 】【打印文章】【查看評(píng)論

相關(guān)文章

    沒(méi)有相關(guān)內(nèi)容
主站蜘蛛池模板: 久爱www成人网免费视频 | 免费乱理伦片在线观看八戒 | 亚州国产 | 国产成人精品第一区二区 | 92看片淫黄大片看国产片 | 最近2019好看的中文字幕 | 免费一级特黄欧美大片勹久久网 | 国产精品亚洲高清一区二区 | 亚洲欧美日韩中文字幕在线 | 香蕉欧美| 日韩欧美亚洲国产高清在线 | 日本久久精品 | 高清欧美不卡一区二区三区 | 久久精品视频3 | 国产成人亚洲综合 | 清风阁我爱干视频 | 成人黄色片在线观看 | 色综合色综合 | 中文字幕在线观 | 高清国产美女一级a毛片在线 | 福利在线看| 中文字幕日本在线 | 中文字幕成人免费高清在线 | 日韩高清一区 | 久青草视频在线观看 | 久久天天干 | 日本人娇小hd | 特一级毛片 | 九九性视频| 高清欧美不卡一区二区三区 | 色综合狠狠操 | 成人观看 | 天天插天天透天天狠 | 最近2019中文字幕大全视频1 | 国产精品九九免费视频 | 日本一区二区三区高清福利视频 | 国产欧美日韩高清专区手机版 | 日日噜噜夜夜狠狠视频buoke | 日本系列第一页 | 国产精品一区在线观看 | 久草免费福利视频 |