我想寫一個(gè)程序,讓它在平倉(cāng)過后立刻開倉(cāng),但是怎么寫都不對(duì),請(qǐng)問是怎么一回事啊?
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);//開多
else
if ((m1=0 and m2=0 and holding=0) or xx=1) then
BUYSHORT(1,10% ,THISCLOSE);//開空
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)要這樣寫
if 平空開多條件 then begin
sellshort;
buy;
end
if 平多開空條件 then begin
sell;
buyshort;
end