Feature Request: Join WeekEnd Time Gaps in Candlestick Plot and Custom Data Columns
See original GitHub issueHi!
I found the easiest solution to have a plot without holes For that I have to add a new column with merged dates, this solution is fine if you do not need the right dates.
1.I think easiest way to add this feature to PloText is to add second index which will be just counter Counter will be used for plotting without holes and Date column will be used for Displaying dates on plot
2.Additional will be awesome to add custom naming for columns, ‘Date’,‘Open’,‘High’,‘Low’,‘Close’ not the only one, lot of data feeds name columns as ‘t’,‘o’,‘h’,‘l’,‘c’
P.S. I’m not a Pandas expert so there should be much better way to create a new index column.
import yfinance as yf
import plotext as plt
plt.date_form('d/m/Y')
start = plt.string_to_datetime('11/08/2022')
end = plt.string_to_datetime('10/10/2022')
data = yf.download('goog', start, end)
Merge=True
if Merge:
l=[]
import time
import datetime
d0=time.mktime(data.index[0].timetuple()) # Start Date
for i,d in enumerate(data.index):
l.append(datetime.datetime.fromtimestamp(d0+i*86400))
data['index']=l # Add our merged dates to pandas dataframe
data=data.reset_index(drop=False) # Reset index with saving index data
data=data.set_index('index') # Set new dataframe index for timeline
dates = plt.datetimes_to_string(data.index)
plt.candlestick(dates, data,yside = 2)
plt.show()
Merge=False
Merge=True
Pandas :
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Plotting candlestick with matplotlib for time series w/o ...
As I understand, you want to plot candlestick chart with no gaps and to make xlables actual dates instead of integers. In order...
Read more >Candlestick gaps · Issue #1545 · altair-viz/altair
This usually has no data at weekends. Currently Altair's candlestick chart plots with gaps at weekends, which I've depicted using the red ...
Read more >How to Remove Weekend date data from stock candlestick ...
Dear Support, In the stock candle stick chart, we want to remove the weekend dates as no data will be available here. In...
Read more >Candlestick charts - Google Docs Editors Help
Use a candlestick chart to show the low, high, opening, and closing values of a security for a specific period. For example, get...
Read more >Timelines | Charts
One popular type of timeline is the Gantt chart. ... In this code, we've inserted a new column into our data to hold...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @ineteye, I will come back to this later on. Thanks for updating about it! All the best, Savino.
Checked mplfinance candlestick plots and they did not use column naming at all. Stock data always in format like that: ‘Date’,‘Open’,‘High’,‘Low’,‘Close’,‘Volume’ Column naming maybe different but order always like that, best options will be to use column order and not naming at all.