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