if vol_1>=vol_2+vol_3+vol_4 and c_1<o_1-n6 then
begin
buySHORT(1,lots,limitr,open),IGNORECHECKPRICE;
HigherAfterEntry:=enterprice;
LowerAfterEntry:=enterprice;
end
if vol_1>=avvol*3 and c_1<o_1-n7 then
begin
buyshort(1,lots,limitr,open);
HigherAfterEntry:=enterprice;
LowerAfterEntry:=enterprice;
end
以上兩個(gè)開倉條件同時(shí)滿足軟件就開了兩次倉,而我只要求開一次
variable:n=0
if vol_1>=vol_2+vol_3+vol_4 and c_1<o_1-n6 and n=0 then
begin
buySHORT(1,lots,limitr,open),IGNORECHECKPRICE;
HigherAfterEntry:=enterprice;
LowerAfterEntry:=enterprice;
n:=1;
end
if vol_1>=avvol*3 and c_1<o_1-n7 and n=0 then
begin
buyshort(1,lots,limitr,open);
HigherAfterEntry:=enterprice;
LowerAfterEntry:=enterprice;
n:=1;
end
用全局變量來記錄下單狀態(tài),為0時(shí)能下單,只要有任意一個(gè)交易了,變?yōu)?,后面的就不能交易