hikyuu2/hikyuu/indicator/talib_wrap.py

1265 lines
47 KiB
Python
Raw Normal View History

#!/usr/bin/python
# -*- coding: utf8 -*-
# cp936
#
# The MIT License (MIT)
#
# Copyright (c) 2017 fasiondog
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
2024-01-03 14:50:57 +08:00
# ===============================================================================
# 作者fasiondog
# 历史120170923, Added by fasiondog
2024-01-03 14:50:57 +08:00
# ===============================================================================
from .indicator import Indicator, IndicatorImp
try:
import talib
import talib.abstract as ta
2017-09-24 11:31:51 +08:00
import numpy as np
2020-07-11 18:26:23 +08:00
def tawrap_init(self, tafunc, name, params, result_num=1, prices=None):
super(self.__class__, self).__init__(name, result_num)
2020-07-11 18:26:23 +08:00
for k, v in params.items():
self.set_param(k, v)
self._tafunc = tafunc
self._prices = prices
self._params = params
self._result_num = result_num
2020-07-11 18:26:23 +08:00
def tawrap_calculate(self, ind):
2020-07-11 18:26:23 +08:00
result_num = self.get_result_num()
if result_num < 1:
print("error: result_num must be >= 1!")
return
2020-07-11 18:26:23 +08:00
if not self._prices:
if self.name == "TA_OBV":
2020-07-11 18:26:23 +08:00
if ind.get_result_num() < 2:
print("error: result_num must be >= 2!")
return
2020-07-11 18:26:23 +08:00
inputs = {'close': ind.get_result(0).to_np(), 'volume': ind.get_result(1).to_np()}
elif self.name in ("TA_BETA", "TA_CORREL"):
2020-07-11 18:26:23 +08:00
if ind.get_result_num() < 2:
print("error: result_num must be >= 2!")
return
2020-07-11 18:26:23 +08:00
inputs = {'high': ind.get_result(0).to_np(), 'low': ind.get_result(1).to_np()}
else:
inputs = {'close': ind.to_np()}
else:
if ind.name != 'KDATA':
print("error: ind must KDATA")
return
2020-07-11 18:26:23 +08:00
inputs = {
2020-07-11 18:26:23 +08:00
'open': ind.get_result(0).to_np(),
'high': ind.get_result(1).to_np(),
'low': ind.get_result(2).to_np(),
'close': ind.get_result(3).to_np(),
'volume': ind.get_result(5).to_np()
}
2020-07-11 18:26:23 +08:00
params = self.get_parameter()
param_names = params.get_name_list()
func_params = {}
for name in param_names:
if name != "kdata":
2020-07-11 18:26:23 +08:00
func_params[name] = self.get_param(name)
self._tafunc.set_parameters(func_params)
outputs = self._tafunc(inputs, prices=self._prices) if self._prices else self._tafunc(inputs)
if result_num == 1:
for i, val in enumerate(outputs):
if not np.isnan(val):
self._set(float(val), i)
2020-07-11 18:26:23 +08:00
self.set_discard(self._tafunc.lookback)
else:
for i, out in enumerate(outputs):
for j, val in enumerate(out):
if not np.isnan(val):
self._set(float(val), j, i)
2020-07-11 18:26:23 +08:00
self.set_discard(self._tafunc.lookback)
def check_all_true(self):
return True
def tawrap_support_ind_param(self):
return False
def tawrap_clone(self):
2020-07-11 18:26:23 +08:00
return crtTaIndicatorImp(
self._tafunc, self.name, self._params, self._result_num, self._prices, check=self.check
)
2020-07-11 18:26:23 +08:00
def crtTaIndicatorImp(tafunc, name, params={}, result_num=1, prices=None, check=check_all_true):
meta_x = type(
name, (IndicatorImp, ), {
'__init__': tawrap_init,
'check': check,
'_clone': tawrap_clone,
'_calculate': tawrap_calculate,
'support_ind_param': tawrap_support_ind_param,
2020-07-11 18:26:23 +08:00
}
)
return meta_x(tafunc, name, params, result_num, prices)
def TA_AD(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.AD, 'TA_AD', prices=['high', 'low', 'close', 'volume'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_AD.__doc__ = talib.AD.__doc__
def TA_ADOSC(ind=None, fastperiod=3, slowperiod=10):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.ADOSC,
'TA_ADOSC',
params={
'fastperiod': fastperiod,
'slowperiod': slowperiod
},
prices=['high', 'low', 'close', 'volume']
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_ADOSC.__doc__ = talib.ADOSC.__doc__
2020-07-11 18:26:23 +08:00
def TA_ADX(ind=None, timeperiod=14):
imp = crtTaIndicatorImp(ta.ADX, 'TA_ADX', params={'timeperiod': timeperiod}, prices=['high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_ADX.__doc__ = talib.ADX.__doc__
def TA_ADXR(ind=None, timeperiod=14):
imp = crtTaIndicatorImp(ta.ADXR, 'TA_ADXR', params={'timeperiod': timeperiod}, prices=['high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_ADXR.__doc__ = talib.ADXR.__doc__
2020-07-11 18:26:23 +08:00
def TA_APO(ind=None, fastperiod=12, slowperiod=26, matype=talib.MA_Type.SMA):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.APO, 'TA_APO', params={
2020-07-11 18:26:23 +08:00
'fastperiod': fastperiod,
'slowperiod': slowperiod,
'matype': matype
}
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_APO.__doc__ = talib.APO.__doc__
2020-07-11 18:26:23 +08:00
def TA_AROON(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.AROON, 'TA_AROON', result_num=2, params={'timeperiod': timeperiod}, prices=['high', 'low']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_AROON.__doc__ = talib.AROON.__doc__
2020-07-11 18:26:23 +08:00
def TA_AROONOSC(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.AROONOSC, 'TA_AROONOSC', result_num=1, params={'timeperiod': timeperiod}, prices=['high', 'low']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_AROONOSC.__doc__ = talib.AROONOSC.__doc__
2020-07-11 18:26:23 +08:00
def TA_ATR(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.ATR, 'TA_ATR', result_num=1, params={'timeperiod': timeperiod}, prices=['high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_ATR.__doc__ = talib.ATR.__doc__
2020-07-11 18:26:23 +08:00
def TA_AVGPRICE(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.AVGPRICE,
'TA_AVGPRICE',
result_num=1,
2024-01-03 14:50:57 +08:00
# params={'timeperiod': timeperiod},
2020-07-11 18:26:23 +08:00
prices=['open', 'high', 'low', 'close']
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_AVGPRICE.__doc__ = talib.AVGPRICE.__doc__
2020-07-11 18:26:23 +08:00
def TA_BBANDS(ind=None, timeperiod=14, nbdevup=2, nbdevdn=2, matype=talib.MA_Type.SMA):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.BBANDS,
'TA_BBANDS',
result_num=3,
params={
'timeperiod': timeperiod,
'nbdevup': nbdevup,
'nbdevdn': nbdevdn,
'matype': matype
}
)
return Indicator(imp)(ind) if ind else Indicator(imp)
TA_BBANDS.__doc__ = talib.BBANDS.__doc__
2020-07-11 18:26:23 +08:00
def TA_BOP(ind=None):
imp = crtTaIndicatorImp(ta.BOP, 'TA_BOP', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_BOP.__doc__ = talib.BOP.__doc__
def TA_CCI(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CCI, 'TA_CCI', result_num=1, params={'timeperiod': timeperiod}, prices=['high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CCI.__doc__ = talib.CCI.__doc__
2020-07-11 18:26:23 +08:00
def TA_CMO(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.CMO, 'TA_CMO', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CMO.__doc__ = talib.CMO.__doc__
2020-07-11 18:26:23 +08:00
def TA_DEMA(ind=None, timeperiod=30):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.DEMA, 'TA_DEMA', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_DEMA.__doc__ = talib.DEMA.__doc__
2020-07-11 18:26:23 +08:00
def TA_DX(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.DX, 'TA_DX', result_num=1, params={'timeperiod': timeperiod}, prices=['high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_DX.__doc__ = talib.DX.__doc__
2020-07-11 18:26:23 +08:00
def TA_EMA(ind=None, timeperiod=30):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.EMA, 'TA_EMA', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_EMA.__doc__ = talib.EMA.__doc__
2020-07-11 18:26:23 +08:00
def TA_HT_DCPERIOD(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.HT_DCPERIOD, 'TA_HT_DCPERIOD', result_num=1)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_HT_DCPERIOD.__doc__ = talib.HT_DCPERIOD.__doc__
def TA_HT_DCPHASE(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.HT_DCPHASE, 'TA_HT_DCPHASE', result_num=1)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_HT_DCPHASE.__doc__ = talib.HT_DCPHASE.__doc__
2020-07-11 18:26:23 +08:00
def TA_HT_PHASOR(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.HT_PHASOR, 'TA_HT_PHASOR', result_num=2)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_HT_PHASOR.__doc__ = talib.HT_PHASOR.__doc__
2020-07-11 18:26:23 +08:00
def TA_HT_SINE(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.HT_SINE, 'TA_HT_SINE', result_num=2)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_HT_SINE.__doc__ = talib.HT_SINE.__doc__
2020-07-11 18:26:23 +08:00
def TA_HT_TRENDLINE(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.HT_TRENDLINE, 'TA_HT_TRENDLINE', result_num=1)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_HT_TRENDLINE.__doc__ = talib.HT_TRENDLINE.__doc__
2020-07-11 18:26:23 +08:00
def TA_HT_TRENDMODE(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.HT_TRENDMODE, 'TA_HT_TRENDMODE', result_num=1)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_HT_TRENDMODE.__doc__ = talib.HT_TRENDMODE.__doc__
2020-07-11 18:26:23 +08:00
def TA_KAMA(ind=None, timeperiod=30):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.KAMA, 'TA_KAMA', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_KAMA.__doc__ = talib.KAMA.__doc__
2020-07-11 18:26:23 +08:00
def TA_LINEARREG(ind=None, timeperiod=14):
imp = crtTaIndicatorImp(ta.LINEARREG, 'TA_LINEARREG', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_LINEARREG.__doc__ = talib.LINEARREG.__doc__
2020-07-11 18:26:23 +08:00
def TA_LINEARREG_ANGLE(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.LINEARREG_ANGLE, 'TA_LINEARREG_ANGLE', result_num=1, params={'timeperiod': timeperiod}
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_LINEARREG_ANGLE.__doc__ = talib.LINEARREG_ANGLE.__doc__
2020-07-11 18:26:23 +08:00
def TA_LINEARREG_INTERCEPT(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.LINEARREG_INTERCEPT, 'TA_LINEARREG_INTERCEPT', result_num=1, params={'timeperiod': timeperiod}
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_LINEARREG_INTERCEPT.__doc__ = talib.LINEARREG_INTERCEPT.__doc__
def TA_LINEARREG_SLOPE(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.LINEARREG_SLOPE, 'TA_LINEARREG_SLOPE', result_num=1, params={'timeperiod': timeperiod}
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_LINEARREG_SLOPE.__doc__ = talib.LINEARREG_SLOPE.__doc__
2020-07-11 18:26:23 +08:00
def TA_MA(ind=None, timeperiod=30, matype=talib.MA_Type.SMA):
imp = crtTaIndicatorImp(ta.MA, 'TA_MA', result_num=1, params={'timeperiod': timeperiod, 'matype': matype})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MA.__doc__ = talib.MA.__doc__
2020-07-11 18:26:23 +08:00
def TA_MACD(ind=None, fastperiod=12, slowperiod=26, signalperiod=9):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.MACD,
'TA_MACD',
result_num=3,
params={
'fastperiod': fastperiod,
'slowperiod': slowperiod,
'signalperiod': signalperiod
}
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MACD.__doc__ = talib.MACD.__doc__
2020-07-11 18:26:23 +08:00
def TA_MACDEXT(
ind=None,
fastperiod=12,
fastmatype=talib.MA_Type.SMA,
slowperiod=26,
slowmatype=talib.MA_Type.SMA,
signalperiod=9,
signalmatype=talib.MA_Type.SMA
):
imp = crtTaIndicatorImp(
ta.MACDEXT,
'TA_MACDEXT',
result_num=3,
params={
'fastperiod': fastperiod,
'fastmatype': fastmatype,
'slowperiod': slowperiod,
'slowmatype': slowmatype,
'signalperiod': signalperiod,
'signalmatype': signalmatype
}
)
return Indicator(imp)(ind) if ind else Indicator(imp)
TA_MACDEXT.__doc__ = talib.MACDEXT.__doc__
2020-07-11 18:26:23 +08:00
def TA_MACDFIX(ind=None, signalperiod=9):
imp = crtTaIndicatorImp(ta.MACDFIX, 'TA_MACDFIX', result_num=3, params={'signalperiod': signalperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MACDFIX.__doc__ = talib.MACDFIX.__doc__
def TA_MAMA(ind=None, fastlimit=0.5, slowlimit=0.05):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.MAMA, 'TA_MAMA', result_num=2, params={
2020-07-11 18:26:23 +08:00
'fastlimit': fastlimit,
'slowlimit': slowlimit
}
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MAMA.__doc__ = talib.MAMA.__doc__
2020-07-11 18:26:23 +08:00
def TA_MAX(ind=None, timeperiod=30):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.MAX, 'TA_MAX', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MAX.__doc__ = talib.MAX.__doc__
def TA_MAXINDEX(ind=None, timeperiod=30):
imp = crtTaIndicatorImp(ta.MAXINDEX, 'TA_MAXINDEX', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MAXINDEX.__doc__ = talib.MAXINDEX.__doc__
2020-07-11 18:26:23 +08:00
def TA_MEDPRICE(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.MEDPRICE, 'TA_MEDPRICE', result_num=1, prices=['high', 'low'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MEDPRICE.__doc__ = talib.MEDPRICE.__doc__
2020-07-11 18:26:23 +08:00
def TA_MIDPOINT(ind=None, timeperiod=14):
imp = crtTaIndicatorImp(ta.MIDPOINT, 'TA_MIDPOINT', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MIDPOINT.__doc__ = talib.MIDPRICE.__doc__
2020-07-11 18:26:23 +08:00
def TA_MIDPRICE(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.MIDPRICE, 'TA_MIDPRICE', result_num=1, params={'timeperiod': timeperiod}, prices=['high', 'low']
2020-07-11 18:26:23 +08:00
)
return Indicator(imp)(ind) if ind else Indicator(imp)
TA_MIDPRICE.__doc__ = talib.MIDPRICE.__doc__
def TA_MIN(ind=None, timeperiod=30):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.MIN, 'TA_MIN', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MIN.__doc__ = talib.MIN.__doc__
2020-07-11 18:26:23 +08:00
def TA_MININDEX(ind=None, timeperiod=30):
imp = crtTaIndicatorImp(ta.MININDEX, 'TA_MININDEX', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MININDEX.__doc__ = talib.MININDEX.__doc__
def TA_MINMAX(ind=None, timeperiod=30):
imp = crtTaIndicatorImp(ta.MINMAX, 'TA_MINMAX', result_num=2, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MINMAX.__doc__ = talib.MINMAX.__doc__
2020-07-11 18:26:23 +08:00
def TA_MINMAXINDEX(ind=None, timeperiod=30):
imp = crtTaIndicatorImp(ta.MINMAXINDEX, 'TA_MINMAXINDEX', result_num=2, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MINMAXINDEX.__doc__ = talib.MINMAXINDEX.__doc__
2020-07-11 18:26:23 +08:00
def TA_MINUS_DI(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.MINUS_DI,
'TA_MINUS_DI',
result_num=1,
params={'timeperiod': timeperiod},
prices=['high', 'low', 'close']
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MINUS_DI.__doc__ = talib.MINUS_DI.__doc__
2020-07-11 18:26:23 +08:00
def TA_MINUS_DM(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.MINUS_DM, 'TA_MINUS_DM', result_num=1, params={'timeperiod': timeperiod}, prices=['high', 'low']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MINUS_DM.__doc__ = talib.MINUS_DM.__doc__
2020-07-11 18:26:23 +08:00
def TA_MOM(ind=None, timeperiod=10):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.MOM, 'TA_MOM', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_MOM.__doc__ = talib.MOM.__doc__
def TA_NATR(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.NATR, 'TA_NATR', result_num=1, params={'timeperiod': timeperiod}, prices=['high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_NATR.__doc__ = talib.NATR.__doc__
2020-07-11 18:26:23 +08:00
def TA_PLUS_DI(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.PLUS_DI, 'TA_PLUS_DI', result_num=1, params={'timeperiod': timeperiod}, prices=['high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_PLUS_DI.__doc__ = talib.PLUS_DI.__doc__
2020-07-11 18:26:23 +08:00
def TA_PLUS_DM(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.PLUS_DM, 'TA_PLUS_DM', result_num=1, params={'timeperiod': timeperiod}, prices=['high', 'low']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_PLUS_DM.__doc__ = talib.PLUS_DM.__doc__
2020-07-11 18:26:23 +08:00
def TA_PPO(ind=None, fastperiod=12, slowperiod=26, matype=talib.MA_Type.SMA):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.PPO,
'TA_PPO',
result_num=1,
params={
'fastperiod': fastperiod,
'slowperiod': slowperiod,
'matype': matype
}
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_PPO.__doc__ = talib.PPO.__doc__
2020-07-11 18:26:23 +08:00
def TA_ROC(ind=None, timeperiod=10):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.ROC, 'TA_ROC', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_ROC.__doc__ = talib.ROC.__doc__
2020-07-11 18:26:23 +08:00
def TA_ROCP(ind=None, timeperiod=10):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.ROCP, 'TA_ROCP', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_ROCP.__doc__ = talib.ROCP.__doc__
2020-07-11 18:26:23 +08:00
def TA_ROCR(ind=None, timeperiod=10):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.ROCR, 'TA_ROCR', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_ROCR.__doc__ = talib.ROCR.__doc__
2020-07-11 18:26:23 +08:00
def TA_ROCR100(ind=None, timeperiod=10):
imp = crtTaIndicatorImp(ta.ROCR100, 'TA_ROCR100', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_ROCR100.__doc__ = talib.ROCR100.__doc__
2020-07-11 18:26:23 +08:00
def TA_RSI(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.RSI, 'TA_RSI', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_RSI.__doc__ = talib.RSI.__doc__
2020-07-11 18:26:23 +08:00
def TA_SAR(ind=None, acceleration=0.02, maximum=0.2):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.SAR,
'TA_SAR',
result_num=1,
params={
'acceleration': acceleration,
'maximum': maximum
},
prices=['high', 'low']
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_SAR.__doc__ = talib.SAR.__doc__
2020-07-11 18:26:23 +08:00
def TA_SAREXT(
ind=None,
startvalue=0,
offsetonreverse=0,
accelerationinitlong=0.02,
accelerationlong=0.02,
accelerationmaxlong=0.02,
accelerationinitshort=0.02,
accelerationshort=0.02,
accelerationmaxshort=0.02
):
imp = crtTaIndicatorImp(
ta.SAREXT,
'TA_SAREXT',
result_num=1,
params={
'startvalue': startvalue,
'offsetonreverse': offsetonreverse,
'accelerationinitlong': accelerationinitlong,
'accelerationlong': accelerationlong,
'accelerationmaxlong': accelerationmaxlong,
'accelerationinitshort': accelerationinitshort,
'accelerationshort': accelerationshort,
'accelerationmaxshort': accelerationmaxshort
},
prices=['high', 'low']
)
return Indicator(imp)(ind) if ind else Indicator(imp)
TA_SAREXT.__doc__ = talib.SAREXT.__doc__
2020-07-11 18:26:23 +08:00
def TA_SMA(ind=None, timeperiod=30):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.SMA, 'TA_SMA', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_SMA.__doc__ = talib.SMA.__doc__
2020-07-11 18:26:23 +08:00
def TA_STDDEV(ind=None, timeperiod=5, nbdev=1):
imp = crtTaIndicatorImp(ta.STDDEV, 'TA_STDDEV', result_num=1, params={'timeperiod': timeperiod, 'nbdev': nbdev})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_STDDEV.__doc__ = talib.STDDEV.__doc__
2020-07-11 18:26:23 +08:00
def TA_STOCH(
ind=None,
fastk_period=5,
slowk_period=3,
slowk_matype=talib.MA_Type.SMA,
slowd_period=3,
slowd_matype=talib.MA_Type.SMA
):
imp = crtTaIndicatorImp(
ta.STOCH,
'TA_STOCH',
result_num=2,
params={
'fastk_period': fastk_period,
'slowk_period': slowk_period,
'slowk_matype': slowk_matype,
'slowd_period': slowd_period,
'slowd_matype': slowd_matype
},
prices=['high', 'low', 'close']
)
return Indicator(imp)(ind) if ind else Indicator(imp)
TA_STOCH.__doc__ = talib.STOCH.__doc__
2020-07-11 18:26:23 +08:00
def TA_STOCHF(ind=None, fastk_period=5, fastd_period=3, fastd_matype=talib.MA_Type.SMA):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.STOCHF,
'TA_STOCHF',
result_num=2,
params={
'fastk_period': fastk_period,
'fastd_period': fastd_period,
'fastd_matype': fastd_matype
},
prices=['high', 'low', 'close']
)
return Indicator(imp)(ind) if ind else Indicator(imp)
TA_STOCHF.__doc__ = talib.STOCHF.__doc__
2020-07-11 18:26:23 +08:00
def TA_STOCHRSI(ind=None, timeperiod=14, fastk_period=5, fastd_period=3, fastd_matype=talib.MA_Type.SMA):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.STOCHRSI,
'TA_STOCHRSI',
result_num=2,
params={
'timeperiod': timeperiod,
'fastk_period': fastk_period,
'fastd_period': fastd_period,
'fastd_matype': fastd_matype
}
)
return Indicator(imp)(ind) if ind else Indicator(imp)
TA_STOCHRSI.__doc__ = talib.STOCHRSI.__doc__
2020-07-11 18:26:23 +08:00
def TA_SUM(ind=None, timeperiod=30):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.SUM, 'TA_SUM', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_SUM.__doc__ = talib.SUM.__doc__
2020-07-11 18:26:23 +08:00
def TA_T3(ind=None, timeperiod=5, vfactor=0.7):
imp = crtTaIndicatorImp(ta.T3, 'TA_T3', result_num=1, params={'timeperiod': timeperiod, 'vfactor': vfactor})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_T3.__doc__ = talib.T3.__doc__
2020-07-11 18:26:23 +08:00
def TA_TEMA(ind=None, timeperiod=30):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.TEMA, 'TA_TEMA', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_TEMA.__doc__ = talib.TEMA.__doc__
2020-07-11 18:26:23 +08:00
def TA_TRANGE(ind=None):
imp = crtTaIndicatorImp(ta.TRANGE, 'TA_TRANGE', result_num=1, prices=['high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_TRANGE.__doc__ = talib.TRANGE.__doc__
2020-07-11 18:26:23 +08:00
def TA_TRIMA(ind=None, timeperiod=30):
imp = crtTaIndicatorImp(ta.TRIMA, 'TA_TRIMA', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_TRIMA.__doc__ = talib.TRIMA.__doc__
2020-07-11 18:26:23 +08:00
def TA_TRIX(ind=None, timeperiod=30):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.TRIX, 'TA_TRIX', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_TRIX.__doc__ = talib.TRIX.__doc__
2020-07-11 18:26:23 +08:00
def TA_TSF(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.TSF, 'TA_TSF', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_TSF.__doc__ = talib.TSF.__doc__
2020-07-11 18:26:23 +08:00
def TA_TYPPRICE(ind=None, timeperiod=14):
imp = crtTaIndicatorImp(ta.TYPPRICE, 'TA_TYPPRICE', result_num=1, prices=['high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_TYPPRICE.__doc__ = talib.TYPPRICE.__doc__
2020-07-11 18:26:23 +08:00
def TA_ULTOSC(ind=None, timeperiod1=7, timeperiod2=14, timeperiod3=28):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.ULTOSC,
'TA_ULTOSC',
result_num=1,
params={
'timeperiod1': timeperiod1,
'timeperiod2': timeperiod2,
'timeperiod3': timeperiod3,
},
prices=['high', 'low', 'close']
)
return Indicator(imp)(ind) if ind else Indicator(imp)
TA_ULTOSC.__doc__ = talib.ULTOSC.__doc__
2020-07-11 18:26:23 +08:00
def TA_VAR(ind=None, timeperiod=5, nbdev=1):
imp = crtTaIndicatorImp(ta.VAR, 'TA_VAR', result_num=1, params={'timeperiod': timeperiod, 'nbdev': nbdev})
2020-07-11 18:26:23 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
TA_VAR.__doc__ = talib.VAR.__doc__
def TA_WCLPRICE(ind=None):
imp = crtTaIndicatorImp(ta.WCLPRICE, 'TA_WCLPRICE', result_num=1, prices=['high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_WCLPRICE.__doc__ = talib.WCLPRICE.__doc__
2020-07-11 18:26:23 +08:00
def TA_WILLR(ind=None, timeperiod=14):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.WILLR, 'TA_WILLR', result_num=1, params={'timeperiod': timeperiod}, prices=['high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_WILLR.__doc__ = talib.WILLR.__doc__
2020-07-11 18:26:23 +08:00
def TA_WMA(ind=None, timeperiod=30):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.WMA, 'TA_WMA', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_WMA.__doc__ = talib.WMA.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDL2CROWS(ind=None):
imp = crtTaIndicatorImp(ta.CDL2CROWS, 'TA_CDL2CROWS', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDL2CROWS.__doc__ = talib.CDL2CROWS.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDL3BLACKCROWS(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDL3BLACKCROWS, 'TA_CDL3BLACKCROWS', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDL3BLACKCROWS.__doc__ = talib.CDL3BLACKCROWS.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDL3INSIDE(ind=None):
imp = crtTaIndicatorImp(ta.CDL3INSIDE, 'TA_CDL3INSIDE', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDL3INSIDE.__doc__ = talib.CDL3INSIDE.__doc__
def TA_CDL3LINESTRIKE(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDL3LINESTRIKE, 'TA_CDL3LINESTRIKE', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDL3LINESTRIKE.__doc__ = talib.CDL3LINESTRIKE.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDL3OUTSIDE(ind=None):
imp = crtTaIndicatorImp(ta.CDL3OUTSIDE, 'TA_CDL3OUTSIDE', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDL3OUTSIDE.__doc__ = talib.CDL3OUTSIDE.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDL3STARSINSOUTH(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDL3STARSINSOUTH, 'TA_CDL3STARSINSOUTH', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDL3STARSINSOUTH.__doc__ = talib.CDL3STARSINSOUTH.__doc__
def TA_CDL3WHITESOLDIERS(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDL3WHITESOLDIERS, 'TA_CDL3WHITESOLDIERS', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDL3WHITESOLDIERS.__doc__ = talib.CDL3WHITESOLDIERS.__doc__
def TA_CDLABANDONEDBABY(ind=None, penetration=0.3):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLABANDONEDBABY,
'TA_CDLABANDONEDBABY',
result_num=1,
params={'penetration': penetration},
prices=['open', 'high', 'low', 'close']
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLABANDONEDBABY.__doc__ = talib.CDLABANDONEDBABY.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLADVANCEBLOCK(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLADVANCEBLOCK, 'TA_CDLADVANCEBLOCK', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLADVANCEBLOCK = talib.CDLADVANCEBLOCK.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLBELTHOLD(ind=None):
imp = crtTaIndicatorImp(ta.CDLBELTHOLD, 'TA_CDLBELTHOLD', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLBELTHOLD.__doc__ = talib.CDLBELTHOLD.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLBREAKAWAY(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLBREAKAWAY, 'TA_CDLBREAKAWAY', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLBREAKAWAY.__doc__ = talib.CDLBREAKAWAY.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLCLOSINGMARUBOZU(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLCLOSINGMARUBOZU, 'TA_CDLCLOSINGMARUBOZU', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLCLOSINGMARUBOZU.__doc__ = talib.CDLCLOSINGMARUBOZU.__doc__
def TA_CDLCONCEALBABYSWALL(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLCONCEALBABYSWALL, 'TA_CDLCONCEALBABYSWALL', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLCONCEALBABYSWALL.__doc__ = talib.CDLCONCEALBABYSWALL.__doc__
def TA_CDLCOUNTERATTACK(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLCOUNTERATTACK, 'TA_CDLCOUNTERATTACK', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLCOUNTERATTACK.__doc__ = talib.CDLCOUNTERATTACK.__doc__
def TA_CDLDARKCLOUDCOVER(ind=None, penetration=0.5):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLDARKCLOUDCOVER,
'TA_CDLDARKCLOUDCOVER',
result_num=1,
params={'penetration': penetration},
prices=['open', 'high', 'low', 'close']
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLDARKCLOUDCOVER.__doc__ = talib.CDLDARKCLOUDCOVER.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLDOJI(ind=None):
imp = crtTaIndicatorImp(ta.CDLDOJI, 'TA_CDLDOJI', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLDOJI.__doc__ = talib.CDLDOJI.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLDOJISTAR(ind=None):
imp = crtTaIndicatorImp(ta.CDLDOJISTAR, 'TA_CDLDOJISTAR', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLDOJISTAR.__doc__ = talib.CDLDOJISTAR.__doc__
def TA_CDLDRAGONFLYDOJI(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLDRAGONFLYDOJI, 'TA_CDLDRAGONFLYDOJI', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLDRAGONFLYDOJI.__doc__ = talib.CDLDRAGONFLYDOJI.__doc__
def TA_CDLENGULFING(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLENGULFING, 'TA_CDLENGULFING', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLENGULFING.__doc__ = talib.CDLENGULFING.__doc__
def TA_CDLEVENINGDOJISTAR(ind=None, penetration=0.3):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLEVENINGDOJISTAR,
'TA_CDLEVENINGDOJISTAR',
result_num=1,
params={'penetration': penetration},
prices=['open', 'high', 'low', 'close']
)
return Indicator(imp)(ind) if ind else Indicator(imp)
TA_CDLEVENINGDOJISTAR.__doc__ = talib.CDLEVENINGDOJISTAR.__doc__
def TA_CDLEVENINGSTAR(ind=None, penetration=0.3):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLEVENINGSTAR,
'TA_CDLEVENINGSTAR',
result_num=1,
params={'penetration': penetration},
prices=['open', 'high', 'low', 'close']
)
return Indicator(imp)(ind) if ind else Indicator(imp)
TA_CDLEVENINGSTAR.__doc__ = talib.CDLEVENINGSTAR.__doc__
def TA_CDLGAPSIDESIDEWHITE(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLGAPSIDESIDEWHITE, 'TA_CDLGAPSIDESIDEWHITE', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLGAPSIDESIDEWHITE.__doc__ = talib.CDLGAPSIDESIDEWHITE.__doc__
def TA_CDLGRAVESTONEDOJI(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLGRAVESTONEDOJI, 'TA_CDLGRAVESTONEDOJI', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLGRAVESTONEDOJI.__doc__ = talib.CDLGRAVESTONEDOJI.__doc__
def TA_CDLHAMMER(ind=None):
imp = crtTaIndicatorImp(ta.CDLHAMMER, 'TA_CDLHAMMER', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLHAMMER.__doc__ = talib.CDLHAMMER.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLHANGINGMAN(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLHANGINGMAN, 'TA_CDLHANGINGMAN', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLHANGINGMAN.__doc__ = talib.CDLHANGINGMAN.__doc__
def TA_CDLHARAMI(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLHARAMI,
'TA_CDLHARAMI',
result_num=1,
2024-01-03 14:50:57 +08:00
# params={'penetration': penetration},
2020-07-11 18:26:23 +08:00
prices=['open', 'high', 'low', 'close']
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLHARAMI.__doc__ = talib.CDLHARAMI.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLHARAMICROSS(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLHARAMICROSS, 'TA_CDLHARAMICROSS', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLHARAMICROSS.__doc__ = talib.CDLHARAMICROSS.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLHIGHWAVE(ind=None):
imp = crtTaIndicatorImp(ta.CDLHIGHWAVE, 'TA_CDLHIGHWAVE', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLHIGHWAVE.__doc__ = talib.CDLHIGHWAVE.__doc__
def TA_CDLHIKKAKE(ind=None):
imp = crtTaIndicatorImp(ta.CDLHIKKAKE, 'TA_CDLHIKKAKE', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLHIKKAKE.__doc__ = talib.CDLHIKKAKE.__doc__
def TA_CDLHIKKAKEMOD(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLHIKKAKEMOD, 'TA_CDLHIKKAKEMOD', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLHIKKAKEMOD.__doc__ = talib.CDLHIKKAKEMOD.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLHOMINGPIGEON(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLHOMINGPIGEON, 'TA_CDLHOMINGPIGEON', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLHOMINGPIGEON.__doc__ = talib.CDLHOMINGPIGEON.__doc__
def TA_CDLIDENTICAL3CROWS(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLIDENTICAL3CROWS, 'TA_CDLIDENTICAL3CROWS', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLIDENTICAL3CROWS.__doc__ = talib.CDLIDENTICAL3CROWS.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLINNECK(ind=None):
imp = crtTaIndicatorImp(ta.CDLINNECK, 'TA_CDLINNECK', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLINNECK.__doc__ = talib.CDLINNECK.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLINVERTEDHAMMER(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLINVERTEDHAMMER, 'TA_CDLINVERTEDHAMMER', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLINVERTEDHAMMER.__doc__ = talib.CDLINVERTEDHAMMER.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLKICKING(ind=None):
imp = crtTaIndicatorImp(ta.CDLKICKING, 'TA_CDLKICKING', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLKICKING.__doc__ = talib.CDLKICKING.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLKICKINGBYLENGTH(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLKICKINGBYLENGTH, 'TA_CDLKICKINGBYLENGTH', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLKICKINGBYLENGTH.__doc__ = talib.CDLKICKINGBYLENGTH.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLLADDERBOTTOM(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLLADDERBOTTOM, 'TA_CDLLADDERBOTTOM', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLLADDERBOTTOM.__doc__ = talib.CDLLADDERBOTTOM.__doc__
def TA_CDLLONGLEGGEDDOJI(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLLONGLEGGEDDOJI, 'TA_CDLLONGLEGGEDDOJI', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLLONGLEGGEDDOJI.__doc__ = talib.CDLLONGLEGGEDDOJI.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLLONGLINE(ind=None):
imp = crtTaIndicatorImp(ta.CDLLONGLINE, 'TA_CDLLONGLINE', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLLONGLINE.__doc__ = talib.CDLLONGLINE.__doc__
def TA_CDLMARUBOZU(ind=None):
imp = crtTaIndicatorImp(ta.CDLMARUBOZU, 'TA_CDLMARUBOZU', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLMARUBOZU.__doc__ = talib.CDLMARUBOZU.__doc__
def TA_CDLMATCHINGLOW(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLMATCHINGLOW, 'TA_CDLMATCHINGLOW', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLMATCHINGLOW.__doc__ = talib.CDLMATCHINGLOW.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLMATHOLD(ind=None, penetration=0.5):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLMATHOLD,
'TA_CDLMATHOLD',
result_num=1,
params={'penetration': penetration},
prices=['open', 'high', 'low', 'close']
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLMATHOLD.__doc__ = talib.CDLMATHOLD.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLMORNINGDOJISTAR(ind=None, penetration=0.3):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLMORNINGDOJISTAR,
'TA_CDLMORNINGDOJISTAR',
result_num=1,
params={'penetration': penetration},
prices=['open', 'high', 'low', 'close']
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLMORNINGDOJISTAR.__doc__ = talib.CDLMORNINGDOJISTAR.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLMORNINGSTAR(ind=None, penetration=0.3):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLMORNINGSTAR,
'TA_CDLMORNINGSTAR',
result_num=1,
params={'penetration': penetration},
prices=['open', 'high', 'low', 'close']
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLMORNINGSTAR.__doc__ = talib.CDLMORNINGSTAR.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLONNECK(ind=None):
imp = crtTaIndicatorImp(ta.CDLONNECK, 'TA_CDLONNECK', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLONNECK.__doc__ = talib.CDLONNECK.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLPIERCING(ind=None):
imp = crtTaIndicatorImp(ta.CDLPIERCING, 'TA_CDLPIERCING', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLPIERCING.__doc__ = talib.CDLPIERCING.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLRICKSHAWMAN(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLRICKSHAWMAN, 'TA_CDLRICKSHAWMAN', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLRICKSHAWMAN.__doc__ = talib.CDLRICKSHAWMAN.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLRISEFALL3METHODS(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLRISEFALL3METHODS, 'TA_CDLRISEFALL3METHODS', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLRISEFALL3METHODS.__doc__ = talib.CDLRISEFALL3METHODS.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLSEPARATINGLINES(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLSEPARATINGLINES, 'TA_CDLSEPARATINGLINES', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLSEPARATINGLINES.__doc__ = talib.CDLSEPARATINGLINES.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLSHOOTINGSTAR(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLSHOOTINGSTAR, 'TA_CDLSHOOTINGSTAR', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLSHOOTINGSTAR.__doc__ = talib.CDLSHOOTINGSTAR.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLSHORTLINE(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLSHORTLINE, 'TA_CDLSHORTLINE', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLSHORTLINE.__doc__ = talib.CDLSHORTLINE.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLSPINNINGTOP(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLSPINNINGTOP, 'TA_CDLSPINNINGTOP', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLSPINNINGTOP.__doc__ = talib.CDLSPINNINGTOP.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLSTALLEDPATTERN(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLSTALLEDPATTERN, 'TA_CDLSTALLEDPATTERN', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLSTALLEDPATTERN.__doc__ = talib.CDLSTALLEDPATTERN.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLSTICKSANDWICH(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLSTICKSANDWICH, 'TA_CDLSTICKSANDWICH', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLSTICKSANDWICH.__doc__ = talib.CDLSTICKSANDWICH.__doc__
def TA_CDLTAKURI(ind=None):
imp = crtTaIndicatorImp(ta.CDLTAKURI, 'TA_CDLTAKURI', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLTAKURI.__doc__ = talib.CDLTAKURI.__doc__
def TA_CDLTASUKIGAP(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLTASUKIGAP, 'TA_CDLTASUKIGAP', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLTASUKIGAP.__doc__ = talib.CDLTASUKIGAP.__doc__
def TA_CDLTHRUSTING(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLTHRUSTING, 'TA_CDLTHRUSTING', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLTHRUSTING.__doc__ = talib.CDLTHRUSTING.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLTRISTAR(ind=None):
imp = crtTaIndicatorImp(ta.CDLTRISTAR, 'TA_CDLTRISTAR', result_num=1, prices=['open', 'high', 'low', 'close'])
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLTRISTAR.__doc__ = talib.CDLTRISTAR.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLUNIQUE3RIVER(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLUNIQUE3RIVER, 'TA_CDLUNIQUE3RIVER', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLUNIQUE3RIVER.__doc__ = talib.CDLUNIQUE3RIVER.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLUPSIDEGAP2CROWS(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLUPSIDEGAP2CROWS, 'TA_CDLUPSIDEGAP2CROWS', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLUPSIDEGAP2CROWS.__doc__ = talib.CDLUPSIDEGAP2CROWS.__doc__
2020-07-11 18:26:23 +08:00
def TA_CDLXSIDEGAP3METHODS(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(
ta.CDLXSIDEGAP3METHODS, 'TA_CDLXSIDEGAP3METHODS', result_num=1, prices=['open', 'high', 'low', 'close']
2020-07-11 18:26:23 +08:00
)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CDLXSIDEGAP3METHODS.__doc__ = talib.CDLXSIDEGAP3METHODS.__doc__
2020-07-11 18:26:23 +08:00
def TA_BETA(ind=None, timeperiod=5):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.BETA, 'TA_BETA', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_BETA.__doc__ = talib.BETA.__doc__
2020-07-11 18:26:23 +08:00
def TA_CORREL(ind=None, timeperiod=30):
imp = crtTaIndicatorImp(ta.CORREL, 'TA_CORREL', result_num=1, params={'timeperiod': timeperiod})
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2020-07-11 18:26:23 +08:00
TA_CORREL.__doc__ = talib.CORREL.__doc__
2020-07-11 18:26:23 +08:00
def TA_OBV(ind=None):
2020-07-11 18:26:23 +08:00
imp = crtTaIndicatorImp(ta.OBV, 'TA_OBV', result_num=1)
2019-03-27 01:32:29 +08:00
return Indicator(imp)(ind) if ind else Indicator(imp)
2017-09-25 03:29:18 +08:00
2020-07-11 18:26:23 +08:00
TA_OBV.__doc__ = talib.OBV.__doc__
except:
2024-01-03 14:50:57 +08:00
pass # 非必须的talib不再打印告警以免误解提问
# print(
# "warning: can't import TA-Lib, will be ignored! You can fetch ta-lib "
# "from https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib"
# )