Bjorgum Reversal

Bjorgum · study · 74 行 · 点赞 6,624 · TradingView 原页

本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。

Pine Script

//Template from TKP Trader modified for barcolor changes on price cross and T3 cross buy/sell indicators 
study(title="TKP T3 Trend With Psar", shorttitle="TKP T3", overlay=true)
start = input(.043, minval=.000, maxval=.099, title="Start - Default = 2 - Multiplied by .001")
increment = input(.043, minval=.000, maxval=.099, title="Step Setting (Sensitivity) - Default = 2 - Multiplied by .001" )
maximum = input(.34, minval=.00, maxval=.99, title="Maximum Step (Sensitivity) - Default = 2 - Multiplied by .01")
sus = input(true, "Show Up Trending Parabolic Sar")
sds = input(true, "Show Down Trending Parabolic Sar")
//"------Step Setting Definition------"
//"A higher step moves SAR closer to the price action, which makes a reversal more likely."
//"The indicator will reverse too often if the step is set too high."
 
//"------Maximum Step Definition-----")
//"The sensitivity of the indicator can also be adjusted using the Maximum Step."
//"While the Maximum Step can influence sensitivity, the Step carries more weight"
//"because it sets the incremental rate-of-increase as the trend develops"
 
startCalc = start
incrementCalc = increment 
maximumCalc = maximum 
 
sarUp = sar(startCalc, incrementCalc, maximumCalc)
sarDown = sar(startCalc, incrementCalc, maximumCalc)
 
colUp = close >= sarDown ? #000000 : na
colDown = close <= sarUp ? #ffffff : na
 
plot(sus and sarUp ? sarUp : na, title="Up Trending SAR", style=circles, linewidth=1,color=colUp)
plot(sds and sarDown ? sarDown : na, title="Up Trending SAR", style=circles, linewidth=1,color=colDown)
 
///T3 MA5
 
aLength = input(5, minval=1)
AxPrice = close
axe1 = ema(AxPrice, aLength)
axe2 = ema(axe1, aLength)
axe3 = ema(axe2, aLength)
axe4 = ema(axe3, aLength)
axe5 = ema(axe4, aLength)
axe6 = ema(axe5, aLength)
ab = 0.7
ac1 = -ab*ab*ab
ac2 = 3*ab*ab+3*ab*ab*ab
ac3 = -6*ab*ab-3*ab-3*ab*ab*ab
ac4 = 1+3*ab+ab*ab*ab+3*ab*ab
anT3Average = ac1 * axe6 + ac2 * axe5 + ac3 * axe4 + ac4 * axe3
plot(anT3Average, color=#000000, title="T3")
 
///T3 MA8
 
Length = input(8, minval=1)
xPrice = close
xe1 = ema(xPrice, Length)
xe2 = ema(xe1, Length)
xe3 = ema(xe2, Length)
xe4 = ema(xe3, Length)
xe5 = ema(xe4, Length)
xe6 = ema(xe5, Length)
b = 0.7
c1 = -b*b*b
c2 = 3*b*b+3*b*b*b
c3 = -6*b*b-3*b-3*b*b*b
c4 = 1+3*b+b*b*b+3*b*b
nT3Average = c1 * xe6 + c2 * xe5 + c3 * xe4 + c4 * xe3
plot(nT3Average, color=#ffffff, title="T3")
 
 
///barcolor
 
uc = (close > nT3Average) and (anT3Average >= nT3Average)
dc = (close < nT3Average) and (anT3Average <= nT3Average)
 
barColor = uc ? #000000 :
    dc ? #ffeb3b : #ffffff
barcolor(color=barColor)

← 返回列表