You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def plot_candlestick_chart(self, hard_reset=False):
self.logger.info(f"plot_candlestick_chart")
candle_sizes = self.cmb_candle_size.currentText().split(",")
try:
candle_sizes = [int(val.strip()) for val in candle_sizes] # remove spaces
except:
self.logger.warning("wrong candle sizes")
return
ticker = self.cmb_ticker.currentText()
show_volume = self.checkbox_volume.isChecked()
self.ticker_subscribe.emit(ticker, int(candle_sizes[0]))
if candle_sizes[0] not in self.dfs:
return
# save window zoom position before resetting
if not hard_reset:
fplt.autoviewrestore()
fplt._savewindata(fplt.windows[0])
else:
fplt.autoviewrestore(enable=False)
if self.current_bar.close !=0:
df = pd.DataFrame([self.current_bar], columns=Bar._fields)
df.index = pd.DatetimeIndex(df['date']) # convert to datetimeindex
df_updating = pd.concat([ self.dfs[candle_sizes[0]], df])
price = df_updating['open close high low'.split()]
else:
price = self.dfs[candle_sizes[0]]['open close high low'.split()]
self.plot_candles.candlestick_ochl(price)
if show_volume is True:
volume = self.dfs[candle_sizes[0]]['open close volume'.split()]
self.ax_volume.reset() # remove previous plots
fplt.volume_ocv(volume, ax=self.ax_volume)
# restores saved zoom position, if in range
fplt.refresh() # refresh autoscaling when all plots complete
Describe the bug
In some cases, not clear when I start getting this errors on console; this happens when I move the mouse over the chart.
Inspection error: <class 'IndexError'> list index out of range
Inspection error: <class 'IndexError'> list index out of range
Inspection error: <class 'IndexError'> list index out of range
Inspection error: <class 'IndexError'> list index out of range
Expected behavior
Understand what is wrong
Screenshots
The text was updated successfully, but these errors were encountered:
I'm guessing you've got a callback (from finplot.set_mouse_callback(... 'hover')) that is causing the list out of range. Add a try...except in your callback to figure out what you're doing wrong.
Requirements (place an
x
in each of the[ ]
)**pip install -U finplot
).Code to reproduce
Plotting code:
Describe the bug
In some cases, not clear when I start getting this errors on console; this happens when I move the mouse over the chart.
Inspection error: <class 'IndexError'> list index out of range
Inspection error: <class 'IndexError'> list index out of range
Inspection error: <class 'IndexError'> list index out of range
Inspection error: <class 'IndexError'> list index out of range
Expected behavior
Understand what is wrong
Screenshots
The text was updated successfully, but these errors were encountered: