question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add text above all candlesticks

See original GitHub issue

I have 1 month data to plot. I already drew the candlestick chart. Now I wanna add text above all candlesticks. Here ia a question, the data length is about 40000, if I add text above all bars, that would be so slow and stucked in the UI rendering. Could I use ax.plot instead of fplt.add_text? How to realise it?

figure 1:

finplot_plottext_2

code:

class CandleText():

    def __init__(self, data, col_name, color):
        self.data = data
        self.col_name = col_name
        self.color = color
        self.high = self.data['high']

    def add_candle_text_all(self):
        date_ls = self.data
        print('add_candle_text_all index')
        date_index = self.data.index
        # print(date_index[-1])
        for i in tqdm(range(len(self.data))):
            fplt.add_text((date_index[i],self.high[i]), f'{self.high[i]}', self.color)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Vankeeecommented, Jun 21, 2022

@highfestiva Love you so much, you saved me. Here is another question, how to remove them all at once?


I found this funciton clear_items(drop_keys) in ScatterLabelItem class. I am confused about the “drop_keys”, what is drop_keys? How can I get the drop_keys?

0reactions
Vankeeecommented, Jun 24, 2022

It seems does not work. Fine, I give up, I’ll try it later. Thanks any way

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add a string comment above every single candle using ...
You should be able to do this using Axes.text(). After calling mpf.plot() then call ax1.text(). for each text that you want (in your...
Read more >
Add a number or a symbol above/below a candle chart with ...
Basically every number under/above a candle will be a call to make_addplot(), and it represents a reference to a signal. But I need...
Read more >
Candlestick Pattern Editor - thinkorswim Learning Center
The Candlestick Pattern Editor is a thinkorswim interface that allows you to create your own candlestick patterns in addition to the extensive list...
Read more >
Recognizing over 50 Candlestick Patterns with Python - Medium
Candlestick charts can be plotted to extract patterns from OHLC data for any tradable instrument. A candlestick pattern is a movement in prices ......
Read more >
Candlestick Patterns For Beginners (The Ultimate Guide)
Two common mistakes almost all new traders make when trading candlestick patterns—and how to avoid it 4. A powerful candlestick trading ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found