Chandelier Exit

KivancOzbilgic · study · 25 行 · 点赞 1,078 · TradingView 原页

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

Pine Script

//@version=2
//creator: Charles Le Beau 
//author:KIVANÇ @fr3762 on twitter
study("Chandelier Exit", overlay = true)
 
 
length=input(22, minval=1,maxval = 100)
AtrPeriods=input(22, minval=1,maxval = 100)
Mult=input(3, minval=1,maxval = 100)
 
 
LB=highest(high,length)-(Mult*atr(AtrPeriods))
UB=lowest(low,length)+(Mult*atr(AtrPeriods))
 
 
TrendUp=close[1]>TrendUp[1]? max(LB,TrendUp[1]) : LB
TrendDown=close[1]<TrendDown[1]? min(UB,TrendDown[1]) : UB
 
 
Trend = close > TrendDown[1] ? 1: close< TrendUp[1]? -1: nz(Trend[1],1)
ChEx = Trend==1? TrendUp: TrendDown
 
 
 
plot(ChEx, color =maroon , style = line , linewidth = 2,title = "ChEx")

← 返回列表