此主题相关图片如下:截图12.gif
此主题相关图片如下:截图13.gif
源码;
input:STOP1(35,10,100,5);
时间:=BARSLAST(DATE<>REF(DATE,1) )+1;
K:=VALUEWHEN(TIME<=092800,HHV(HIGH,时间));
D:=VALUEWHEN(TIME<=092800,LLV(LOW,时间));
交易时间:=TIME>091500 AND TIME<151500;
开多:=CLOSE>K AND 交易时间;
平空:=TIME=151500;
开空:=CLOSE<D AND 交易时间 ;
平多:=TIME=151500;
SELLSHORT(平空 and HOLDING<0,HOLDING,market);
BUY(开多 and HOLDING=0,1,market);
SELL(平多 and HOLDING>0,HOLDING,market);
BUYSHORT(开空 and HOLDING=0,1,market);
多止损:=HOLDING>0 AND L<ENTERPRICE-STOP1;
空止损:=HOLDING<0 AND H>ENTERPRICE+STOP1;
止多:SELL(HOLDING>0 AND 多止损,0,LIMITR,TRIMPRICE(ENTERPRICE-STOP1)),ORDERQUEUE;
空止:SELLSHORT(HOLDING<0 AND 空止损 ,0,LIMITR,TRIMPRICE(ENTERPRICE+STOP1)),ORDERQUEUE;