可以的。
假设分别是条件a和b。那么以下:ch=0,a ch=1 b,ch=2 a和b
input:CH(0,1,2,1);
cond:if(CH=0,a,if(CH=1,b,a and b));
input:CH(0,0,1,1);//参数默认是0也就是选择条件1 ,输入1则选择条件2
KD1:C>MA(C,5)and CH=0;
KD2:C>MA(C,20) and CH;
PD1:C<MA(C,5) and CH=0;
PD2:C<MA(C,20) and CH;
if KD1 or KD2 then
begin
sellshort(holding<0,holding,market);
buy(holding=0,1,market);
end
if PD1 or PD2 then
begin
sell(holding>0,holding,market);
buyshort(holding=0,1,market);
end
持仓:holding;