JKQtPlotter/examples/financialgraphs
2024-02-11 14:18:50 +01:00
..
CMakeLists.txt NEW: added financial graphs (Candlestick or OHLC) and example for these 2024-02-11 14:18:50 +01:00
financialgraphs.cpp NEW: added financial graphs (Candlestick or OHLC) and example for these 2024-02-11 14:18:50 +01:00
README.md NEW: added financial graphs (Candlestick or OHLC) and example for these 2024-02-11 14:18:50 +01:00

Example (JKQTPlotter): Financial Chart (Candlestick/OHLC) Example

This project (see financialgraphs demonstrates the use of JKQTPFinancialGraph to visualize financial data (i.e. market price development of stocks, derivatives, ...).

The source code of the main application is (see financialgraphs.cpp.

Here is a short summary of the important parts of the code:

The result looks like this:

financialgraphs

By default, the length of the drawn vector is determined from the actual length in the data via an autoscaling algorithm that is supposed to prevent the vectors from overlapping. But you can modify this behaviour by adding a line

        graph1->setVectorLengthMode(JKQTPVectorFieldGraph::LengthFromData);

which will use the given lengths directly (only scaled by an optional factor defined by JKQTPVectorFieldGraph::setLengthScaleFactor() ). The result then looks like this:

financialgraphs