如何避免指标返回值过大或是过小导致的K线被压缩?
[p=30, 2, left][color=#1e5096][b]如何避免指标返回值过大或是过小导致的K线被压缩? [/b][/color]答:利用定义变量函数“:=”。[/p][p=30, 2, left]例:布林通道+均线指标,优于TMP2值过小,导致指标图形被压缩,如下图
MID:MA(CLOSE,26);
TMP2:STD(CLOSE,26);
TOP:MID+2*TMP2;
BOTTOM:MID-2*TMP2;
MA1:MA(CLOSE,5),LINETHICK1;
MA2:MA(CLOSE,20),LINETHICK1;
[/p][p=30, 2, center][attach]2980[/attach][/p][p=30, 2, left]修改指标后,可以正常显示,如下图:
MID:MA(CLOSE,26);
[b]TMP2:=STD(CLOSE,26);[/b]
TOP:MID+2*TMP2;
BOTTOM:MID-2*TMP2;
MA1:MA(CLOSE,5),LINETHICK1;
MA2:MA(CLOSE,20),LINETHICK1;
[/p][p=30, 2, center][attach]2981[/attach][/p]
页:
[1]