ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Python version of QChartViewer and Max Drawdown Indicator
Posted by Rafael on Oct-30-2022 01:59
Attachments:
Hi,

first, I'd like to congrats everyone behind the whole project, I'm adding it to a personal project and it's being a pleasure to work with.

I have 2 questions if you don't mind,

1) Is there a python version of the QChartViewer implementation, I'd like to use some of its features like the rate limit etc, to do a more "real-time" updates to the financial graph, I'm currently using the good old QLabel to plot it.

2) I need to plot in a subgraph, or like an indicator bellow my main candlestick graph, the max drawdown, looking in the list of indicators available in the Python version I don't see any related to drawdown, I'm already calculating it using pandas, I just need a way to plot it. The question is, does the python lib support creating custom indicators? because I didn't see any example of this, only importing already build indicators.

I'm attaching an example from matplotlib of the max drawdown that I'm trying to port to FinanceChart. it goes from 0 to a certain percentage, and a custom label, Max Drawdown.

Thank you very much!
Drawdown.png
graph.png

  Re: Python version of QChartViewer and Max Drawdown Indicator
Posted by Peter Kwan on Oct-30-2022 18:03
Hi Rafael,

1) For using ChartDirector for Python with Qt, I believe you have already found an example and posted it in the following thread:

https://www.chartdir.com/forum/download_thread.php?site=chartdir&bn=chartdir_support&thread=1654443825#N1667066677

2. For the max drawdown indicator, ChartDirector FinanceChart allows you to add custom indicators. Basically, you may provide an array of values (similar to the closeData array, except that it contains your customer indicator), and you can ask ChartDirector for plot it as an indicator chart.

https://www.advsofteng.com/doc/cdpython.htm#FinanceChart.addLineIndicator.htm
https://www.advsofteng.com/doc/cdpython.htm#FinanceChart.addBarIndicator.htm

You can also add extra lines, bars or other chart types to the main price chart or to an existing indicator chart. The full API is at:

https://www.advsofteng.com/doc/cdpython.htm#FinanceChart.htm

Best Regards
Peter Kwan