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

您現(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  點(diǎn)擊這里給我發(fā)消息進(jìn)行 有償 編寫!不貴!點(diǎn)擊查看價格!


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

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 色综合色狠狠天天综合色hd | 国内外成人免费在线视频 | 日韩精品1| 欧美日韩在线影院 | 天天射天天做 | 欧美综合图区亚洲综合图区 | 日本免费三级网站 | 国产三级网站 | 日本道综合一本久久久88 | 夜夜操夜夜骑 | 按摩一级片 | 欧美视频网 | 国产无遮挡色视频免费视频 | www.黄com| 一级片在线免费看 | 免费视频www| 欧美成人免费公开播放 | 日本黄a三级三级三级 | 免费亚洲一区 | 久久精品香蕉视频 | l欧美18一19sex性 | 日韩黄在线观看免费视频 | 福利片在线观看免费高清 | 国产成年人视频 | 亚洲精品456播放 | 特级a毛片| 18女人水真多免费高清毛片 | 特黄免费| 成年黄网站色视频免费观看 | 日日摸夜夜欧美一区二区 | 日韩在线www | 涩涩视频www在线观看入口 | 黄色成人在线 | 成人免费播放器 | 天天插天天插 | 欧美不卡一区二区三区 | 国产最强大片免费视频 | 91成人午夜精品福利院在线观看 | 日本欧美黄色 | 一区二区三区在线播放 | 国产精品日韩精品 |