matplotlib / matplotlib/mplfinance

how to show more area at the far right side of the Ichimoku Cloud Chart

Open
#691 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
4.4k
Forks
678
PR merge metrics
No merged PRs in 30d

Description

Greeting!
I am a newbie in Python, and I greatly appreciate this brilliantly made built-in package for visualization of yfinance data.
I am learning and trying to plot the Ichimoku Cloud Chart, and found that the plot displayed would show with the x-axis limited at the latest data date, while the Ichimoku indicator actually would plot the cloud area 26days into future.

I tried to extend the x-axis using the xlim() function to extend 1 month into future, but the cloud still is not shown in the plot.

I have checked and make sure that in my calculations, the shift() function is applied to the calculation of the 3 lines, Leading Span A, Leading Span B, and Lagging Span. Thus I believe that there would be data to be plotted for the future date.

The first chart below is the plot generated from my broken code.
And the lower chart is a chart I got from a free online platform. I target to make my plot look more or less like this.
May I get help on how I can correctly plot the cloud for the Ichimoku chart?

Thanks in advance.

This is the chart plotted from my broken python code
![Image](https://github.com/user-attachments/assets/3fd2780e-4011-4ce6-b5d2-6b4270ef6f9d)

This is the chart I got from a free online platform. I target to make my plot look more or less like this.
![Image](https://github.com/user-attachments/assets/eef92a57-e206-440d-bdcb-24692ffe499b)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue mentions mplfinance plotting, xlim(), and shifted Ichimoku lines, but provides no source file, runnable example, or test to start from. Reproduce the reported chart behavior with the supplied screenshots and determine what complete future cloud rendering should look like before adding a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.