我想寫(xiě)一個(gè)程序,讓它在平倉(cāng)過(guò)后立刻開(kāi)倉(cāng),但是怎么寫(xiě)都不對(duì),請(qǐng)問(wèn)是怎么一回事啊?
M1:=STKINDI( '', '新日內(nèi)模塊1.nn',0 ,2 ,0 );
M2:=STKINDI( '', '新日內(nèi)模塊2.nn',0 ,3 ,0 );
TAM:=STKINDI('','時(shí)間限制.TT',0,1,0);
xx:=0;
yy:=ref(xx,1);
if ((m1=1 and m2=1 and holding=0) or xx=2) then
BUY(1,10%,THISCLOSE);//開(kāi)多
else
if ((m1=0 and m2=0 and holding=0) or xx=1) then
BUYSHORT(1,10% ,THISCLOSE);//開(kāi)空
else then begin
if(M1=0 and HOLDING>0) then begin
SELL(M1=0 and HOLDING>0, HOLDING,THISCLOSE);//平多
xx:=1;
end;
if(m1=1 and holding<0) then begin
SELLSHORT(m1=1 and holding<0 ,HOLDING,THISCLOSE );//平空
xx:=2;
end;
end;
反手系統(tǒng)要這樣寫(xiě)
if 平空開(kāi)多條件 then begin
sellshort;
buy;
end
if 平多開(kāi)空條件 then begin
sell;
buyshort;
end