等级: 免费版
- 注册:
- 2022-9-2
- 曾用名:
|
但是前一根K线都平仓了,第二根K线开仓的时候不出现信号,自动同步就按照前面的开仓信号进行补仓,经常出现 不符合要求的开仓,甚至反向开仓,
//建立多头条件
long1:= h>h1 and ma5>ma20 and H>c1+1*MINDIFF;
if long1 then
BEGIN
SELLSHORT(HOLDING<0 ,holding,MARKET);
buy(HOLDING=0,1,MARKET);
end
//建立止损条件
abb:timetot0(time)-timetot0(dynainfo(207)),NODRAW;
if (abb<5 and abb>0) or not(ISLASTBAR) then
BEGIN sell(1,HOLDING, MARKET);
end
//建立空头条件
short1:= ma5<ma20 and l<l1 and L<c1-1*MINDIFF;
if SHORT1 THEN
BEGIN
sell(HOLDING>0 ,holding,MARKET);
buySHORT(HOLDING=0,1,MARKET);
end
//建立空头止损条件
abb2:timetot0(time)-timetot0(dynainfo(207)),NODRAW;
if (abb2<5 and abb2>0) or not(ISLASTBAR) then
BEGIN sellshort(1,holding, MARKET);
END
|
|