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
0
votes
2 answers

Plotting a candlestick with mplfinance

I want to plot a candlestick graph with data that keeps getting updated but I'm facing some trouble. So I have successfully used mplfinance to plot the candlestick but I can't find a way to clear the plot and update the plot every time new data…
Cho
  • 1
  • 1
0
votes
1 answer

How to properly add a percentage change box inside a Japanese Candlestick chart using MatPlotLibFinance on Python3?

Context I'm trying to figure out a good way to add percentage price change boxes inside a custom Japanese Candlestick chart that I have made using the MatPlotLibFinance library on Python3, these percentage price change boxes will help to visually…
0
votes
0 answers

How to mplfinance.plot's X-axis

I got a quote like this: t1 = pd.to_datetime('2022-01-01') t2 = pd.to_datetime('2022-01-02') quotes = {'datetime':[t1,t2], 'open':[10.0,11.0], 'high':[11.0,12.0], 'low':[9.0,10.0], 'close':[10.0,11.0], …
pekinghua
  • 11
  • 1
0
votes
2 answers

Pandas Series of dates to vlines kwarg in mplfinance plot

import numpy as np import pandas as pd df = pd.DataFrame({'dt': ['2021-2-13', '2022-2-15'], 'w': [5, 7], 'n': [11, 8]}) df.reset_index() print(list(df.loc[:,'dt'].values)) gives: ['2021-2-13',…
JeeyCi
  • 354
  • 2
  • 9
0
votes
2 answers

Changing mplfinance chart styling when "returnfig=True" is not being accepted anywhere in the code

I am trying to change the axis titles and font size in multiple charts that are plotted using mpf.plot and fig.add_axes to place them on screen. I have understood the process and examples given in this link How to change font size and font type in…
mdkb
  • 372
  • 1
  • 14
0
votes
1 answer

Plot multiple charts from a number of yFinance tickers

The below code works to create one chart from "stock1" taken from Yfinance. I am now trying to plot multiple charts using "myTickers" to collect a set of tickers from YFinance. I can get the data, but I can't get it to plot that data to multiple…
mdkb
  • 372
  • 1
  • 14
0
votes
1 answer

Datetime format in Matplotlib and mplfinance

I'm new to data science and I'm trying to plot the stock ohlc from a csv file which has data from 2000 to 2020. I'd like to show the year on the x-axis but it only shows the month. How can I only show the year? I'd also like to revert and limit the…
Aryan Hab
  • 45
  • 1
  • 8
0
votes
2 answers

Plotting candlestick chart and executions in mplfinance

I am trying to do the following: Plot a 5 minute candle stick chart for a particular day. Plot my executions on top of the candle stick chart as a scatter plot. Candle stick data is in the conventional format data frame: Datetime Index, Open,…
Dmitry
  • 145
  • 9
0
votes
1 answer

Matplotlib / Mplfinance - how to change line width

maybe someone knows what I need add here to change line width? mpf.plot(df4, type='candle', style='yahoo', volume=True, hlines=[12,4], )
AndriusJ
  • 9
  • 6
0
votes
1 answer

How Do I Plot Indicator Lines Using mplfinance and pandas ta?

I have the following code: import MetaTrader5 as mt5 import pandas as pd import time import pandas_ta as ta import mplfinance as mpf pd.set_option('display.max_columns', 500) pd.set_option('display.width', 1500) if not mt5.initialize(): …
Fingers
  • 373
  • 3
  • 18
0
votes
0 answers

How to draw a horizontal line on a real-time Candlestick chart using mplfinance new API?

I am updating a real-time candlestick chart project from mpl_finance to mplfinance, and some parts of the code stopped working. For example I am unable to draw horizontal lines once the chart is shown and being updated with new incoming…
MBS
  • 9
  • 3
0
votes
1 answer

Unix ms timestamp pandas index (plotting polygon.io data with mplfinance)

I am pulling data from polygon.io and it returns time as a Unix Msec timestamp as below, afterwhich I am having trouble converting this to a index that is useable by mplfinance that is expecting TypeError: Expect data.index as DatetimeIndex. I have…
morleyc
  • 2,169
  • 10
  • 48
  • 108
0
votes
2 answers

Generating one NumPy array for each DataFrame row

I'm attempting to plot stock market trades against a plot of the particular stock using mplfinance.plot(). I keep record of all my trades using jstock which uses as CSV file: "Code","Symbol","Date","Units","Purchase Price","Current Price","Purchase…
0
votes
2 answers

how to add image to plot mplfinance python

Trying to add image and price label and add more space on time and it seems like ylim= takes care of that but when i add it my whole graph disappears. market_colors = mpf.make_marketcolors( base_mpf_style="charles" ) rc = { …
NoNam4
  • 457
  • 1
  • 4
  • 12
0
votes
1 answer

clear memory used by mplfinance

I'm using mplfinance module to plot candlesticks. The problem is mplfinance uses too much memory when it generates plots. I have tried the instructions mentioned in free up the memory used by matplotlib but nothing changed and my code is still…
1 2 3
10
11