如果是走完k線下單模式那么就這樣寫
if c>o then buy......;
if holding>0 and close<enterprice then begin
sell........;
buyshort......;
end
if c<o then buyshort.......;
if holding<0 and close>enterprice then begin
sellshort.........;
buy......;
end
如果是固定時(shí)間間隔模式那么就這樣寫
if h>o then buy......;
if holding>0 and l<enterprice then begin
sell........;
buyshort......;
end
if l<o then buyshort.......;
if holding<0 and h>enterprice then begin
sellshort.........;
buy......;
end
說(shuō)明
交易系統(tǒng)之開多操作
語(yǔ)法
BUY(COND,V,Type,P);表示當(dāng)COND條件成立時(shí),
買入V股(手)當(dāng)前品種,TYPE表示買入類型,
P表示買入價(jià)格,所有參數(shù)均可以省略。
V:買入股(手)數(shù)或買入資金百分比(N%),若為0或者省略表示100%;
TYPE:可以是本周期收盤(THISCLOSE),市價(jià)(MARKET),
限價(jià)單(LIMIT),停損單(STOP)等交易方式控制符;
P:對(duì)于限價(jià)單、停損單需要指定的買入價(jià)格
參數(shù)
備注
該函數(shù)僅在逐K線計(jì)算模式下有效
示例
BUY(C>O ,1000,THISCLOSE);表示收陽(yáng)線則在本周期收盤價(jià)上買入1000股(手)。
BUY(C>0,50%,LIMIT,CLOSE-0.2);表示在指定限價(jià)CLOSE-0.2元位置下買入限價(jià)單,
若價(jià)格達(dá)到或低于該價(jià)格則用50%資金買入。
所屬函數(shù)組
交易系統(tǒng)