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
2
votes
1 answer

Custom hlines in mplfinance python

I am plotting four horizontal lines using the statement below. For one of the lines I would like to use a different format (color and line style) than the other three…
bryanavl
  • 23
  • 3
2
votes
2 answers

Python mplfinance addplot question. Add Entry Signal

does anyone know how to add an entry signal onto my graph so that I can see it visually? I want to see an entry signal on my graph when the SPY price hits $411.50. I've read through everything I can find online regarding this topic including the…
sir_2727
  • 51
  • 4
2
votes
3 answers

mplfinance xaxis ticks every n minutes, but not if datapoint doesn't exist

Checking I am not re-inventing the wheel here, with mplfinance I would like to have ticks on the x-axis every 15 minutes, but only if data exists. Plotting direct to mplfinance (without returnfig=True) the plot is ok except the xaxis which values…
morleyc
  • 2,169
  • 10
  • 48
  • 108
2
votes
1 answer

Customize mplfinance plot python

I trying to change the color of filled shape and add image logo on the top left and price on the right but I don't want price and logo overlapping chart at self, is there is way to move it up? My code: def chartBuilber(self): df: DataFrame =…
NoNam4
  • 457
  • 1
  • 4
  • 12
2
votes
1 answer

How to add value of hlines in y axis using mplfinance python

Hello everyone and thank you for your help in advance. I have managed to plot a candlestick chart using mplfinance module in python and I have added some hlines to my plot. The problem is, I can't figure out how to add hlines value to yaxis of my…
Ali Moayed
  • 33
  • 5
2
votes
2 answers

Charting OHLC candle with SMA 200 using mplfinance plot function

I'm using mplfinance plot function to draw OHLC candlestick chart of a symbol. OHLC data is of 2 min timeframe. Also, I'm plotting sma 20 period and sma 200 period on the same chart. Because of sma200, the number of candles which are displayed on…
2
votes
1 answer

Python datframe plotting

I would like to plot a dataframe in pandas containing candlesticks, both increasing and decreasing candles must all be of the same color, except for some of my choice. I'm really struggling to find a solution. I tried mplfinance, plotly, finplot,…
2
votes
2 answers

Most efficient way to re-plot candlestick_ohlc from mplfinance

I have a pyplot figure in a tkinter GUI and I am trying to update candlestick_ohlc plot from mplfinance every second with live data. mySubplot = myFigure.add_subplot(111) Then running every second with new data mySubplot.clear() ... repeat all axis…
AndrewK
  • 271
  • 2
  • 16
2
votes
2 answers

Adding signals on the candle chart

I would like to plot signals on my chart is there is a way to do it on candle stick? I did the following and got stuck :( !pip install yfinance !pip install mplfinance import yfinance as yf import mplfinance as mpf import numpy as np import pandas…
Jocelyn AL
  • 67
  • 1
  • 8
2
votes
1 answer

How to add multiple dataframe columns to the basic mplfinance plot()

import yfinance as yf msft = yf.Ticker('MSFT') data = msft.history(period='6mo') import mplfinance as mpf data['30 Day MA'] = data['Close'].rolling(window=20).mean() data['30 Day STD'] = data['Close'].rolling(window=20).std() data['Upper Band'] =…
user1424739
  • 11,937
  • 17
  • 63
  • 152
2
votes
1 answer

Have a problem, when I work with external_axes

I need to add to the plot some text and I tried to use your guide "How to use your own matplotlib Figure and Axes in mplfinance". But i have an error: "ValueError: make_addplot() ax kwargs must all be of type matplotlib.axis.Axes" My code: …
Kyrylo
  • 45
  • 1
  • 6
2
votes
2 answers

How to show alternative calendar dates in mplfinance?

TL;DR - The issue I have an mplfinance plot based on a pandas dataframe in which the indices are in Georgian calendar format and I need to have them displayed as Jalali format. My data and code My data looks like this: open high …
2
votes
2 answers

How to display the candle above the other lines in plot using mplfinance?

I wanted to draw the candle above lines. But in my plot, all lines are over the candle. So I'm wondering how I draw the candle "on" the line. Any opinions would be helpful. apds = […
kjssag
  • 21
  • 2
2
votes
2 answers

When using external axes method to plot multiple candlestick charts using mplfinance library, how to plot volume inside the candlestick chart?

The project I am doing requires code to plot more than 300 candlestick charts in several figures using mplfinance library. I am aware that this can only be done using external axes method as it provides more flexibilities and can plot unlimited…
2
votes
2 answers

matplotlib.axis.axes error in mplfinance for volume

I am working with stock data which looks like daily.head My code is: import pandas as pd import mplfinance as mpf import matplotlib.pyplot as plt data = pd.read_csv('/content/drive/MyDrive/python/TEchAnalysis.csv') figdims=(15,10) fig , ax =…
1 2
3
10 11