TREND CONTINUATION FACTOR

TREND CONTINUATION FACTOR

Type : Indicator, Name : Trend Continuation Factor

input: Length(35);
input: AveLength(35);

var:
plus_change(0),
minus_change(0),
plus_cf(0),
minus_cf(0),
plus_tcf(0),
minus_tcf(0);

plus_change = close — close[1];
if plus_change < 0 then plus_change = 0;

minus_change = close[1] — close;
if minus_change < 0 then minus_change = 0;

if plus_change <> 0 then
plus_cf = plus_change + plus_cf[1]
else
plus_cf = 0;

if minus_change <> 0 then
minus_cf = minus_change + minus_cf[1]
else
minus_cf = 0;

plus_tcf = Summation(plus_change, Length) — Summation(minus_cf, Length);
minus_tcf = Summation(minus_change, Length) — Summation(plus_cf, Length);

{oryginal:
plot1(0, «0»);
plot2(plus_tcf, «+ TCF»);
plot3(minus_tcf, «- TCF»);

plot4(WAverage(plus_tcf, AveLength), «+ Ave TCF»);
plot5(WAverage(minus_tcf, AveLength), «- Ave TCF»);
}

plot1(plus_tcf, «+ TCF»);
plot2(minus_tcf, «- TCF»);

plot3(WAverage(plus_tcf, AveLength), «+ Ave TCF»);
plot4(WAverage(minus_tcf, AveLength), «- Ave TCF»);

Подписаться
Уведомить о
0 комментариев
Межтекстовые Отзывы
Посмотреть все комментарии