

hoffmanroni
@hoffmanroni
•
Joined Feb 2024 •
Active 5 months ago
Forum Replies Created
-
sorry got it now, thanks, pls disregard
-
Seems to be ok now. I’m not sure what happened but when I tried a few days ago it was missing but now its there, all good thanks.
-
FYI if anyone is interested I was able to get this working now
py script
import pandas as pd from ta.utils import dropna from ta.volatility import BollingerBands def returnBB(df, window=20, window_dev=2): indicator_bb = BollingerBands(close=df["close"], window=20, window_dev=2) # Add Bollinger Bands features df['bb_bbm'] = indicator_bb.bollinger_mavg() df['bb_bbh'] = indicator_bb.bollinger_hband() df['bb_bbl'] = indicator_bb.bollinger_lband() # Add Bollinger Band high indicator df['bb_bbhi'] = indicator_bb.bollinger_hband_indicator() # Add Bollinger Band low indicator df['bb_bbli'] = indicator_bb.bollinger_lband_indicator() return df
and then q script
//load above .p script l bb.p
//make returnBB py func callable in q
func:.p.get`returnBB
//conv t to dataframe, pass to the py func and then conv back to qtable .ml.df2tab[func[.ml.tab2df[t]]]