PINE LIBRARY
Mis à jour supertrend

Here is an extensive library on different variations of 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:
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:
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
supertrend_zigzag(length, history, useAlternateSource, alternateSource, source, highSource, lowSource, waitForClose, atrlength, multiplier, atrMaType) supertrend_zigzag: Zigzag pivot based supertrend
Parameters:
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
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: : ATR Length
- multiplier: : ATR Multiplier
- atrMaType: : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
- source: : Default is close. Can Chose custom source
- highSource: : Default is high. Can also use close price for both high and low source
- lowSource: : Default is low. Can also use close price for both high and low source
- waitForClose: : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
- delayed: : 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: : Type of band used - can be bb, kc or dc
- maType: : Moving Average type for Bands. This can be sma, ema, hma, rma, wma, vwma, swma
- length: : Band Length
- multiplier: : Std deviation or ATR multiplier for Bollinger Bands and Keltner Channel
- source: : Default is close. Can Chose custom source
- highSource: : Default is high. Can also use close price for both high and low source
- lowSource: : Default is low. Can also use close price for both high and low source
- waitForClose: : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
- useTrueRange: : Used for Keltner channel. If set to false, then high-low is used as range instead of true range
- useAlternateSource: - Custom source is used for Donchian Chanbel only if useAlternateSource is set to true
- alternateSource: - Custom source for Donchian channel
- sticky: : 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, useAlternateSource, alternateSource, source, highSource, lowSource, waitForClose, atrlength, multiplier, atrMaType) supertrend_zigzag: Zigzag pivot based supertrend
Parameters:
- length: : Zigzag Length
- history: : number of historical pivots to consider
- useAlternateSource: - Custom source is used for Zigzag only if useAlternateSource is set to true
- alternateSource: - Custom source for Zigzag
- source: : Default is close. Can Chose custom source
- highSource: : Default is high. Can also use close price for both high and low source
- lowSource: : Default is low. Can also use close price for both high and low source
- waitForClose: : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
- atrlength: : ATR Length
- multiplier: : ATR Multiplier
- atrMaType: : 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
Notes de version
Add signature ;)Notes de version
Added new method zsupertrend - which is same as supertrend_zigzag. But, instead of calculating zigzag freshly, this method takes precalculated zigzag array as input.zsupertrend(zigzagpivots, history, source, highSource, lowSource, waitForClose, atrlength, multiplier, atrMaType) zsupertrend: Same as zigzag supertrend. But, works on already calculated array rather than Calculating fresh zigzag
Parameters:
zigzagpivots: : Precalculated zigzag pivots
history: : number of historical pivots to consider
source: : Default is close. Can Chose custom source
highSource: : Default is high. Can also use close price for both high and low source
lowSource: : Default is low. Can also use close price for both high and low source
waitForClose: : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
atrlength: : ATR Length
multiplier: : ATR Multiplier
atrMaType: : 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
Notes de version
Added multiband supertrendmsupertrend(bandType, source, maType, length, useTrueRange, highSource, lowSource, waitForClose, numberOfBands, multiplierStart, multiplierStep, trailingDistance, trailStates) msupertrend : Dynamic trailing supertrend based on multiple bands - either bollinger bands or keltener channel
Parameters:
bandType: : Band type - can be either bb or kc
source: : custom source if required
maType: : Moving Average Type : Can be sma, ema, hma, rma, wma, vwma, swma, highlow, linreg, median
length: : Oscillator length - not used for TSI
useTrueRange: : if set to false, uses high-low.
highSource: : Default is high. Can also use close price for both high and low source
lowSource: : Default is low. Can also use close price for both high and low source
waitForClose: : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
numberOfBands: : Number of bands to generate
multiplierStart: : Starting ATR or Standard deviation multiplier for first band
multiplierStep: : Incremental value for multiplier for each band
trailingDistance: : Number of band states to trail for trailing stop.
trailStates: : If selected trails the band states along with trailing price. If unselected only price is trailed.
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
Notes de version
v5Updated dependent libraries
Notes de version
v6Added:
zupertrend(length, history, useAlternateSource, alternateSource, source, highSource, lowSource, waitForClose, atrlength, multiplier, atrMaType) zupertrend: Zigzag pivot based supertrend
Parameters:
length: : Zigzag Length
history: : number of historical pivots to consider
useAlternateSource: - Custom source is used for Zigzag only if useAlternateSource is set to true
alternateSource: - Custom source for Zigzag
source: : Default is close. Can Chose custom source
highSource: : Default is high. Can also use close price for both high and low source
lowSource: : Default is low. Can also use close price for both high and low source
waitForClose: : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
atrlength: : ATR Length
multiplier: : ATR Multiplier
atrMaType: : 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
Bibliothèque Pine
Dans l'esprit TradingView, l'auteur a publié ce code Pine sous forme de bibliothèque open source afin que d'autres programmeurs Pine de notre communauté puissent le réutiliser. Bravo à l'auteur! Vous pouvez utiliser cette bibliothèque à titre privé ou dans d'autres publications open source, mais la réutilisation de ce code dans des publications est régie par nos Règles.
Trial - trendoscope.io/trial
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Bibliothèque Pine
Dans l'esprit TradingView, l'auteur a publié ce code Pine sous forme de bibliothèque open source afin que d'autres programmeurs Pine de notre communauté puissent le réutiliser. Bravo à l'auteur! Vous pouvez utiliser cette bibliothèque à titre privé ou dans d'autres publications open source, mais la réutilisation de ce code dans des publications est régie par nos Règles.
Trial - trendoscope.io/trial
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.