先止損后開(kāi)倉(cāng),一一對(duì)應(yīng) [金字塔]
-
咨詢內(nèi)容:
這樣編寫(xiě)程序順序合理,正確??
pdd:=aq1>=1 and l>fl;
pkk:=aq1>=1 and h<fh;
VARIABLE: ll=0, hh=0, astop=0, bstop=0, temp_ll[]=0, temp_hh[]=0;? //交易系統(tǒng) ?if enterbars>1 and l<astop -2*MINDIFF and holding>0 then sell(1,0,marketr);//止損止盈,實(shí)時(shí)出場(chǎng) ? if h>valuewhen(TYPE(2),hhv(fh,10)) and holding=0 and 倉(cāng)差>0 then buy(1,ss,marketr);//止損后,再次入場(chǎng) ?if enterbars>1 and h>bstop +2*MINDIFF and holding<0 then sellshort(1,0,marketr);//止損止盈,實(shí)時(shí)出場(chǎng) ? if l<valuewhen(TYPE(4),llv(fl,10)) and holding=0 and 倉(cāng)差<0 then buyshort(1,ss,marketr);//止損后,再次入場(chǎng) ?//開(kāi)多? temp_ll:=llv(l,2); if pdd then begin ? ?sellshort(1,0,marketr); ? ?buy(holding=0 and 倉(cāng)差>0,ss,marketr); ? ?ll:=temp_ll; end astop:=ll; //開(kāi)空 temp_hh:=hhv(h,2); if pkk then begin ? ?sell(1,0,marketr); ? ?buyshort(holding=0 and 倉(cāng)差<0,ss,marketr); ? ?hh:=temp_hh; end bstop:=hh;?
-
金字塔客服:
另外這樣編寫(xiě)法:
pdd:=aq1>=1 and l>fl;
pkk:=aq1>=1 and h<fh;
//交易系統(tǒng)
temp_ll:=llv(l,2);
if pdd then
begin
? ?sellshort(1,0,marketr);
? ?buy(holding=0 and 倉(cāng)差>0,ss,marketr);
? ?ll:=temp_ll;
end
?if enterbars>1 and l<ll-2*MINDIFF and holding>0 then sell(1,0,marketr);//止損止盈,實(shí)時(shí)出場(chǎng)
?if h>valuewhen(TYPE(2),hhv(fh,10)) and holding=0 and 倉(cāng)差>0 then buy(1,ss,marketr);
temp_hh:=hhv(h,2); if pkk then begin ? ?sell(1,0,marketr); ? ?buyshort(holding=0 and 倉(cāng)差<0,ss,marketr); ? ?hh:=temp_hh; end ?if enterbars>1 and h>hh+2*MINDIFF and holding<0 then sellshort(1,0,marketr); ?if l<valuewhen(TYPE(4),llv(fl,10)) and holding=0 and 倉(cāng)差<0 then buyshort(1,ss,marketr);?
?來(lái)源:程序化久久網(wǎng)( www.tumamayizhan.com )
-
用戶回復(fù):
關(guān)鍵要保證止損一定要執(zhí)行。
?
-
網(wǎng)友回復(fù):
在線等
?
-
網(wǎng)友回復(fù):
在線等。VIP
此主題相關(guān)圖片如下:qq圖片20170520151708.png
客戶
有思路,想編寫(xiě)各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫(xiě)!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容