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

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

請問如下條件如何編寫? [金字塔]

  • 咨詢內容:

    請問如下的 第二次及第n次開倉條件 的語句如何編寫?    

    tr1 : max(max((high-low),abs(ref(close,1)-high)),abs(ref(close,1)-low));    

    atr : ma(tr1,20); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //atr公式    

    ?

    ma20:ma(close,20); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //20日均線    

    ?

    a1:=0.01*valuewhen(barpos=1,asset); ?????????????//初始資金的1%    

    ?

    a2:=floor(a1/(2*atr)); ? ? ? ? ? ? ? ? ? ? ? ? //開倉手數    

    ?

    a3:=ref(hhv(high,20),1); ? ? ? ? ? ? ? ? ? ? ? //20日高點    

    ?

    if holding=0 and close>a3 and close>ma20    

    then begin    

    buy(1,a2,marketr);    

    end ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //第一次開倉    

    ?

    a4:=enterprice-2*ref(atr,enterbars=1);    

    if holding=1 and low<=a4    

    then begin    

    sell(1,0,limitr,a4);    

    end ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //第一次開倉離場    

    ?

    //第二次及第n次開倉條件:如果隨后的收盤 > 上一次(即第 n-1 次)開倉的(enterprice+2*atr),則開倉(即第 n 次);    

    ?

  • 金字塔客服:

    variable:bj=0;

    tr1 : max(max((high-low),abs(ref(close,1)-high)),abs(ref(close,1)-low));

    atr : ma(tr1,20); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //atr公式


    ma20:ma(close,20); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //20日均線


    a1:=0.01*valuewhen(barpos=1,asset); ?????????????//初始資金的1%


    a2:=floor(a1/(2*atr)); ? ? ? ? ? ? ? ? ? ? ? ? //開倉手數


    a3:=ref(hhv(high,20),1); ? ? ? ? ? ? ? ? ? ? ? //20日高點


    if holding=0 and close>a3 and close>ma20 and bj=0

    then begin

    buy(1,a2,marketr);

    bj:=1;

    end ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //第一次開倉

    if holidng=0 and close>enterprice+2*atr and bj=1?

    then begin

    buy(1,a2,marketr);

    end

    a4:=enterprice-2*ref(atr,enterbars=1);

    if holding=1 and low<=a4

    then begin

    sell(1,0,limitr,a4);

    end ? ? ? ? ? ? ?

    ?

  • 用戶回復: 明白了,謝謝!

    ?

  • 網友回復: 你好,我看到你這行代碼: if holding=0 and close>a3 and close>ma20 and bj=0 then begin buy(1,a2,marketr); bj:=1; end ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //第一次開倉
    if holding=0 and close>enterprice+2*atr and bj=1? then begin buy(1,a2,marketr); end
    第二處的“ if holding=0 and close>enterprice+2*atr and bj=1? ”,這里有沒有寫錯?還是“ if holding=0 ”嗎?不是“ if holding>0

 

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

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


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 狠狠久久综合伊人不卡 | 天天搞天天操 | 色香蕉在线 | 四虎影视精品永久免费网站 | 国产欧美在线观看不卡 | 亚洲午夜综合网 | 性久久 | 亚洲视频中文字幕 | 国产精品久久影院 | 久久99精品久久久久子伦小说 | 成人a毛片高清视频 | 免费不卡中文字幕在线 | 日本免费一区二区三区 | 精品999视频| 天天尻逼 | 亚洲国产精品国产自在在线 | 亚洲黄色a | 亚洲国产高清视频在线观看 | 毛片看| 亚洲天天做夜夜做天天欢 | 国产欧美一区二区精品性色99 | 97色在线观看 | 视频一区在线免费观看 | 天天久久狠狠色综合 | 狠狠澡夜夜澡人人爽 | 欧洲在线免费视频 | 伊人成人在线视频 | 国产三级久久 | 阳光灿烂的日子在线观看 | 露脸真实国产精品自在 | 国产一区二区在线观看免费 | 国产香蕉在线精彩视频 | 亚洲欧美国产日产综合不卡 | 狠狠狠综合色 | 亚洲永久精品一区二区三区 | 狠狠色伊人亚洲综合第8页 狠狠色综合久久丁香婷婷 狠狠色综合久久婷婷 | 免费在线观看黄色小视频 | 日本欧美中文字幕 | 五月天婷五月天综合网在线 | 国产精品国产国产aⅴ | a在线观看 |