等级: 标准版
- 注册:
- 2021-7-23
- 曾用名:
|
这个代码是向下突破关键点位后,回抽关键点位之上就买入。
其他的价位都会出现买入信号,只有686和685这两个价位没有买入信号。这是怎么回事?
685
686
684
685.5
686.5
以下是代码,信号执行是走完一根K线。
//金字塔加仓每天最多循环十次
价格,COLORYELLOW;
ABB:=(time0-timetot0(dynainfo(207))<=3) or not(islastbar);
DT1:=DATE<=1000000+D1 AND TIME<=T1;
DT2:=DATE>=1000000+D1 AND TIME>=T1;
TT1:=BARSLAST(DT1);
VAR1:=CROSS(C,价格) AND REF(L,1)<价格;
VAR2:=CROSS(价格-N1*MINDIFF,L);
VAR3:=CROSS(H,价格+N2*MINDIFF);
TT2:=IF(BARSLAST(VAR3)>=0,BARSLAST(VAR3),TT1);
TT3:=MIN(TT1,TT2);
VAR4:=COUNT(VAR1 AND REF(HOLDING,1)=0,TT3+1);
VAR5:=IF(VAR4=0,1,IF(VAR4=1,1,IF(VAR4=2,2,IF(VAR4=3,4,IF(VAR4=4,8,IF(VAR4=5,16,IF(VAR4=6,32,IF(VAR4=7,64,IF(VAR4=8,128,IF(VAR4=9,256,IF(VAR4=10,512,1024)))))))))));
VAR6:=H>价格+N1*MINDIFF;
IF HOLDING>0 AND (VAR2 OR VAR3) THEN BEGIN
SELL(1,HOLDING,MARKETR);
END
IF HOLDING=SS*VAR5 AND VAR6 AND VAR4>=2 THEN BEGIN
SELL(1,HOLDING/2,MARKETR);
END
IF HOLDING=0 AND VAR1 AND ABB AND DT2 THEN BEGIN
BUY(1,SS*VAR5,MARKETR);
END
|
|