平倉反手不在同一K? [金字塔]
-
咨詢內容:
if ref((tmpd=1 or (count(bi=-1,2)=1 and aq1>=1)) and (gpd1 or gpd2),1) then begin
? ?sellshort(1,ss,LIMITR,O);
? ?buy(holding=0,ss,LIMITR,O);
end
多止:valuewhen(enterbars=1,llv(fl,2)),NODRAW;
if enterbars>1 and min(o,c)<=多止-2*MINDIFF then sell(1,ss,marketr);
if holding>0 and ((enterbars>1 and pdd=-1) or (enterbars>15 and aspect=1)) then sell(1,ss,marketr);
if ref((tmpk=-1 or (count(bi=1,2)=1 and aq1>=1)) and (gpk1 or gpk2),1) then begin ? ?sell(1,ss,LIMITR,O); ? ?buyshort(holding=0,ss,LIMITR,O); end? 空止:valuewhen(enterbars=1,hhv(fh,2)),NODRAW; if enterbars>1 and max(o,c)>=空止+2*MINDIFF then sellshort(1,ss,marketr); if holding<0 and ((enterbars>1 and pkk=1) or (enterbars>15 and aspect=0)) then sellshort(1,ss,marketr);?
請幫忙看看?
-
金字塔客服:
具體說明下你的問題
?
?來源:程序化久久網( www.kzuj.com.cn )
-
用戶回復:
反手的,平與開不在同一個K上
[此貼子已經被作者于2017/5/16 17:01:44編輯過]?
-
網友回復:
平倉在前一K線,開倉在次K上 。上面語言哪里出問題?
?
- 網友回復: if ref((tmpd=1 or (count(bi=-1,2)=1 and aq1>=1)) and (gpd1 or gpd2),1) then begin ? ?sellshort(1,ss,LIMITR,O); ? ?buy(holding=0,ss,LIMITR,O); end 平倉反手在圖表中,是同時進行的,也就是說在執行sellshort和buy是使用的同一個holding的狀態值,所以在平倉后就會造成buy(holding=0,...)條件不滿足,。也就是你看到的現象 你可以改成 ?sellshort(1,holding,LIMITR,O); ? ?buy(1,ss,LIMITR,O);
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 511411198 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容