Replies: 2 comments 3 replies
-
Beta Was this translation helpful? Give feedback.
-
Got the same error and was able to solve it by dropping the multiindex of the rsi function for the entry and exit values, and by providing just the values instead of the full dataframe which includes additional index values as well. import numpy as np btc_price = pd.read_csv("tutorial.csv")[['timestamp','close']] btc_price['date']= pd.to_datetime(btc_price["timestamp"],unit="s") btc_price=btc_price.set_index("date")[["close"]] rsi = vbt.RSI.run(btc_price, window = 14, short_name="rsi") entries = rsi.rsi_crossed_below(30) pf = vbt.Portfolio.from_signals(priceData['close'], |
Beta Was this translation helpful? Give feedback.
-
hi,
Following a youtube video to learn vectorbt
i am trying to plot
pf.plot().show()
and it gives me error "TypeError: Only one column is allowed. Use indexing or column argument."
if i use pf.plot(column="close").show()
the error i get is - KeyError: "Column 'close' not found"
have tried many approaches but i am stuck. chatgpt is of no help too.
thx in advance.
Beta Was this translation helpful? Give feedback.
All reactions