[原創] [金字塔]
- 咨詢內容:
麻煩老師幫我寫個代碼,當持有多倉時,1、設置初始止損20個點, 2、當盈利20個點時,加倉一手,同時把止損移動到第一次開倉位置。 3、加倉的基礎上盈利20個點,再次加倉1手,同時把止損移動到第一次加倉位置; 4、以此類推,每盈利20個點加倉一次、同時移動止損。。最大加倉次數不超過5次。。。
空倉我就自己寫了,麻煩老師示范一下
- 金字塔客服:
開倉價位和加倉價位是指定的還是市價?
- 用戶回復:
開倉是指定價、加倉是市價
- 網友回復:
variable:N=0;
variable:zs=0;
if holding=0 and 開倉條件 then BEGIN
buy(1,1,limitr,指定的價格);
end
if holding>0 and c>enterprice+20 and n<5 then begin
zs:=enterprice;
buy(1,1,marketr);
n:=n+1;
endif holding>0 and n=0 and c<enterprice-20 then begin
sell(1,0,marketr);
end
if holding>0 and n>0 and c<zs-20 then begin
sell(1,0,marketr);
n:=0;
end - 網友回復:
這里有“平倉后加倉次數重置為0”的設定
[此貼子已經被作者于2016-6-15 15:10:02編輯過]
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 511411198 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容