待条件的转折点

02-28 19:32发布

如下UOS指标,我想做相关标注,烦请老师赐教:

1. 若UO值超过65,则在最高点做绿色标注1;
2. 若MAUO超过65,则在最高点绿色标注1;
3. 若UO值低于35,则在最低点做红色标注1;
4. 若MAUO值低于35,则在最低点做红色标注1;
5. 若UO值超过70,则在UO值超过70的点标注红色星,并在UO值(上涨后)低于70的点做绿色星标注
6. 若MAUO值超过70,则在UO值超过70的点标注红色星,并在UO值(上涨后)低于70的点做绿色星标注


TH:=MAX(H,REF(C,1));
TL:=MIN(L,REF(C,1));
ACC1:=SUM(C-TL,N1)/SUM(TH-TL,N1);
ACC2:=SUM(C-TL,N2)/SUM(TH-TL,N2);
ACC3:=SUM(C-TL,N3)/SUM(TH-TL,N3);
UO1:=(ACC1*N2*N3+ACC2*N1*N3+ACC3*N1*N2)*100/(N1*N2+N1*N3+N2*N3);


UO:UO1,COLORWHITE,LINETHICK2;
MAUO:EMA(UO,M),COLORMAGENTA;
//主命令

DRAWCOLORLINE(UO>REF(UO,1),UO,COLORRED,COLORGREEN),LINETHICK2;
//变色曲线

REFLINE:35,50,65;
//重新定义横线坐标

如下UOS指标,我想做相关标注,烦请老师赐教:
1. 若UO值超过65,则在最高点做绿色标注1;
2. 若MAUO超过65,则在最高点绿色标注1;
3. 若UO值低于35,则在最低点做红色标注1;
4. 若MAUO值低于35,则在最低点做红色标注1;
5. 若UO值超过70,则在UO值超过70的点标注红色星,并在UO值(上涨后)低于70的点做绿色星标注
6. 若MAUO值超过70,则在UO值超过70的点标注红色星,并在UO值(上涨后)低于70的点做绿色星标注


TH:=MAX(H,REF(C,1));
TL:=MIN(L,REF(C,1));
ACC1:=SUM(C-TL,N1)/SUM(TH-TL,N1);
ACC2:=SUM(C-TL,N2)/SUM(TH-TL,N2);
ACC3:=SUM(C-TL,N3)/SUM(TH-TL,N3);
UO1:=(ACC1*N2*N3+ACC2*N1*N3+ACC3*N1*N2)*100/(N1*N2+N1*N3+N2*N3);


UO:UO1,COLORWHITE,LINETHICK2;
MAUO:EMA(UO,M),COLORMAGENTA;
//主命令

DRAWCOLORLINE(UO>REF(UO,1),UO,COLORRED,COLORGREEN),LINETHICK2;
//变色曲线

REFLINE:35,50,65;
//重新定义横线坐标

付费偷看设置
发送
9条回答
文华解答
2楼-- · 02-28 20:32

参考:

TH:=MAX(H,REF(C,1));
TL:=MIN(L,REF(C,1));
ACC1:=SUM(C-TL,N1)/SUM(TH-TL,N1);
ACC2:=SUM(C-TL,N2)/SUM(TH-TL,N2);
ACC3:=SUM(C-TL,N3)/SUM(TH-TL,N3);
UO1:=(ACC1*N2*N3+ACC2*N1*N3+ACC3*N1*N2)*100/(N1*N2+N1*N3+N2*N3);

UO:UO1,COLORWHITE,LINETHICK2;
MAUO:EMA(UO,M),COLORMAGENTA;
//主命令

DRAWCOLORLINE(UO>REF(UO,1),UO,COLORRED,COLORGREEN),LINETHICK2;
//变色曲线
REFLINE:35,50,65;
//重新定义横线坐标

DRAWTEXT(UO>65,H,'1'),COLORGREEN,VALIGN2;
DRAWTEXT(MAUO>65,H,'1'),COLORGREEN,VALIGN2;
DRAWTEXT(UO<35,L,'1'),COLORRED,VALIGN0;
DRAWTEXT(MAUO<35,L,'1'),COLORRED,VALIGN0;
DRAWTEXT(UO>70,H,'★'),COLORRED,VALIGN1;
DRAWTEXT(CROSSDOWN(UO,70),H,'★'),COLORGREEN,VALIGN1;
DRAWTEXT(MAUO>70,H,'★'),COLORRED,VALIGN1;
DRAWTEXT(CROSSDOWN(MAUO,70),H,'★'),COLORGREEN,VALIGN1;

无知无畏
3楼-- · 02-28 20:52
老师,有点问题,一使用新增的代码,那么原有的曲线都被压缩到最下面了!
文华解答
4楼-- · 02-28 21:13

再看下:

TH:=MAX(H,REF(C,1));
TL:=MIN(L,REF(C,1));
ACC1:=SUM(C-TL,N1)/SUM(TH-TL,N1);
ACC2:=SUM(C-TL,N2)/SUM(TH-TL,N2);
ACC3:=SUM(C-TL,N3)/SUM(TH-TL,N3);
UO1:=(ACC1*N2*N3+ACC2*N1*N3+ACC3*N1*N2)*100/(N1*N2+N1*N3+N2*N3);

UO:=UO1,COLORWHITE,LINETHICK2;
MAUO:=EMA(UO,M),COLORMAGENTA;
//主命令

DRAWTEXT(UO>65,H,'1'),COLORGREEN,VALIGN2;
DRAWTEXT(MAUO>65,H,'1'),COLORGREEN,VALIGN2;
DRAWTEXT(UO<35,L,'1'),COLORRED,VALIGN0;
DRAWTEXT(MAUO<35,L,'1'),COLORRED,VALIGN0;
DRAWTEXT(UO>70,H,'★'),COLORRED,VALIGN1;
DRAWTEXT(CROSSDOWN(UO,70),H,'★'),COLORGREEN,VALIGN1;
DRAWTEXT(MAUO>70,H,'★'),COLORRED,VALIGN1;
DRAWTEXT(CROSSDOWN(MAUO,70),H,'★'),COLORGREEN,VALIGN1;

无知无畏
5楼-- · 02-28 21:33
第12行有问题,无法识别
文华解答
6楼-- · 02-28 21:53
复制乱码了,重新看下4楼回复
无知无畏
7楼-- · 02-28 22:12
不行,现在只剩下这些标注了,哦,老师是不是改成主图K线标注了?我想要的是,在副图上标注就可以了