Questions tagged [mplfinance]

questions relating to python package "mplfinance" (which is part of the "matplotlib" organization)

How to Install

# at the Anaconda prompt if using the Anaconda distribution
conda install -c conda-forge mplfinance

# if not using Anaconda
pip install --upgrade mplfinance
163 questions
1
vote
1 answer

How do you resample dates with mplfinance?

I'm trying to resample by daily data to 5 Day periods instead where it will give me a tickers price each 5 days instead of each day (like it shows in my csv file). I'm aware how to do this with the old 'from matplotlib.finance import…
1
vote
1 answer

Does anyone have an example of how to plot an mplfinance candlestick chart to a tkinter gui?

I can make many kinds of plots to tkinter canvases using matplotlib, but I'm unable to figure out how to do this using the mplfinance plot types, in which as I understand plotting is rather automated and high level such that the call 'owns' fig and…
hagbard13
  • 41
  • 4
1
vote
1 answer

How do i draw on top of a chart in Matplotlib Finance?

I created a chart using MPL Finance, here is how i did it: chart = mpf.plot(df, type='candle', figratio=(20,9), style="nightclouds", savefig='plottedCharts/TEST.png', volume=True) Where df is my Pandas dataframe. I'm trying to add square dots to…
San9096
  • 231
  • 4
  • 12
1
vote
1 answer

Matplotlib.finance not responding after downloading mplfinance in Terminal. Error: No module named 'matplotlib.finance'

I am trying to create a candlestick / OHLC graph in jupyter notebook using closing stock data extracted from Stooq. I tried several different things to try and install mplfinance to get the candlestick_ohc imported, and keep getting different error…
none
  • 33
  • 1
  • 7
1
vote
1 answer

Remove empty space between two dates in candlestick_ohlc chart

I have a dataframe with columns as ['Datetime', 'Open', 'High', 'Low', 'Close', 'Symbol'] I want to plot the OHLC Chart using candlestick_ohlc. Sample Data here: Data My Code as below: import pandas as pd import numpy as np import time, os,…
1
vote
6 answers

ModuleNotFoundError: No module named 'mpl_finance'

Hi I am following a tutorial that was using matplotlib.finance to use candlestick.ohlc. When researching I found out that that lib was deprecated and to use mlp_finance. I believe I have installed it by running the command prompt and entering the…
JoeyDiaz
  • 137
  • 1
  • 2
  • 12
0
votes
1 answer

EMA lines not with the rest of the graph

When you load up the code, it's supposed to plot the Candlestick chart and the 4 EMA lines over each other, but they are separated. I'm currently testing the code on Tesla stocks for the example I am showing here. Code: import yfinance as yf import…
Damian
  • 29
  • 5
0
votes
0 answers

question about a plot candlestick chart with pyqt5

I am wondering about embedding a plot widget about candlestick chart in pyqt5. The following python codes are for ploting candlestick chart and when it is under the main program, the chart is being plotted in main window. it were under the main…
Joon
  • 1
  • 1
0
votes
1 answer

The legend is not working with candlestick

#Import import numpy as np import yfinance as yf import matplotlib.pyplot as plt from mplfinance.original_flavor import candlestick_ohlc import matplotlib.dates as mdates #Dates to get stocks start_date = "2020-01-01" end_date = "2023-05-08" #Get…
Damian
  • 29
  • 5
0
votes
0 answers

mplfinance - plotting the trades of an automated strategy against price candlesticks - having issues with "duplicate labels" in index?

I have price data for a ticker which I have inserted into a dataframe with the following columns. ["timestamp", "open", "high", "low", "close"] I am trying to display 15-second candles and this portion of my code works correctly. When I create the…
0
votes
1 answer

Remove the stack bars

ap = [ mpf.make_addplot(df['VWAP'], color='blue', width=0.8, panel=0, ylabel='VWAP ($)'), mpf.make_addplot(df['volume'], type='bar', color='dimgray', width=0.8, panel=1, ylabel='Volume', …
David
  • 13
  • 5
0
votes
1 answer

mplfinance plot plots correctly but has strange datetime format

I am plotting stock data with mplfinance and it works well. But I am having trouble getting the right dates from the x-axis. When I use this code the function on_mouse_click shows results like 1970-02-02 and 65.6. The 65.6 is obviously right, but I…
finny
  • 21
  • 7
0
votes
1 answer

Panel is overlapping and has a wrong ratio in mplfinance plot

I'm trying to plot a subplot but there are two problems. #1 The panel_ratio setting (6,1) is unnoticed. #2 The y axis of the top panel juts down and overlaps the y axis of the bottom panel, so that the bars are trimmed in the top panel What is…
stanvooz
  • 522
  • 3
  • 19
0
votes
0 answers

Stumped. How do I convert my datetime format to an acceptable format for pandas and mplfinance?

I am trying to use various charting packages for ohlc bar charting. Some success but I keep getting stuck on "TypeError: Expect data.index as DatetimeIndex". The samples that I copy work perfectly fine, like this below: import yfinance as…
Jimbo
  • 3
  • 3
0
votes
0 answers

Plot Symmetric Triangle on a Stock chart created using MplFinance Animation

I have to create a plot like above on the live candle stick plot I have created. And it also needs to be updated in real-time as the news candles are formed. Can anyone help me out here? I have already tried the tlines parameter of mplfinance.