team172011 / TAcharting

A charing application to download, plott and analyse securities, indicators, strategies and trading records
Other
62 stars 18 forks source link

MVN does not work #19

Open sf202020sf opened 4 years ago

sf202020sf commented 4 years ago

We I install via mvn I get the following error:

[ERROR] /TAcharting/src/main/java/org/sjwimmer/tacharting/implementation/model/api/YahooSettingsManager.java:[22,29] package javafx.beans.property does not exist [ERROR] TAcharting/src/main/java/org/sjwimmer/tacharting/implementation/model/api/YahooSettingsManager.java:[23,26] package javafx.collections does not exist [ERROR] TAcharting/src/main/java/org/sjwimmer/tacharting/implementation/model/api/YahooSettingsManager.java:[24,19] package javafx.fxml does not exist [ERROR] TAcharting/src/main/java/org/sjwimmer/tacharting/implementation/model/api/YahooSettingsManager.java:[25,19] package javafx.fxml does not exist [ERROR] /TAcharting/src/main/java/org/sjwimmer/tacharting/implementation/model/api/YahooSettingsManager.java:[27,27] package javafx.scene.layout does not exist [ERROR] TAcharting/src/main/java/org/sjwimmer/tacharting/implementation/model/api/YahooSettingsManager.java:[46,13] cannot find symbol

can you help?

team172011 commented 4 years ago

Hi @sf202020sf I have not been working on this project for a long time :) I can reproduce your issue and this seems to be very strange because maven compiler level requires java 1.8 and also my IDE language level is configured using java 1.8. And in jdk 1.8 javafx classes should be included (I mean that time I wrote it and it worked)

The should only become unavailable if you use a java version that is > 1.8. So far I could not find the reason for this...

team172011 commented 4 years ago

I found out that it works for me when I use mvn from command line, but when I use it in my ide (eclipse) it fails with the same error messages like yours. I think this is caused by the jdk version that is used by maven and if you have an jdk defined that is > 1.8 you have to change it to one that is 1.8 because javafx has been extracted in newer versions of the jdk image

sf202020sf commented 4 years ago

thanks for your reply - yes this causes the issue I am working with higher JDK --> do you have any recommendation for charting of Ta4j strategies? where did you move? are working still on trading on such topics?

team172011 commented 4 years ago

This app uses jfreechart, but it seems to be outdated. Currently I am looking at https://knowm.org/open-source/xchart/ and I am planning to build a lightweighted app for plotting ta4j series, indicators and strategies in a more generic way

team172011 commented 4 years ago

If you are interested I can push my code that is using xchart to a repo. It is not much, but the basic idea is, that you have a kind of "ChartBuilder" to which you can add several series, indicators and strategies

sf202020sf commented 4 years ago

yes that would be great --> does it work with Ta4j indicator?

team172011 commented 4 years ago

yes, so far it works with barSeries and indicators. It is not much, currently I try to find a way of how to display strategies, because xChart seems to be limited here as well.

It works like this:

    public static void main(String[] args) {

        // 1 Create some barSeries and indicators
        BarSeries barSeries = loadAppleIncSeries();
        HighPriceIndicator highPrice = new HighPriceIndicator(barSeries);
        ClosePriceIndicator closePrice = new ClosePriceIndicator(barSeries);

        // 2 Add them to a ChartBuilder instance
        ChartBuilderImpl chartBuilderImpl = new ChartBuilderImpl();
        chartBuilderImpl.addBarSeries(barSeries);
        chartBuilderImpl.addIndicator("High Price Indicator", highPrice);
        chartBuilderImpl.addIndicator("Close Price Indicator", closePrice);

        javax.swing.SwingUtilities.invokeLater(() -> {

            JFrame frame = new JFrame("Ta4j charting");
            frame.setLayout(new BorderLayout());
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

            // 3 add the plot to a JFrame
            frame.add(chartBuilderImpl.createPlot());
            frame.pack();
            frame.setVisible(true);

        });

    }

image

I will push it to a new repo later today

team172011 commented 4 years ago

https://github.com/team172011/ta4jCharting