HPotter

Trend continuation factor, by M.H. Pee

6182 visningar
500
Trend continuation factor, by M.H. Pee
The related article is copyrighted material from Stocks & Commodities .
Skript med en öppen källkod

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Vill du använda det här skriptet i ett diagram?
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 13/11/2014
//    The related article is copyrighted material from Stocks & Commodities.
////////////////////////////////////////////////////////////
study(title="Trend continuation factor")
Length = input(35, minval=1)
hline(0, color=green, linestyle=line)
xChange = mom(close, 1)
xPlusChange = iff(xChange > 0, xChange, 0)
xMinusChange = iff(xChange < 0, (xChange * -1), 0)
xPlusCF = iff(xPlusChange == 0, 0, xPlusChange + nz(xPlusCF[1], 1))
xMinusCF = iff(xMinusChange == 0, 0, xMinusChange + nz(xMinusCF[1], 1))
xPlus = xPlusChange - xMinusCF
xMinus = xMinusChange - xPlusCF
xPlusTCF =  sum(xPlus, Length)
nMinusTCF = sum(xMinus, Length)
plot(xPlusTCF, color=blue, title="Plus TCF")
plot(nMinusTCF, color=red, title="Minus TCF")
Donate BTC: 13fXLkhWuGMXRmcvwkG2gaWKcnsiD88bwE
USDT (TRC20): TH29EEXa19vfwZNYvxdUuMxoFY5QDYLcWG