def test_basp(): """test TA.BASP""" basp = TA.BASP(ohlc).round(decimals=8) assert isinstance(basp["Buy."], series.Series) assert isinstance(basp["Sell."], series.Series) assert basp["Buy."].values[-1] == 0.06691681 assert basp["Sell."].values[-1] == 0.0914869
def test_basp(): """test TA.BASP""" basp = TA.BASP(ohlc) assert isinstance(basp["Buy."], series.Series) assert isinstance(basp["Sell."], series.Series) assert basp["Buy."].values[-1] == 0.066916805574281202 assert basp["Sell."].values[-1] == 0.091486900946605054
def test_basp(): '''test TA.BASP''' basp = TA.BASP(ohlc) assert isinstance(basp['Buy.'], series.Series) assert isinstance(basp['Sell.'], series.Series) assert basp['Buy.'].values[-1] == 0.066916805574281202 assert basp['Sell.'].values[-1] == 0.091486900946605054
def BASP(data, period=40): """ Buy and Sell Pressure BASP indicator serves to identify buying and selling pressure. :param pd.DataFrame data: pandas DataFrame with open, high, low, close data :param int period: period used for indicator calculation :return pd.Series: with indicator data calculation results """ return TA.BASP(data, period)
def get_basp(data): """Calculate the buying and selling pressure of given dataframe. :param data: a dataframe in OHLC format :return: a concatenated Pandas series """ if data is None: raise EmptyDataError("[!] Invalid data value") result = TA.BASP(data) if result is None: raise IndicatorException return result
prices["CFI"] = TA.CFI(ohlcv) # Bull and bear power prices["BullPower"], prices["BearPower"] = TA.EBBP(ohlc) # Ease of movement oscillator - distance from zero indicates ease (neg is down, positive is up) prices["EMI"] = TA.EMV(ohlcv) # Commodity Channel Index - above +100 is overbought, below -100 is oversold prices["CCI"] = TA.CCI(ohlc) # Coppock curve - momentum indicator (buy when it crosses from negative to positive prices["COPP"] = TA.COPP(ohlc) # Buying and selling pressure indicator prices["BASP_buy"], prices["BASP_sell"] = TA.BASP(ohlc) prices["BASPN_buy"], prices["BASPN_sell"] = TA.BASPN(ohlc) # Double exponential moving average - attempts to remove the moving average lag prices["DEMA"] = TA.DEMA(ohlc) # Triple exponential moving average - attempts to remove the moving average lag prices["TEMA"] = TA.TEMA(ohlc) # rate of change of TEMA - BUY/SELL triggered by zero crossings prices["TRIX"] = TA.TRIX(ohlc) prices["TRIX-signal"] = prices["TRIX"] / prices['TRIX'].ewm(span=9).mean() # Triangular moving average prices["TRIMA"] = TA.TRIMA(ohlc) # Volume adjusted moving average
def finta_basp(self): return TA.BASP(self.finta_data_frame, period=40).to_numpy()