換個瀏覽器,重新問 [金字塔]
- 咨詢內(nèi)容:
初學(xué)金字塔,請各位老師挑錯,日內(nèi),五分鐘線,當(dāng)前價格與之前兩個不同周期的開盤價進(jìn)行比較<!--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線上有兩個信號既平空又開多,看著很不舒服,該如何改進(jìn)
- 金字塔客服:
除了前面的close改h,close改l的
還要這樣改
- 用戶回復(fù):
改完了,信號全沒了,
- 網(wǎng)友回復(fù):
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)友回復(fù): 謝謝啦,幫了大忙,贊哦~
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 1145508240 進(jìn)行 有償 編寫!(不貴!點擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容