if 某条件 then begin
sellshort(holding<0,holding,market);
buy(hlding=0,1,market);
end
老师,我测试了,还不行啊。把意思再阐述一下:
原有开多条件为B,开空条件为C。当符合条件C开空后,若出现条件E,则平空且开多。就是说,唯有在C成立后,且出现E才反手。请老师指导
上面的编制,是不出现C时,符合E就开仓了,不要这样的。
VARIABLE:n=0;
if c then n:=1;
if e and n=1 and holding<0 then begin
sellshort()
buy()
end
后面n还需要重新赋值为0,根据自己的需求重新赋值
|
VARIABLE:n=0;
if c then n:=1;
if e and n=1 and holding<0 then begin
sellshort()
buy()
end
老师:
中间那几行后面都不要分号吗?
sellshort(),buy(),这两个括号里面写什么?