換個瀏覽器,重新問 [金字塔]
- 咨詢內容:
初學金字塔,請各位老師挑錯,日內,五分鐘線,當前價格與之前兩個不同周期的開盤價進行比較<!--EndFragment-->,否則賣出,并添加止損條件。
input:t(10,1,100,5),d(5);
一倍周期開盤價:=ref(open,t),noaxis,nodraw;
兩倍周期開盤價:=ref(open,2*t),noaxis,nodraw;
//交易條件
開多條件:=close>ref(open,t) and close>ref(open,2*t) and time<185500;
平多條件:=time=185500 or l<enterprice-d*mindiff;
開空條件:=close<ref(open,t) and close<ref(open,2*t)and time<185500;
平空條件:=time=185500 or h>enterprice+d*mindiff;;
//交易系統
sellshort(平空條件 and holding<0,holding,market);
buy(開多條件 and holding=0,1,market);
sell(平多條件 and holding>0,holding,market);
buyshort(開空條件 and holding=0,1,market);
懇請各位好心人幫忙看看,不勝感激,
其中把止損離場和收盤前離場放在一起都用market,是不是可以?而且在圖表中發現有的K線上有兩個信號既平空又開多,看著很不舒服,該如何改進
- 金字塔客服:
除了前面的close改h,close改l的
還要這樣改
- 用戶回復:
改完了,信號全沒了,
- 網友回復:
input:t(10,1,100,5),d(5);
variable:n=0;
一倍周期開盤價:=ref(open,t),noaxis,nodraw;
兩倍周期開盤價:=ref(open,2*t),noaxis,nodraw;
//交易條件
開多條件:=close>ref(open,t) and close>ref(open,2*t) and time<185500;
平多條件:=time=185500 or l<enterprice-d*mindiff;
開空條件:=close<ref(open,t) and close<ref(open,2*t)and time<185500;
平空條件:=time=185500 or h>enterprice+d*mindiff;;
//交易系統
if n=0 and 開多條件 and holding=0 then begin
buy(1,1,market);
n:=1;
end
if n=0 and 開空條件 and holding=0 then begin
buyshort(1,1,market);
n:=1;
end
sellshort(平空條件 and holding<0,holding,market);
buy(開多條件 and holding=0 and exitbars>0 and n=1,1,market);
sell(平多條件 and holding>0 ,holding,market);
buyshort(開空條件 and holding=0 and exitbars>0 and n=1,1,market);
- 網友回復: 謝謝啦,幫了大忙,贊哦~
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容