PINE LIBRARY
supertrend

Library "supertrend"
supertrend : Library dedicated to different variations of supertrend
supertrend_atr(length, multiplier, atrMaType, source, highSource, lowSource, waitForClose, delayed)
supertrend_atr: Simple supertrend based on atr but also takes into consideration of custom MA Type, sources
Parameters:
length (simple int): : ATR Length
multiplier (simple float): : ATR Multiplier
atrMaType (simple string): : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
source (float): : Default is close. Can Chose custom source
highSource (float): : Default is high. Can also use close price for both high and low source
lowSource (float): : Default is low. Can also use close price for both high and low source
waitForClose (simple bool): : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
delayed (simple bool): : if set to true lags supertrend atr stop based on target levels.
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
supertrend_bands(bandType, maType, length, multiplier, source, highSource, lowSource, waitForClose, useTrueRange, useAlternateSource, alternateSource, sticky)
supertrend_bands: Simple supertrend based on atr but also takes into consideration of custom MA Type, sources
Parameters:
bandType (simple string): : Type of band used - can be bb, kc or dc
maType (simple string): : Moving Average type for Bands. This can be sma, ema, hma, rma, wma, vwma, swma
length (simple int): : Band Length
multiplier (float): : Std deviation or ATR multiplier for Bollinger Bands and Keltner Channel
source (float): : Default is close. Can Chose custom source
highSource (float): : Default is high. Can also use close price for both high and low source
lowSource (float): : Default is low. Can also use close price for both high and low source
waitForClose (simple bool): : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
useTrueRange (simple bool): : Used for Keltner channel. If set to false, then high-low is used as range instead of true range
useAlternateSource (simple bool): - Custom source is used for Donchian Chanbel only if useAlternateSource is set to true
alternateSource (float): - Custom source for Donchian channel
sticky (simple bool): : if set to true borders change only when price is beyond borders.
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
supertrend_zigzag(length, history, useAlternativeSource, alternativeSource, source, highSource, lowSource, waitForClose, atrlength, multiplier, atrMaType)
supertrend_zigzag: Zigzag pivot based supertrend
Parameters:
length (simple int): : Zigzag Length
history (simple int): : number of historical pivots to consider
useAlternativeSource (simple bool)
alternativeSource (float)
source (float): : Default is close. Can Chose custom source
highSource (float): : Default is high. Can also use close price for both high and low source
lowSource (float): : Default is low. Can also use close price for both high and low source
waitForClose (simple bool): : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
atrlength (simple int): : ATR Length
multiplier (simple float): : ATR Multiplier
atrMaType (simple string): : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
zupertrend(length, history, useAlternativeSource, alternativeSource, source, highSource, lowSource, waitForClose, atrlength, multiplier, atrMaType)
zupertrend: Zigzag pivot based supertrend
Parameters:
length (simple int): : Zigzag Length
history (simple int): : number of historical pivots to consider
useAlternativeSource (simple bool)
alternativeSource (float)
source (float): : Default is close. Can Chose custom source
highSource (float): : Default is high. Can also use close price for both high and low source
lowSource (float): : Default is low. Can also use close price for both high and low source
waitForClose (simple bool): : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
atrlength (simple int): : ATR Length
multiplier (simple float): : ATR Multiplier
atrMaType (simple string): : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
zsupertrend(zigzagpivots, history, source, highSource, lowSource, waitForClose, atrMaType, atrlength, multiplier)
zsupertrend: Same as zigzag supertrend. But, works on already calculated array rather than Calculating fresh zigzag
Parameters:
zigzagpivots (array<float>): : Precalculated zigzag pivots
history (simple int): : number of historical pivots to consider
source (float): : Default is close. Can Chose custom source
highSource (float): : Default is high. Can also use close price for both high and low source
lowSource (float): : Default is low. Can also use close price for both high and low source
waitForClose (simple bool): : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
atrMaType (simple string): : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
atrlength (simple int): : ATR Length
multiplier (simple float): : ATR Multiplier
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
supertrend : Library dedicated to different variations of supertrend
supertrend_atr(length, multiplier, atrMaType, source, highSource, lowSource, waitForClose, delayed)
supertrend_atr: Simple supertrend based on atr but also takes into consideration of custom MA Type, sources
Parameters:
length (simple int): : ATR Length
multiplier (simple float): : ATR Multiplier
atrMaType (simple string): : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
source (float): : Default is close. Can Chose custom source
highSource (float): : Default is high. Can also use close price for both high and low source
lowSource (float): : Default is low. Can also use close price for both high and low source
waitForClose (simple bool): : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
delayed (simple bool): : if set to true lags supertrend atr stop based on target levels.
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
supertrend_bands(bandType, maType, length, multiplier, source, highSource, lowSource, waitForClose, useTrueRange, useAlternateSource, alternateSource, sticky)
supertrend_bands: Simple supertrend based on atr but also takes into consideration of custom MA Type, sources
Parameters:
bandType (simple string): : Type of band used - can be bb, kc or dc
maType (simple string): : Moving Average type for Bands. This can be sma, ema, hma, rma, wma, vwma, swma
length (simple int): : Band Length
multiplier (float): : Std deviation or ATR multiplier for Bollinger Bands and Keltner Channel
source (float): : Default is close. Can Chose custom source
highSource (float): : Default is high. Can also use close price for both high and low source
lowSource (float): : Default is low. Can also use close price for both high and low source
waitForClose (simple bool): : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
useTrueRange (simple bool): : Used for Keltner channel. If set to false, then high-low is used as range instead of true range
useAlternateSource (simple bool): - Custom source is used for Donchian Chanbel only if useAlternateSource is set to true
alternateSource (float): - Custom source for Donchian channel
sticky (simple bool): : if set to true borders change only when price is beyond borders.
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
supertrend_zigzag(length, history, useAlternativeSource, alternativeSource, source, highSource, lowSource, waitForClose, atrlength, multiplier, atrMaType)
supertrend_zigzag: Zigzag pivot based supertrend
Parameters:
length (simple int): : Zigzag Length
history (simple int): : number of historical pivots to consider
useAlternativeSource (simple bool)
alternativeSource (float)
source (float): : Default is close. Can Chose custom source
highSource (float): : Default is high. Can also use close price for both high and low source
lowSource (float): : Default is low. Can also use close price for both high and low source
waitForClose (simple bool): : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
atrlength (simple int): : ATR Length
multiplier (simple float): : ATR Multiplier
atrMaType (simple string): : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
zupertrend(length, history, useAlternativeSource, alternativeSource, source, highSource, lowSource, waitForClose, atrlength, multiplier, atrMaType)
zupertrend: Zigzag pivot based supertrend
Parameters:
length (simple int): : Zigzag Length
history (simple int): : number of historical pivots to consider
useAlternativeSource (simple bool)
alternativeSource (float)
source (float): : Default is close. Can Chose custom source
highSource (float): : Default is high. Can also use close price for both high and low source
lowSource (float): : Default is low. Can also use close price for both high and low source
waitForClose (simple bool): : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
atrlength (simple int): : ATR Length
multiplier (simple float): : ATR Multiplier
atrMaType (simple string): : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
zsupertrend(zigzagpivots, history, source, highSource, lowSource, waitForClose, atrMaType, atrlength, multiplier)
zsupertrend: Same as zigzag supertrend. But, works on already calculated array rather than Calculating fresh zigzag
Parameters:
zigzagpivots (array<float>): : Precalculated zigzag pivots
history (simple int): : number of historical pivots to consider
source (float): : Default is close. Can Chose custom source
highSource (float): : Default is high. Can also use close price for both high and low source
lowSource (float): : Default is low. Can also use close price for both high and low source
waitForClose (simple bool): : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
atrMaType (simple string): : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
atrlength (simple int): : ATR Length
multiplier (simple float): : ATR Multiplier
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
Trial - trendoscope.io/trial
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
Trial - trendoscope.io/trial
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.