PINE LIBRARY

lib_Indicators_v2_DTU

已更新
Library "lib_Indicators_v2_DTU"
This library functions returns included Moving averages, indicators with factorization, functions candles, function heikinashi and more.
Created it to feed as backend of my indicator/strategy "Indicators & Combinations Framework Advanced v2 [DTU]" that will be released ASAP.
This is replacement of my previous indicator (lib_indicators_DT)
I will add an indicator example which will use this indicator named as "lib_indicators_v2_DTU example" to help the usage of this library
Additionally library will be updated with more indicators in the future

NOTES:
Indicator functions returns only one series :-(
plotcandle function returns candle [open,high,low,close] series

INDICATOR LIST:
hide = 'DONT DISPLAY', //Dont display & calculate the indicator. (For my framework usage)
alma = 'alma(src,len,offset=0.85,sigma=6)', //Arnaud Legoux Moving Average
ama = 'ama(src,len,fast=14,slow=100)', //Adjusted Moving Average
acdst = 'accdist()', //Accumulation/distribution index.
cma = 'cma(src,len)', //Corrective Moving average
dema = 'dema(src,len)', //Double EMA (Same as EMA with 2 factor)
ema = 'ema(src,len)', //Exponential Moving Average
gmma = 'gmma(src,len)', //Geometric Mean Moving Average
hghst = 'highest(src,len)', //Highest value for a given number of bars back.
hl2ma = 'hl2ma(src,len)', //higest lowest moving average
hma = 'hma(src,len)', //Hull Moving Average.
lgAdt = 'lagAdapt(src,len,perclen=5,fperc=50)', //Ehler's Adaptive Laguerre filter
lgAdV = 'lagAdaptV(src,len,perclen=5,fperc=50)', //Ehler's Adaptive Laguerre filter variation
lguer = 'laguerre(src,len)', //Ehler's Laguerre filter
lsrcp = 'lesrcp(src,len)', //lowest exponential esrcpanding moving line
lexp = 'lexp(src,len)', //lowest exponential expanding moving line
linrg = 'linreg(src,len,loffset=1)', //Linear regression
lowst = 'lowest(src,len)', //Lovest value for a given number of bars back.
pcnl = 'percntl(src,len)', //percentile nearest rank. Calculates percentile using method of Nearest Rank.
pcnli = 'percntli(src,len)', //percentile linear interpolation. Calculates percentile using method of linear interpolation between the two nearest ranks.
rema = 'rema(src,len)', //Range EMA (REMA)
rma = 'rma(src,len)', //Moving average used in RSI. It is the exponentially weighted moving average with alpha = 1 / length.
sma = 'sma(src,len)', //Smoothed Moving Average
smma = 'smma(src,len)', //Smoothed Moving Average
supr2 = 'super2(src,len)', //Ehler's super smoother, 2 pole
supr3 = 'super3(src,len)', //Ehler's super smoother, 3 pole
strnd = 'supertrend(src,len,period=3)', //Supertrend indicator
swma = 'swma(src,len)', //Sine-Weighted Moving Average
tema = 'tema(src,len)', //Triple EMA (Same as EMA with 3 factor)
tma = 'tma(src,len)', //Triangular Moving Average
vida = 'vida(src,len)', //Variable Index Dynamic Average
vwma = 'vwma(src,len)', //Volume Weigted Moving Average
wma = 'wma(src,len)', //Weigted Moving Average
angle = 'angle(src,len)', //angle of the series (Use its Input as another indicator output)
atr = 'atr(src,len)', //average true range. RMA of true range.
bbr = 'bbr(src,len,mult=1)', //bollinger %%
bbw = 'bbw(src,len,mult=2)', //Bollinger Bands Width. The Bollinger Band Width is the difference between the upper and the lower Bollinger Bands divided by the middle band.
cci = 'cci(src,len)', //commodity channel index
cctbb = 'cctbbo(src,len)', //CCT Bollinger Band Oscilator
chng = 'change(src,len)', //Difference between current value and previous, source - source[length].
cmo = 'cmo(src,len)', //Chande Momentum Oscillator. Calculates the difference between the sum of recent gains and the sum of recent losses and then divides the result by the sum of all price movement over the same period.
cog = 'cog(src,len)', //The cog (center of gravity) is an indicator based on statistics and the Fibonacci golden ratio.
cpcrv = 'copcurve(src,len)', //Coppock Curve. was originally developed by Edwin "Sedge" Coppock (Barron's Magazine, October 1962).
corrl = 'correl(src,len)', //Correlation coefficient. Describes the degree to which two series tend to deviate from their ta.sma values.
count = 'count(src,len)', //green avg - red avg
dev = 'dev(src,len)', //ta.dev() Measure of difference between the series and it's ta.sma
fall = 'falling(src,len)', //ta.falling() Test if the `source` series is now falling for `length` bars long. (Use its Input as another indicator output)
kcr = 'kcr(src,len,mult=2)', //Keltner Channels Range
kcw = 'kcw(src,len,mult=2)', //ta.kcw(). Keltner Channels Width. The Keltner Channels Width is the difference between the upper and the lower Keltner Channels divided by the middle channel.
macd = 'macd(src,len)', //macd
mfi = 'mfi(src,len)', //Money Flow Index
nvi = 'nvi()', //Negative Volume Index
obv = 'obv()', //On Balance Volume
pvi = 'pvi()', //Positive Volume Index
pvt = 'pvt()', //Price Volume Trend
rise = 'rising(src,len)', //ta.rising() Test if the `source` series is now rising for `length` bars long. (Use its Input as another indicator output)
roc = 'roc(src,len)', //Rate of Change
rsi = 'rsi(src,len)', //Relative strength Index
smosc = 'smi_osc(src,len,fast=5, slow=34)', //smi Oscillator
smsig = 'smi_sig(src,len,fast=5, slow=34)', //smi Signal
stdev = 'stdev(src,len)', //Standart deviation
trix = 'trix(src,len)' , //the rate of change of a triple exponentially smoothed moving average.
tsi = 'tsi(src,len)', //True Strength Index
vari = 'variance(src,len)', //ta.variance(). Variance is the expectation of the squared deviation of a series from its mean (ta.sma), and it informally measures how far a set of numbers are spread out from their mean.
wilpc = 'willprc(src,len)', //Williams %R
wad = 'wad()', //Williams Accumulation/Distribution.
wvad = 'wvad()' //Williams Variable Accumulation/Distribution.
}

f_func(string, float, simple, float, float, float, simple) f_func Return selected indicator value with different parameters. New version. Use extra parameters for available indicators
  Parameters:
    string: FuncType_ indicator from the indicator list
    float: src_ close, open, high, low,hl2, hlc3, ohlc4 or any [series]
    simple: int length_ indicator length
    float: p1 extra parameter-1. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2)
    float: p2 extra parameter-2. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2)
    float: p3 extra parameter-3. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2)
    simple: int version_ indicator version for backward compatibility. V1:dont use extra parameters p1,p2,p3 and use default values. V2: use extra parameters for available indicators
  Returns: float [series] Return calculated indicator value

fn_heikin(float, float, float, float) fn_heikin Return given src data (open, high,low,close) as heikin ashi candle values
  Parameters:
    float: o_ open value
    float: h_ high value
    float: l_ low value
    float: c_ close value
  Returns: float [series, series,series,series] heikin ashi open, high,low,close vlues that will be used with plotcandle

fn_plotFunction(float, string, simple, bool) fn_plotFunction Return input src data with different plotting options
  Parameters:
    float: src_ indicator src_data or any other series.....
    string: plotingType Ploting type of the function on the screen ['Original', 'Stochastic', 'PercentRank','Org. Range (-1,1)']
    simple: int stochlen_ length for plotingType for stochastic and PercentRank options
    bool: plotSWMA Use SWMA for smoothing Ploting
  Returns: float [series]

fn_funcPlotV2(string, float, simple, float, float, float, simple, string, simple, bool, bool) fn_funcPlotV2 Return selected indicator value with different parameters. New version. Use extra parameters fora available indicators
  Parameters:
    string: FuncType_ indicator from the indicator list
    float: src_data_ close, open, high, low,hl2, hlc3, ohlc4 or any [series]
    simple: int length_ indicator length
    float: p1 extra parameter-1. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2)
    float: p2 extra parameter-2. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2)
    float: p3 extra parameter-3. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2)
    simple: int version_ indicator version for backward compatibility. V1:dont use extra parameters p1,p2,p3 and use default values. V2: use extra parameters for available indicators
    string: plotingType Ploting type of the function on the screen ['Original', 'Stochastic', 'PercentRank','Org. Range (-1,1)']
    simple: int stochlen_ length for plotingType for stochastic and PercentRank options
    bool: plotSWMA Use SWMA for smoothing Ploting
    bool: log_ Use log on function entries
  Returns: float [series] Return calculated indicator value

fn_factor(string, float, simple, float, float, float, simple, simple, string, simple, bool, bool) fn_factor Return selected indicator's factorization with given arguments
  Parameters:
    string: FuncType_ indicator from the indicator list
    float: src_data_ close, open, high, low,hl2, hlc3, ohlc4 or any [series]
    simple: int length_ indicator length
    float: p1 parameter-1. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2)
    float: p2 parameter-2. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2)
    float: p3 parameter-3. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2)
    simple: int version_ indicator version for backward compatibility. V1:dont use extra parameters p1,p2,p3 and use default values. V2: use extra parameters for available indicators
    simple: int fact_ Add double triple, Quatr factor to selected indicator (like converting EMA to 2-DEMA, 3-TEMA, 4-QEMA...)
    string: plotingType Ploting type of the function on the screen ['Original', 'Stochastic', 'PercentRank','Org. Range (-1,1)']
    simple: int stochlen_ length for plotingType for stochastic and PercentRank options
    bool: plotSWMA Use SWMA for smoothing Ploting
    bool: log_ Use log on function entries
  Returns: float [series] Return result of the function

fn_plotCandles(string, simple, float, float, float, simple, string, simple, bool, bool, bool) fn_plotCandles Return selected indicator's candle values with different parameters also heikinashi is available
  Parameters:
    string: FuncType_ indicator from the indicator list
    simple: int length_ indicator length
    float: p1 parameter-1. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2)
    float: p2 parameter-2. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2)
    float: p3 parameter-3. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2)
    simple: int version_ indicator version for backward compatibility. V1:dont use extra parameters p1,p2,p3 and use default values. V2: use extra parameters for available indicators
    string: plotingType Ploting type of the function on the screen ['Original', 'Stochastic', 'PercentRank','Org. Range (-1,1)']
    simple: int stochlen_ length for plotingType for stochastic and PercentRank options
    bool: plotSWMA Use SWMA for smoothing Ploting
    bool: log_ Use log on function entries
    bool: plotheikin_ Use Heikin Ashi on Plot
  Returns: float [series]
發布通知
v2.1
This library includes indicators, snippets from tradingview builtin library, RodriGo, @midtownsk8rguy, LazyBear Special thanks to all of the Pine wizards and others for their contribution with their indicators
//You can see the demo of the library by directly adding to the chart
//ADD: 23 new indicators added. Most of them are TR builtin indicators (see description in TV builtin Indicators). Newly added indicators are listed below
//ADD: New Indicator 'pivothigh(src,BarsLeft,BarsRight=2)' //Previous pivot high. src=src, BarsLeft=len, BarsRight=p1=2
//ADD: New Indicator 'pivotlow(src,BarsLeft,BarsRight=2)' //Previous pivot low. src=src, BarsLeft=len, BarsRight=p1=2
//ADD: New Indicator 'ranges(src,upper=len, lower=-5)', //ranges of the source. return -1 source<lower, return 1 source>upper otherwise return 0
//ADD: New Indicator 'aroon(len,dir=0)', //aroon indicator. Aroon's major function is to identify new trends as they happen.p1 = dir: 0=mid (default), 1=upper, 2=lower
//ADD: New Indicator 'adx(dilen=len, adxlen=14)' //adx. The Average Directional Index (ADX) is a used to determine the strength of a trend. len=>dilen, p1=adxlen (default=14), p2=adxtype 0:ADX, 1:+DI, 2:-DI (def:0)
//ADD: New Indicator 'awesome(fast=len=5,slow=34,type=0)' //Awesome Oscilator (AO) is an indicator used to measure market momentum. defaults : fast=len= 5, p1=slow=34, p2=type: 0=Awesome, 1=difference
//ADD: New Indicator 'cmf(len=20)' //Chaikin Money Flow Indicator used to measure Money Flow Volume over a set period of time. Default use is len=20
//ADD: New Indicator 'eom(len=14,div=10000)', //Ease of Movement.It is designed to measure the relationship between price and volume.p1 = div: 10000= (default)
//ADD: New Indicator 'efi(len)' //Elder's Force Index (EFI) measures the power behind a price movement using price and volume.
//ADD: New Indicator 'fn_fisher(len)' //Fisher Transform is a technical indicator that converts price to Gaussian normal distribution and signals when prices move significantly by referencing recent price data
//ADD: New Indicator 'fn_histvol(len)', //Historical volatility is a statistical measure used to analyze the general dispersion of security or market index returns for a specified period of time.
//ADD: New Indicator 'dpo(len)', //Detrended Price Oscilator is used to remove trend from price.
//ADD: New Indicator 'klinger(type=len)', //Klinger oscillator aims to identify money flow’s long-term trend. type=len: 0:Oscilator 1:signal
//ADD: New Indicator 'msi(len=10)', //Mass Index (def=10) is used to examine the differences between high and low stock prices over a specific period of time
//ADD: New Indicator 'mcginley(src, len)' //McGinley Dynamic adjusts for market speed shifts, which sets it apart from other moving averages, in addition to providing clear moving average lines
//ADD: New Indicator 'sar(start=len, inc=0.02, max=0.02)' //Parabolic SAR (parabolic stop and reverse) is a method to find potential reversals in the market price direction of traded goods.start=len, inc=p1, max=p2. ex: sar(0.02, 0.02, 0.02)
//ADD: New Indicator 'rvi(src,len)', //The Relative Volatility Index (RVI) is calculated much like the RSI, although it uses high and low price standard deviation instead of the RSI’s method of absolute change in price.
//ADD: New Indicator 'ultimateOsc(len)' //Ultimate Oscillator indicator (UO) indicator is a technical analysis tool used to measure momentum across three varying timeframes
//ADD: New Indicator 'volstop(src,len,atrfactor=2)' //Volatility Stop is a technical indicator that is used by traders to help place effective stop-losses. atrfactor=p1
//ADD: New Indicator 'vwap(src_)', //Volume Weighted Average Price (VWAP) is used to measure the average price weighted by volume
//ADD: New Indicator 'cti(src,len)', //Ehler s Correlation Trend Indicator by @midtownsk8rguy.
//ADD: New Indicator 'stc(src,len,fast=23,slow=50)', //Schaff Trend Cycle (STC) detects up and down trends long before the MACD. Code imported from LazyBear's (thanks) Schaff Trend Cycle script.
//ADD: New Indicator 'Original Value', //Return input source value as output
//UPD: constants and inputs (ind_src) are updated with new indicators
//UPD: indicators descriptions updated
//UPD: function outputs with "na" converted to 0
//UPD: input (len:) converted int to float and function codes updated accordingly
//UPD: calculation error on fn_factor() corrected

factorheikinashilibraryLOGtechindicator

Pine腳本庫

在真正的TradingView精神中,作者將這段Pine程式碼發佈為開源程式庫,以便我們社群的其他Pine程式設計師可以重複使用它。請向作者致敬!您可以私下使用這個函式庫,或在其他開源出版品中使用,但在出版物中再次使用這段程式碼將受到網站規則的約束。

免責聲明