模型編寫求助 [金字塔]
- 咨詢內容:
請教:1,本次開倉以來的最大盈利值回撤X%止盈,
2,開倉后虧損所用保證金y%止損。
求以上兩種編程的編寫。謝謝!
- 金字塔客服:
加一個條件。止損以后不開同方向的單
- 用戶回復:
保證金不能用在圖表,止損條件沒
//止盈
hh:hhv(h,enterbars);
ll:llv(l,ENTERBARS);
if hh-h>=0.01*(hh-ENTERPRICE) THEN
sell(holding>0,holding,market);
if l-ll>=0.01*(ENTERPRICE-ll) then
sellshort(holding<0,holding,market);//止損
if 止損條件 then
[此貼子已經被作者于2014/4/30 9:55:28編輯過]
begin
sell(holding>0,holding,market);
buyshort(holding=0,1,market);
end
if 止損條件 then
begin
SELLSHORT(holding<0,holding,market);
buy(holding=0,1,market);
end - 網友回復:
以下是引用qq代人發帖在2014/4/30 9:54:48的發言:
保證金不能用在圖表,止損條件沒
//止盈
hh:hhv(h,enterbars);
ll:llv(l,ENTERBARS);
if hh-h>=0.01*(hh-ENTERPRICE) THEN
sell(holding>0,holding,market);
if l-ll>=0.01*(ENTERPRICE-ll) then
sellshort(holding<0,holding,market);//止損
if 止損條件 then
[此貼子已經被作者于2014/4/30 9:55:28編輯過]謝謝!@
begin
sell(holding>0,holding,market);
buyshort(holding=0,1,market);
end
if 止損條件 then
begin
SELLSHORT(holding<0,holding,market);
buy(holding=0,1,market);
end
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容