等级: 免费版
- 注册:
- 2021-7-10
- 曾用名:
|
楼主 |
发表于 2021-12-13 10:47
|
显示全部楼层
N:=27;
M1:=6;
M2:=3;
N0:=14;
MA31:=EMA2(CLOSE,34);
DIR34:=ABS(CLOSE-REF(CLOSE,34));
VIR34:=SUM(ABS(CLOSE-REF(CLOSE,1)),34);
ER34:=DIR34/VIR34;
CS34:=ER34*(2/3-2/(34+1))+2/(34+1);
CQ34:=CS34*CS34;
MA3:=EMA2(DMA(CLOSE,CQ34),2),COLORBLUE;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:=SMA(RSV,M1,1);
D:=SMA(K,M2,1);
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2,COLORSTICK;
LC := REF(CLOSE,1);
RSI:=SMA(MAX(CLOSE-LC,0),N0,1)/SMA(ABS(CLOSE-LC),N0,1)*100;
VAR31:=C>MA3&&K>50&&RSI>50;
VAR32:=C<MA3&&K<50&&RSI<50;
VAR33:=BARSLAST(VAR31);
VAR34:=BARSLAST(VAR32);
VAR35:=SUM(VAR31,VAR34+1)=1 AND VAR31;
VAR36:=SUM(VAR32,VAR33+1)=1 AND VAR32;
AA:=BARSLAST(VAR35)<BARSLAST(VAR36),NODRAW;
BB:=BARSLAST(VAR35)>BARSLAST(VAR36),NODRAW;
CS3:=CROSS(AA,0.5);
CS4:=CROSS(BB,0.5);
DRAWICON(CROSS(AA,0.5),K*1.2,'ICO140');
DRAWICON(CROSS(BB,0.5),K*1.2,'ICO141');
A:(K+RSI)/2;
这是我完整代码,我想达到的目的是,CS3发出向上红色箭头,然后开始往前寻找最近一个最高价上穿均线(MA31)的位置,然后把这根K线的最低价赋值ZS.均线MA3参与CS3和CS4的计算,MA31不参与。CS4发出向下蓝色箭头,然后开始往前寻找最近一个最低价上穿均线(MA31)的位置,然后把这根K线的最低价赋值ZS1.谢谢 |
|