怎樣移動止盈? [金字塔]
-
咨詢內容:
DIFF突破0軸開多5手,每盈利10點止盈1手,當DIFF下到0軸,平倉開空5手,每盈利10點止盈1手,DIFF突破0軸平倉
?
-
金字塔客服:
需要再明確下你的平倉條件。每盈利10點止盈1手,則盈利20點止盈1手、盈利30點再止盈1手?若價格未盈利20點,又回落到盈利10點的的時候不止盈,直接DIFF下到0軸再全平?
?
?
?來源:程序化久久網( www.kzuj.com.cn )
-
用戶回復:
是的
?
-
網友回復:
是的
?
-
網友回復:
以下案例僅供參考。
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軸時,平空單,開5手多單
[此貼子已經被作者于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軸時,平多單,開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點,平1手
?? sell(1,1,market);
?? price:=c;
?? end
??
if holding<0 and price-c>=10*mindiff then? begin? //空單盈利每10點,平1手
?? sellshort(1,1,market);
?? price:=c;
?? end
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 或微信號:cxh99cxh99 進行 有償收費 編寫!(注:由于人數限制,QQ或微信請選擇方便的一個聯系我們就行,謝謝您!)
相關文章
-
沒有相關內容