相对活力指标函数源码及指标公式介绍
计算函数:TSMRelativeVigor
inputs: length(numericsimple);vars: num(0), denom(0), count(0), RVI(0), trigger(0), v1(0), v2(0);v1 = ((close - open) + 2*(close[1] - open[1]) + 2*(close[2] - open[2])+ (close[3] - open[2])) / 6;v2 = ((high - low) + 2*(high[1] - low[1]) + 2*(high[2] - low[2])+ (high[3] - low[3])) / 6;num = 0;denom = 0;for count = 0 to length - 1 beginnum = num + v1[count];denom = denom + v2[count];end;if denom <> 0 then RVI = num / denom;trigger = RVI[1];TSMRelativeVigor = RVI;
指标公式:RelativeVigor
inputs: length(10);vars: RVI(0);RVI = TSMRelativeVigor(length);plot1(RVI,"RVI");plot2(RVI[1],"trigger");
运行效果:

设计策略方向:
可以做金死叉方向。







夜雨聆风