mdi:=stkindi(stklabel,'dmi.mdi',0,datatype);//调用指标数据
pdi:=stkindi(stklabel,'dmi.pdi',0,datatype);//调用指标数据
rsi1:=stkindi(stklabel,'rsi.rsi1',0,datatype);//调用指标数据
//DMI里PDI+MDI<40时,且RSI1<20时平平仓反手开多仓
if pdi+mdi<40 and rsi1<20 then begin
sellshort(holding<0,0,market);
buy(holding=0,1,market);
end
//DMI里PDI+MDI<40时,且RSI1>80时平多仓反手开空仓
if pdi+mdi<40 and rsi1>80 then begin
sell(holding>0,0,market);
buyshort(holding=0,1,market);
end