Library "pandas_ta"

Level: 3

Background

Today is the first day of 2022 and happy new year every tradingviewers! May health and wealth go along with you all the time. I use this chance to publish my 1st PINE v5 lib : pandas_ta
This is not a piece of cake like thing, which cost me a lot of time and efforts to build this lib. Beyond 300 versions of this script was iterated in draft.

Function


Library "pandas_ta"
PINE v5 Counterpart of Pandas TA - A Technical Analysis Library in Python 3 at https://github.com/twopirllc/pandas-ta
The Original Pandas Technical Analysis (Pandas TA) is an easy to use library that leverages the Pandas package with more than 130 Indicators and Utility functions and more than 60 TA Lib Candlestick Patterns.
I realized most of indicators except Candlestick Patterns because tradingview built-in Candlestick Patterns are even more powerful!

I use this to verify pandas_ta python version indicators for myself, but I realize that maybe many may need similar lib for pine v5 as well.


Function Brief Descriptions ( Pls find details in script comments)

bton --> Binary to number
wcp --> Weighted Closing Price ( WCP )
counter --> Condition counter
xbt --> Between
ebsw --> Even Better SineWave (EBSW)
ao --> Awesome Oscillator (AO)
apo --> Absolute Price Oscillator (APO)
xrf --> Dynamic shifted values
bias --> Bias (BIAS)
bop --> Balance of Power (BOP)
brar --> BRAR (BRAR)
cci --> Commodity Channel Index ( CCI )
cfo --> Chande Forcast Oscillator ( CFO )
cg --> Center of Gravity ( CG )
cmo --> Chande Momentum Oscillator (CMO)
coppock --> Coppock Curve (COPC)
cti --> Correlation Trend Indicator ( CTI )
dmi --> Directional Movement Index(DMI)
er --> Efficiency Ratio (ER)
eri --> Elder Ray Index (ERI)
fisher --> Fisher Transform (FISHT)
inertia --> Inertia (INERTIA)
kdj --> KDJ (KDJ)
kst --> 'Know Sure Thing' ( KST )
macd --> Moving Average Convergence Divergence ( MACD )
mom --> Momentum (MOM)
pgo --> Pretty Good Oscillator ( PGO )
ppo --> Percentage Price Oscillator ( PPO )
psl --> Psychological Line ( PSL )
pvo --> Percentage Volume Oscillator ( PVO )
qqe --> Quantitative Qualitative Estimation (QQE)
roc --> Rate of Change ( ROC )
rsi --> Relative Strength Index ( RSI )
rsx --> Relative Strength Xtra ( rsx )
rvgi --> Relative Vigor Index (RVGI)
slope --> Slope
smi --> SMI Ergodic Indicator (SMI)
sqz* --> Squeeze ( SQZ ) * NOTE: code sufferred from very strange error, code was commented.
sqz_pro --> Squeeze PRO(SQZPRO)
xfl --> Condition filter
stc --> Schaff Trend Cycle ( STC )
stoch --> Stochastic ( STOCH )
stochrsi --> Stochastic RSI ( STOCH RSI )
td_seq --> TD Sequential (TD_SEQ)
trix --> Trix ( TRIX )
tsi --> True Strength Index (TSI)
uo --> Ultimate Oscillator (UO)
willr --> William's Percent R (WILLR)
alma --> Arnaud Legoux Moving Average ( ALMA )
xll --> Dynamic rolling lowest values
dema --> Double Exponential Moving Average ( DEMA )
ema --> Exponential Moving Average ( EMA )
fwma --> Fibonacci's Weighted Moving Average (FWMA)
hilo --> Gann HiLo Activator ( HiLo )
hma --> Hull Moving Average ( HMA )
hwma --> HWMA (Holt-Winter Moving Average)
ichimoku --> Ichimoku Kinkō Hyō ( ichimoku )
jma --> Jurik Moving Average Average ( JMA )
kama --> Kaufman's Adaptive Moving Average ( KAMA )
linreg --> Linear Regression Moving Average (linreg)
mgcd --> McGinley Dynamic Indicator
rma --> wildeR's Moving Average (RMA)
sinwma --> Sine Weighted Moving Average ( SWMA )
ssf --> Ehler's Super Smoother Filter ( SSF ) © 2013
supertrend --> Supertrend (supertrend)
xsa --> X simple moving average
swma --> Symmetric Weighted Moving Average ( SWMA )
t3 --> Tim Tillson's T3 Moving Average (T3)
tema --> Triple Exponential Moving Average ( TEMA )
trima --> Triangular Moving Average (TRIMA)
vidya --> Variable Index Dynamic Average ( VIDYA )
vwap --> Volume Weighted Average Price ( VWAP )
vwma --> Volume Weighted Moving Average ( VWMA )
wma --> Weighted Moving Average ( WMA )
zlma --> Zero Lag Moving Average (ZLMA)
entropy --> Entropy (ENTP)
kurtosis --> Rolling Kurtosis
skew --> Rolling Skew
xev --> Condition all
zscore --> Rolling Z Score
adx --> Average Directional Movement ( ADX )
aroon --> Aroon & Aroon Oscillator ( AROON )
chop --> Choppiness Index (CHOP)
xex --> Condition any
cksp --> Chande Kroll Stop (CKSP)
dpo --> Detrend Price Oscillator ( DPO )
long_run --> Long Run
psar --> Parabolic Stop and Reverse (psar)
short_run --> Short Run
vhf --> Vertical Horizontal Filter (VHF)
vortex --> Vortex
accbands --> Acceleration Bands (ACCBANDS)
atr --> Average True Range (ATR)
bbands --> Bollinger Bands (BBANDS)
donchian --> Donchian Channels (DC)
kc --> Keltner Channels (KC)
massi --> Mass Index (MASSI)
natr --> Normalized Average True Range ( NATR )
pdist --> Price Distance (PDIST)
rvi --> Relative Volatility Index (RVI)
thermo --> Elders Thermometer (THERMO)
ui --> Ulcer Index ( UI )
ad --> Accumulation/Distribution (AD)
cmf --> Chaikin Money Flow ( CMF )
efi --> Elder's Force Index ( EFI )
ecm --> Ease of Movement ( EOM )
kvo --> Klinger Volume Oscillator (KVO)
mfi --> Money Flow Index ( MFI )
nvi --> Negative Volume Index ( NVI )
obv --> On Balance Volume (OBV)
pvi --> Positive Volume Index (PVI)
dvdi --> Dual Volume Divergence Index (DVDI)
xhh --> Dynamic rolling highest values
pvt --> Price-Volume Trend (PVT)


Remarks

I also incorporated func descriptions and func test script in commented mode, you can test the functino with the embedded test script and modify them as you wish.

This is a Level 3 free and open source indicator library.

Feedbacks are appreciated.

This is not the end of pandas_ta lib publication, but it is start point with pine v5 lib function and I will add more and more funcs into this lib for my own indicators.

Function Name List:

bton()

wcp()

count()

xbt()

ebsw()

ao()

apo()

xrf()

bias()

bop()

brar()

cci()

cfo()

cg()

cmo()

coppock()

cti()

dmi()

er()

eri()

fisher()

inertia()

kdj()

kst()

macd()

mom()

pgo()

ppo()

psl()

pvo()

qqe()

roc()

rsi()

rsx()

rvgi()

slope()

smi()

sqz_pro()

xfl()

stc()

stoch()

stochrsi()

td_seq()

trix()

tsi()

uo()

willr()

alma()

wcx()

xll()

dema()

ema()

fwma()

hilo()

hma()

hwma()

ichimoku()

jma()

kama()

linreg()

mgcd()

rma()

sinwma()

ssf()

supertrend()

xsa()

swma()

t3()

tema()

trima()

vidya()

vwap()

vwma()

wma()

zlma()

entropy()

kurtosis()

skew()

xev()

zscore()

adx()

aroon()

chop()

xex()

cksp()

dpo()

long_run()

psar()

short_run()

vhf()

vortex()

accbands()

atr()

bbands()

donchian()

kc()

massi()

natr()

pdist()

rvi()

thermo()

ui()

ad()

cmf()

efi()

ecm()

kvo()

mfi()

nvi()

obv()

pvi()

dvdi()

xhh()

pvt()
Notas de Lançamento: v2

Updated:
xrf()

xll()

xhh()

@param length change frrom simple int to int.
Notas de Lançamento: v3

Added:
rbreaker()

Add rbreaker fucntion
Notas de Lançamento: v4
I added trend oscillator used for L3 whale sniper. However , it suffers from the same error with squeeze func, so I commented it and submit a ticket to tradingview for help.

Updated:
xsa()
Notas de Lançamento: v5
Correct errors on trend oscillator(tosc) and squeeze (sqz) functions
Added:
sqz()
tosc()
Notas de Lançamento: v6
Added: everget ce and noldo ce
ce()
nce()

Donate TRC20 USDT to below address, 5USDT per monthly sub, 50USDT per yearly sub: TNz84MjJTWUUUyQFpPNjaAU7J2SwhJJ7j9
Note: USDT_TRC20 deposits sent from decentralized exchanges are not yet supported.
Biblioteca do Pine

No verdadeiro espírito TradingView, o autor publicou este código de Pine como uma biblioteca de código aberto para que outros programadores de Pine de nossa comunidade possam reutilizá-lo. Um brinde ao autor! Você pode usar esta biblioteca em particular ou em outras publicações de código aberto, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Gostaria de usar essa biblioteca?

Copie a seguinte linha e cole-a em seu script.