如下图表交易系统出现连续两次开仓信号是什么原因?
if position=0 and barpos>20 and h>l then begin
//建立多头进场条件
long:=close>=zhh and zcl>upperma and kd ;
//多头进场
if long then begin
myentryprice := if(open>zhh+0.2,open+0.6 ,zhh+0.6 ) ;
if
numseqloss<3 then begin
buy( _debug,posnum,limitr,myentryprice);
jqsh:=1;
position := 1 ;
turtleunits := 1 ;
n := avgtr ;
buyorderthisbar := 1;
end
if numseqloss>=3 and position=0 then begin
buy( _debug,2*posnum,limitr,myentryprice);
jqsh:=1;
position := 1 ;
turtleunits := 1 ;
n := avgtr ;
buyorderthisbar := 1;
end
if numseqwin<3 and position=0 then begin
buy( _debug,posnum,limitr,myentryprice);
jqsh:=1;
position := 1 ;
turtleunits := 1 ;
n := avgtr ;
buyorderthisbar := 1;
end
if numseqwin>=3 and position=0 then begin
buy( _debug,0.5*posnum,limitr,myentryprice);
jqsh:=0;
position := 1 ;
turtleunits := 1 ;
n := avgtr ;
buyorderthisbar := 1;
end
end //if
不可能同时满足两个条件:开多条件成立,累计盈利次数3次以下开仓手数为posnum; 开多条件成立,累计盈利次数3次以上开仓手数为0.5*posnum;
开多条件成立,累计亏损次数3次以下开仓手数为posnum;
开多条件成立,累计亏损次数3次以下开仓手数为2*posnum;
要满足以上条件,应如何编写?
if position=0 and barpos>20 and h>l then begin
//建立多头进场条件
long:=close>=zhh and zcl>upperma and kd ;
//多头进场
if long then begin
myentryprice := if(open>zhh+0.2,open+0.6 ,zhh+0.6 ) ;
if numseqloss<3 then begin
开多1:buy( _debug,posnum,limitr,myentryprice);
jqsh:=1;
position := 1 ;
turtleunits := 1 ;
n := avgtr ;
buyorderthisbar := 1;
end
if numseqloss>=3 and position=0 then begin
开多2:buy( _debug,2*posnum,limitr,myentryprice);
jqsh:=1;
position := 1 ;
turtleunits := 1 ;
n := avgtr ;
buyorderthisbar := 1;
end
if numseqwin<3 and position=0 then begin
开多3:buy( _debug,posnum,limitr,myentryprice);
jqsh:=1;
position := 1 ;
turtleunits := 1 ;
n := avgtr ;
buyorderthisbar := 1;
end
if numseqwin>=3 and position=0 then begin
开多4:buy( _debug,0.5*posnum,limitr,myentryprice);
jqsh:=0;
position := 1 ;
turtleunits := 1 ;
n := avgtr ;
buyorderthisbar := 1;
end
end //if
加了几个调试数据。
你看一下k线图上的信号,是开多几和开多几