平倉贏利下次開倉不加倉,平倉止損下次開倉時減倉如何寫 [金字塔]
- 咨詢內容:
圖表交易,
1:每次開倉n手(30%)資金,當前平倉贏利下次開倉不加倉依然開n手,
2:當前平倉止損下次開倉時減倉m手.如果這次贏利則下次開倉又回到n手.如果該次再次平倉虧損,則下次開倉再減m手.
3:每次贏利都回到開n手,平倉虧損則下次開倉一直減倉m,直致只能開1手為止
[此貼子已經被作者于2013/12/15 11:39:00編輯過] - 金字塔客服:
variable:n=0.3*asset/close/MULTIPLIER/0.15;//0.15=15%,是假設的保證金費率,需用戶自行寫入交易合約的保證金比率
if n<1 then n:=1;
if 下單條件 then begin
buy(holding=0,n,thisclose);
endif holding>0 and 平倉條件 then begin
sell(1,0,thisclose);
if numprofit(1)>0 then begin
n:=n;
end
if numprofit(1<0) then begin
n:=n-m;
end
end
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容