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

怎么把oo定義成為 平空? 或者平多 處的價位呢??? [金字塔]

  • 咨詢內(nèi)容:

    怎么把oo定義成為 平空? 或者平多 處的價位呢???

    下文定義oo是當(dāng)日開盤價,我想把它改成 平倉處的價位 ,怎么寫呢?求指導(dǎo)


    input:grid(3,1,60,1);

    variable:level=0;

    dist:=barslast(date<>ref(date,1));
    oo:=ref(open,dist);
    ?

    if holding=0 then begin
    ?dnprice:=oo-grid*mindiff;
    ?
    ?if low<=dnprice then begin
    ??buy(1,1,limitr,dnprice);
    ??level:=-1;
    ?end
    end?

    if holding=0 then begin
    ?upprice:=oo+grid*mindiff;
    ?
    ?if high>=upprice then begin
    ??buyshort(1,1,limitr,upprice);
    ??level:=1;
    ?end?
    end

    if holding>0 then begin
    ?upprice:=oo+(level+1)*grid*mindiff;
    ?dnprice:=oo+(level-1)*grid*mindiff;
    ?
    ?if high>=upprice then begin
    ??sell(1,1,limitr,upprice);
    ??level:=level+1;
    ?end
    ?
    ?if low<=dnprice then begin
    ??buy(1,1,limitr,dnprice);
    ??level:=level-1;
    ?end
    ?
    ?if time=closetime(0) then
    ??sell(1,holding,limitr,close);
    end?

    if holding<0 then begin?
    ?upprice:=oo+(level+1)*grid*mindiff;
    ?dnprice:=oo+(level-1)*grid*mindiff;
    ?
    ?if low<=dnprice then begin
    ??sellshort(1,1,limitr,dnprice);
    ??level:=level-1;
    ?end
    ?
    ?if high>=upprice then begin
    ??buyshort(1,1,limitr,upprice);
    ??level:=level+1;
    ?end
    ?
    ?if time=closetime(0) then
    ??sellshort(1,holding,limitr,close);
    end

    ?

  • 金字塔客服:

    limitr 后邊的參數(shù)就是限價的價格,改成oo就可以了。

    input:grid(3,1,60,1);

    variable:level=0;

    dist:=barslast(date<>ref(date,1));
    oo:=ref(open,dist);
    ?

    if holding=0 then begin
    ?dnprice:=oo-grid*mindiff;
    ?
    ?if low<=dnprice then begin
    ??buy(1,1,limitr,dnprice);
    ??level:=-1;
    ?end
    end?

    if holding=0 then begin
    ?upprice:=oo+grid*mindiff;
    ?
    ?if high>=upprice then begin
    ??buyshort(1,1,limitr,upprice);
    ??level:=1;
    ?end?
    end

    if holding>0 then begin
    ?upprice:=oo+(level+1)*grid*mindiff;
    ?dnprice:=oo+(level-1)*grid*mindiff;
    ?
    ?if high>=upprice then begin
    ??sell(1,1,limitr,oo);
    ??level:=level+1;
    ?end
    ?
    ?if low<=dnprice then begin
    ??buy(1,1,limitr,dnprice);
    ??level:=level-1;
    ?end
    ?
    ?if time=closetime(0) then
    ??sell(1,holding,limitr,oo);
    end?

    if holding<0 then begin?
    ?upprice:=oo+(level+1)*grid*mindiff;
    ?dnprice:=oo+(level-1)*grid*mindiff;
    ?
    ?if low<=dnprice then begin
    ??sellshort(1,1,limitr,oo);
    ??level:=level-1;
    ?end
    ?
    ?if high>=upprice then begin
    ??buyshort(1,1,limitr,upprice);
    ??level:=level+1;
    ?end
    ?
    ?if time=closetime(0) then
    ??sellshort(1,holding,limitr,oo);
    end


    [此貼子已經(jīng)被作者于2017/5/19 16:43:26編輯過]

 

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

可聯(lián)系技術(shù)人員 QQ: 511411198  點擊這里給我發(fā)消息進行 有償 編寫!不貴!點擊查看價格!


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

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 国产另类TS人妖一区二区| 婷婷六月天激情| 国产成人av在线影院| 久久久久亚洲av无码去区首| 精品无码久久久久久久久| 大学生一级特黄的免费大片视频| 亚洲国产精品尤物yw在线观看| 黑人巨大videos极度另类| 推油少妇久久99久久99久久| 免费播放哟哟的网站| 2021光根影院理论片| 日本高清免费中文在线看| 冲田杏梨在线精品二区| 91亚洲自偷手机在线观看| 成年男女免费视频网站| 亚洲综合综合在线| 很黄很黄的网站免费的| 成全视频免费高清| 亚洲色中文字幕在线播放| 色香蕉在线观看网站| 国产精品丝袜黑色高跟鞋| 丰满多毛的陰户视频| 毛片大全在线观看| 国产性生交xxxxx免费| 99亚洲精品视频| 日韩内射美女片在线观看网站| 动漫精品动漫一区三区3d| 67194成是人免费无码| 岳双腿间已经湿成一片视频| 久久永久免费人妻精品下载| 精品国产三上悠亚在线观看| 国产精品欧美亚洲韩国日本久久| 久久久噜久噜久久gif动图| 欧美成人免费高清网站| 国产一级三级三级在线视| xxxxwww日本在线| 成人区人妻精品一区二区不卡网站 | 彩虹男gary网站| 久久国产视频网站| 特级毛片免费播放| 嗯!啊!使劲用力在线观看|