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

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

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

  • 咨詢內容:

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

    下文定義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,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 后邊的參數就是限價的價格,改成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


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

 

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

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


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 最近免费的中文字幕一 | 成人亚洲网站www在线观看 | 超清乱人伦中文视频在线 | 一级午夜免费视频 | 手机亚洲第一页 | 欧美怡红院在线观看 | 免费色网站 | 我亲爱的朋友们免费看 | 日本免费黄网 | 欧美羞羞视频 | 午夜寂寞影视 | 日韩操操操 | 日韩成a人片在线观看日本 日韩操操操 | 色老头永久免费网站 | 99色在线视频 | 521色香蕉网在线观看免费 | 亚洲国产成人久久综合区 | 国产欧美精品区一区二区三区 | 美国一级毛片a | 深夜www| 青春久久 | 中文字幕日本精品一区二区三区 | 精品久久久久久中文 | 手机看片久久高清国产日韩 | 欧美色碰碰碰免费观看长视频 | 亚洲一区精品视频在线 | h片在线看 | 欧美日韩视频一区二区 | 日韩成人免费视频 | 波多野结衣在线免费视频 | www视频在线 | 精品亚洲性xxx久久久 | 国产精选免费视频 | vvideos欧美极度另类 | 黄视频链接 | 96香蕉视频| 在线视频天堂 | 午夜yy | 老色批在线播放视频网站免费 | 波多野结衣在线一区二区 | 深夜福利视频网 |