換個瀏覽器,重新問
作者:金字塔 來源:cxh99.com 發(fā)布時間:2014年09月01日
- 咨詢內(nèi)容:
初學金字塔,請各位老師挑錯,日內(nèi),五分鐘線,當前價格與之前兩個不同周期的開盤價進行比較<!--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;;
//交易系統(tǒng)
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,是不是可以?而且在圖表中發(fā)現(xiàn)有的K線上有兩個信號既平空又開多,看著很不舒服,該如何改進
- 金字塔客服:
除了前面的close改h,close改l的
還要這樣改
sellshort(平空條件 and holding<0,holding,market);
buy(開多條件 and holding=0 and exitbars>0,1,market);
sell(平多條件 and holding>0,holding,market);
buyshort(開空條件 and holding=0 and exitbars>0,1,market);
- 用戶回復:
改完了,信號全沒了,
- 網(wǎng)友回復:
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;;
//交易系統(tǒng)
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);
- 網(wǎng)友回復:
謝謝啦,幫了大忙,贊哦~