幫忙編寫下 謝謝 [金字塔]
- 咨詢內容:
固定止損:7個跳動點,移動止盈:盈利20個跳動點后,如果盈利回撤20%就執行止盈,
- 金字塔客服:
寫了一個大概的框架,需要把對應的下單條件,下單平倉語句填寫進去就行
下單條件:=;
variable:n=0;
if 下單條件 and holding=0 then begin
下單語句;
n:=h;
end
if h>n then n:=h;
if holding>0 and enterprice-c>7*mindiff then 平倉語句;
if n-enterprice>20*mindiff and (n-h)/n<=0.2 then 平倉語句;
[此貼子已經被作者于2013/9/29 10:10:50編輯過] - 用戶回復:
弄不懂。。開多條件:A1
and holding=0 and time<144500 and time>91800;//開多條件平空條件:A1 and holding<0 ;//平空條件開空條件:=A2 and holding=0 and time<144500 and time>91800;//開空條件平多條件:=A2 and holding>0 ;//平多條件
幫忙完整編下 謝謝
- 網友回復:
開多條件:A1 and holding=0 and time<144500 and time>91800;//開多條件
平空條件:A1 and holding<0 ;//平空條件
開空條件:=A2 and holding=0 and time<144500 and time>91800;//開空條件
平多條件:=A2 and holding>0 ;//平多條件
variable:n=0;
if 開多條件 and holding=0 then begin
buy(1,1,market);
n:=h;
end
if h>n then n:=h;
if holding>0 and enterprice-c>7*mindiff then sell(1,0,market);//固定止損多
if n-enterprice>20*mindiff and (n-enterprice)/enterprice<=0.2 then sell(1,0,market);//移動止盈多
if 平多條件 then sell(holding>0,0,market);
if 開空條件 and holding=0 then begin
buyshort(1,1,market);
n:=l;
end
if l<n then n:=l;
if holding<0 and enterprice-c>7*mindiff then sell(1,0,market);//固定止損空
if enterprice-n>20*mindiff and (enterprice-n)/n<=0.2 then sell(1,0,market);//移動止盈空
if 平空條件 and holding<0 then sellshort(1,0,market);
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容