重復(fù)開(kāi)倉(cāng)問(wèn)題 [金字塔]
-
咨詢內(nèi)容:
? 比如:diff 和dea >0 軸,平空開(kāi)多。小于0軸,平多開(kāi)空。會(huì)出現(xiàn)條件滿足,一直開(kāi)倉(cāng)。如何解決開(kāi)倉(cāng)后一直持倉(cāng)待下一信號(hào)出現(xiàn),而不是一直開(kāi)倉(cāng)。
?
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
[此貼子已經(jīng)被作者于2017/5/10 19:31:17編輯過(guò)]?
-
金字塔客服:
突然反應(yīng)過(guò)來(lái),知道咋做了
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); ? ? ? ? ? ? ? ?? 開(kāi)多:BUY(KD AND HOLDING=0,1,THISCLOSE); ? ? ? ? ? 平多:SELL(PD,1,THISCLOSE); ? ? ? ? ? ? ? ? ? ? ?? 開(kāi)空:BUYSHORT(KK AND HOLDING=0,1,THISCLOSE);?
有思路,想編寫(xiě)各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫(xiě)!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容