HPotter

Trend continuation factor, by M.H. Pee

3533 views
415
3533 0
Trend continuation factor, by M.H. Pee
The related article is copyrighted material from Stocks & Commodities .
Remove from Favorite Scripts Add to Favorite Scripts
////////////////////////////////////////////////////////////
//  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/TIP

BTC: 3FKWwtaYrf5NHZzaCi1fyAfQj7XSgtyCqe
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Charting Solutions Get Help Feature Request Blog & News FAQ Wiki Twitter
Profile Profile Settings Account and Billing TradingView Coins My Support Tickets Get Help Ideas Published Followers Following Private Messages Chat Sign Out