(威龙金股)送黄金分割公式)
昨天答应大家提供黄金分割自动分析指标,上图就是该公式的实际效果图。该指标可自动分析波段高低点,并提示回吐百分比,但由于数据分析量较大,请大家只在盘后分析中使用。
【动态黄金分割公式代码】
注:该公式含未来函数,但不影响分析使用,可在任何操作系统上使用,直接拷贝黏贴就可以了。
VAR1:=MA(C,13);
VAR2:=MA(C,21);
收盘价:CLOSE,coloryellow;
ml:VAR1,colorred;
VAR3:=ZIG(3,26);
VAR4:=MA(VAR3,2);
VAR5:=IF(HHV(HIGH,1597)<=HHV(HIGH,610),HHV(HIGH,610),HHV(HIGH,1597));
VAR6:=IF(LLV(LOW,1597)>=LLV(LOW,610),LLV(LOW,610),LLV(LOW,1597));
VAR7:=VAR5-VAR6;
VAR8:=BARSLAST(HHV(HIGH,610));
VAR9:=BARSLAST(LLV(LOW,610));
VAR10:=IF (VAR8>VAR9,0,1);
VAR11:=CROSS(VAR3,VAR4) OR CROSS(VAR4,VAR3);
p191:VAR6+VAR7*0.191;
p236:VAR6+VAR7*0.236;
p382:VAR6+VAR7*0.382;
p500:VAR6+VAR7*0.5;
p618:VAR6+VAR7*0.618;
p764:VAR6+VAR7*0.764;
DRAWTEXT(VAR11,p191,IF(VAR10<1,'↑19.1%-'+p191,'↓80.9%-'+p191)),Coloreeeeff;
DRAWTEXT(VAR11,p236,IF(VAR10<1,'↑23.6%-'+p236,'↓76.4%-'+p236)),Coloreeeeff;
DRAWTEXT(VAR11,p382,IF(VAR10<1,'↑38.2%-'+p382,'↓61.8%-'+p382)),Coloreeeeff;
DRAWTEXT(VAR11,p500,IF(VAR10<1,'↑50.0%-'+p500,'↓50.0%-'+p500)),Coloreeeeff;
DRAWTEXT(VAR11,p618,IF(VAR10<1,'↑61.8%-'+p618,'↓38.2%-'+p618)),Coloreeeeff;
DRAWTEXT(VAR11,p764,IF(VAR10<1,'↑76.4%-'+p764,'↓23.6%-'+p764)),Coloreeeeff;
DRAWTEXT(VAR11,VAR5,VAR5),Coloreeeeff;
DRAWTEXT(VAR11,VAR6,VAR6),Coloreeeeff;
【关于公式的解决办法】
由于部分系统不支持未来函数,所以可将以下红色部分代码去除就能使用,不过没那么好看了。
VAR3:=ZIG(3,26);
VAR4:=MA(VAR3,2);
VAR5:=IF(HHV(HIGH,1597)<=HHV(HIGH,610),HHV(HIGH,610),HHV(HIGH,1597));
VAR6:=IF(LLV(LOW,1597)>=LLV(LOW,610),LLV(LOW,610),LLV(LOW,1597));
VAR7:=VAR5-VAR6;
VAR8:=BARSLAST(HHV(HIGH,610));
VAR9:=BARSLAST(LLV(LOW,610));
VAR10:=IF (VAR8>VAR9,0,1);
VAR11:=CROSS(VAR3,VAR4) OR CROSS(VAR4,VAR3);
p191:VAR6+VAR7*0.191;
p236:VAR6+VAR7*0.236;
p382:VAR6+VAR7*0.382;
p500:VAR6+VAR7*0.5;
p618:VAR6+VAR7*0.618;
p764:VAR6+VAR7*0.764;
DRAWTEXT(VAR11,p191,IF(VAR10<1,'↑19.1%-'+p191,'↓80.9%-'+p191)),Coloreeeeff;
DRAWTEXT(VAR11,p236,IF(VAR10<1,'↑23.6%-'+p236,'↓76.4%-'+p236)),Coloreeeeff;
DRAWTEXT(VAR11,p382,IF(VAR10<1,'↑38.2%-'+p382,'↓61.8%-'+p382)),Coloreeeeff;
DRAWTEXT(VAR11,p500,IF(VAR10<1,'↑50.0%-'+p500,'↓50.0%-'+p500)),Coloreeeeff;
DRAWTEXT(VAR11,p618,IF(VAR10<1,'↑61.8%-'+p618,'↓38.2%-'+p618)),Coloreeeeff;
DRAWTEXT(VAR11,p764,IF(VAR10<1,'↑76.4%-'+p764,'↓23.6%-'+p764)),Coloreeeeff;
DRAWTEXT(VAR11,VAR5,VAR5),Coloreeeeff;
DRAWTEXT(VAR11,VAR6,VAR6),Coloreeeeff;
而大智慧等对“收盘价”列为关键词,可将“收盘价”改成“SP1”或者任何代号来解决。
还有威龙波浪线等指标请在威龙博客里查找:威龙金股