盈利暫停的寫法 [金字塔]
- 咨詢內容:
條件是CROSS(MA5,MA10)買入,等CROSS(MA10,MA5)時若盈利超過X點,則平倉且暫停Y根K線。如果盈利不超過X點,則直接做反手。
- 金字塔客服:
這個暫定的寫法比想象中復雜,我先試試看
- 用戶回復:
variable:n=0;
ma5:=ma(c,5);
ma10:=ma(c,10);
X:=5;
Y:=10;
if cross(ma5,ma10) and n=0 and holding=0 then begin
buy(holding=0,1,market);
n:=1;
endIF cross(ma5,ma10) and n=1 and holding=0 and barpos-n>Y then buy(holding=0,1,market);
if cross(ma10,ma5) and holding>0 and n=1 then beginif openprofit>x*MULTIPLIER then begin
sell(1,0,market);
n:=barpos;
end
if openprofit<=x*MULTIPLIER then begin
sell(1,0,market);
buyshort(holding=0,1,market);
end
end
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容