怎樣移動(dòng)止盈? [金字塔]
-
咨詢內(nèi)容:
DIFF突破0軸開多5手,每盈利10點(diǎn)止盈1手,當(dāng)DIFF下到0軸,平倉開空5手,每盈利10點(diǎn)止盈1手,DIFF突破0軸平倉
?
-
金字塔客服:
需要再明確下你的平倉條件。每盈利10點(diǎn)止盈1手,則盈利20點(diǎn)止盈1手、盈利30點(diǎn)再止盈1手?若價(jià)格未盈利20點(diǎn),又回落到盈利10點(diǎn)的的時(shí)候不止盈,直接DIFF下到0軸再全平?
?
?
?來源:程序化久久網(wǎng)( www.weiqiv.net.cn )
-
用戶回復(fù):
是的
?
-
網(wǎng)友回復(fù):
是的
?
-
網(wǎng)友回復(fù):
以下案例僅供參考。
variable:price=0;?? //定義全局變量price
?
diff:=ema(close,12)-ema(close,26);
con1:cross(diff,0);
con2:cross(0,diff);?
if con1 then begin????????????????? //diff上穿0軸時(shí),平空單,開5手多單
[此貼子已經(jīng)被作者于2019/7/8 9:28:57編輯過]
?? sellshort(holding<0,holding,market);
?? buy(holding=0,5,market);
?? price:=enterprice;
?? end
?
if con2 then begin????????????????? //diff下穿0軸時(shí),平多單,開5手空單
?? sell(holding>0,holding,market);
?? buyshort(holding=0,5,market);
?? price:=enterprice;
?? end
??
if holding>0 and c-price>=10*mindiff? then? begin?? //多單盈利每10點(diǎn),平1手
?? sell(1,1,market);
?? price:=c;
?? end
??
if holding<0 and price-c>=10*mindiff then? begin? //空單盈利每10點(diǎn),平1手
?? sellshort(1,1,market);
?? price:=c;
?? end
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 1145508240 或微信號(hào):cxh99cxh99 進(jìn)行 有償收費(fèi) 編寫!(注:由于人數(shù)限制,QQ或微信請(qǐng)選擇方便的一個(gè)聯(lián)系我們就行,謝謝您!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容