重復開倉問題 [金字塔]
-
咨詢內容:
? 比如:diff 和dea >0 軸,平空開多。小于0軸,平多開空。會出現條件滿足,一直開倉。如何解決開倉后一直持倉待下一信號出現,而不是一直開倉。
?
diff:="macd.diff";
dea:="macd.dea";
Long:diff >=0 and dea >=0;
if Long ?then begin ? ? sellshort(holding<0,holding,market); ? ? buy(1,1,market); ? ? ? ? ? ? end?
short:diff<=0 and dea<=0; ?? if short ?then begin ? ?sell(holding>0,holding,market); ? ?buyshort(1,1,market); ? ? end
[此貼子已經被作者于2017/5/10 19:31:17編輯過]?
-
金字塔客服:
突然反應過來,知道咋做了
diff:="macd.diff"; dea:="macd.dea"; Long:diff >=0 and dea >=0; short:diff<=0 and dea<=0;
KD:=Long; ? ? ? ? ? PD:=short; KK:=short; ? ? ? ? ? PK:=long; ? ? ? ? ?
平空:SELLSHORT(PK,1,THISCLOSE); ? ? ? ? ? ? ? ?? 開多:BUY(KD AND HOLDING=0,1,THISCLOSE); ? ? ? ? ? 平多:SELL(PD,1,THISCLOSE); ? ? ? ? ? ? ? ? ? ? ?? 開空:BUYSHORT(KK AND HOLDING=0,1,THISCLOSE);?
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 511411198 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容