From 6324b256ce0b5e036b70c59c6c4f3af278db05dd Mon Sep 17 00:00:00 2001 From: christian dubettier Date: Sun, 13 Dec 2020 21:22:30 +0100 Subject: [PATCH 01/19] first draft --- .../expected_result_stripped_quotes.xml | 316 +- bourse/TEST_DATA/huge_quotes.xml | 624 +- bourse/TEST_DATA/portfolio_9_dec_2016.xml | 16379 ++++++++++++---- ...folio_withLastQuotationIntradayInvalid.xml | 236 +- ...tfolio_withLastQuotationNextDayInvalid.xml | 272 +- bourse/TEST_DATA/quotes.dtd | 8 - bourse/TEST_DATA/real_data.xml | 413 +- bourse/TEST_DATA/stock_and_quotes.xml | 216 +- .../database/jooq/public_/tables/Quotes.java | 40 - .../java/net/tuxanna/portefeuille/Quote.java | 338 +- .../business_logic/PortfolioManagement.java | 56 +- .../boursorama/BoursoramaParser.java | 24 +- .../portefeuille/database/Database.java | 296 +- .../database/SearchQuoteAtOneDay.java | 2 +- .../database/SearchQuoteStandard.java | 59 +- .../tuxanna/portefeuille/util/DigitValue.java | 9 +- .../boursorama/BoursoramaParserTest.java | 6 +- .../test/java/portefeuilleTest/AllTests.java | 12 - .../test/java/portefeuilleTest/TestQuote.java | 362 - .../businessLogic/FakeQuotationProvider.java | 12 - .../PredefinedQuotationProvider.java | 404 +- .../businessLogic/TestShareDivision.java | 28 +- .../database/TestDatabaseStorage.java | 95 +- 23 files changed, 13894 insertions(+), 6313 deletions(-) delete mode 100644 bourse/src/test/java/portefeuilleTest/AllTests.java delete mode 100644 bourse/src/test/java/portefeuilleTest/TestQuote.java diff --git a/bourse/TEST_DATA/expected_result_stripped_quotes.xml b/bourse/TEST_DATA/expected_result_stripped_quotes.xml index 14bfe90..a9cfcf2 100644 --- a/bourse/TEST_DATA/expected_result_stripped_quotes.xml +++ b/bourse/TEST_DATA/expected_result_stripped_quotes.xml @@ -1,161 +1,161 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bourse/TEST_DATA/huge_quotes.xml b/bourse/TEST_DATA/huge_quotes.xml index 4db203f..1bb1c3c 100644 --- a/bourse/TEST_DATA/huge_quotes.xml +++ b/bourse/TEST_DATA/huge_quotes.xml @@ -63,318 +63,318 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bourse/TEST_DATA/portfolio_9_dec_2016.xml b/bourse/TEST_DATA/portfolio_9_dec_2016.xml index bf25b20..9e4bd06 100644 --- a/bourse/TEST_DATA/portfolio_9_dec_2016.xml +++ b/bourse/TEST_DATA/portfolio_9_dec_2016.xml @@ -1,3925 +1,12460 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bourse/TEST_DATA/portfolio_withLastQuotationIntradayInvalid.xml b/bourse/TEST_DATA/portfolio_withLastQuotationIntradayInvalid.xml index 1e728a0..e4fd513 100644 --- a/bourse/TEST_DATA/portfolio_withLastQuotationIntradayInvalid.xml +++ b/bourse/TEST_DATA/portfolio_withLastQuotationIntradayInvalid.xml @@ -1,73 +1,169 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bourse/TEST_DATA/portfolio_withLastQuotationNextDayInvalid.xml b/bourse/TEST_DATA/portfolio_withLastQuotationNextDayInvalid.xml index 3982df1..d5ee295 100644 --- a/bourse/TEST_DATA/portfolio_withLastQuotationNextDayInvalid.xml +++ b/bourse/TEST_DATA/portfolio_withLastQuotationNextDayInvalid.xml @@ -1,83 +1,195 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bourse/TEST_DATA/quotes.dtd b/bourse/TEST_DATA/quotes.dtd index ff43d0b..b3e2fd6 100644 --- a/bourse/TEST_DATA/quotes.dtd +++ b/bourse/TEST_DATA/quotes.dtd @@ -28,18 +28,10 @@ IDSHARE CDATA #IMPLIED DATEQUOTE CDATA #REQUIRED LASTTRADEDPRICE CDATA #REQUIRED - CHANGEINPRICE CDATA #IMPLIED OPENPRICE CDATA #IMPLIED HIGHPRICE CDATA #IMPLIED LOWPRICE CDATA #IMPLIED VOLUME CDATA #IMPLIED - LOW52WEEK CDATA #IMPLIED - HIGH52WEEK CDATA #IMPLIED - MOBILEAVERAGE50DAYS CDATA #IMPLIED - MOBILEAVERAGE200DAYS CDATA #IMPLIED - PREVIOUSCLOSE CDATA #IMPLIED - PERATIO CDATA #IMPLIED - SHORTRATIO CDATA #IMPLIED > diff --git a/bourse/TEST_DATA/real_data.xml b/bourse/TEST_DATA/real_data.xml index afb7293..a0f4905 100644 --- a/bourse/TEST_DATA/real_data.xml +++ b/bourse/TEST_DATA/real_data.xml @@ -1,112 +1,311 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bourse/TEST_DATA/stock_and_quotes.xml b/bourse/TEST_DATA/stock_and_quotes.xml index ab9e3d6..ab450db 100644 --- a/bourse/TEST_DATA/stock_and_quotes.xml +++ b/bourse/TEST_DATA/stock_and_quotes.xml @@ -5,129 +5,107 @@ - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - + + + + - - - + + + - + - + - - + + @@ -142,12 +120,14 @@ dateExpiration="2016-10-17 09:41:42.0" /> - + unitPriceRequested="1.1" state="0" + dateExpiration="2016-10-14 09:41:42.0" /> + - + unitPriceRequested="5.1" state="0" + dateExpiration="2016-10-17 09:41:42.0" /> + - + unitPriceRequested="1.1" state="0" + dateExpiration="2016-10-14 09:41:42.0" /> + + unitPriceRequested="25.1" state="0" + dateExpiration="2016-10-17 09:41:42.0" /> diff --git a/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Quotes.java b/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Quotes.java index 9cc4701..d980ba3 100644 --- a/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Quotes.java +++ b/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Quotes.java @@ -67,11 +67,6 @@ public Class getRecordType() { */ public final TableField LASTTRADEDPRICE = createField(DSL.name("LASTTRADEDPRICE"), SQLDataType.DOUBLE.nullable(false), this, ""); - /** - * The column PUBLIC.QUOTES.CHANGEINPRICE. - */ - public final TableField CHANGEINPRICE = createField(DSL.name("CHANGEINPRICE"), SQLDataType.DOUBLE, this, ""); - /** * The column PUBLIC.QUOTES.OPENPRICE. */ @@ -92,41 +87,6 @@ public Class getRecordType() { */ public final TableField VOLUME = createField(DSL.name("VOLUME"), SQLDataType.DOUBLE, this, ""); - /** - * The column PUBLIC.QUOTES.LOW52WEEK. - */ - public final TableField LOW52WEEK = createField(DSL.name("LOW52WEEK"), SQLDataType.DOUBLE, this, ""); - - /** - * The column PUBLIC.QUOTES.HIGH52WEEK. - */ - public final TableField HIGH52WEEK = createField(DSL.name("HIGH52WEEK"), SQLDataType.DOUBLE, this, ""); - - /** - * The column PUBLIC.QUOTES.MOBILEAVERAGE50DAYS. - */ - public final TableField MOBILEAVERAGE50DAYS = createField(DSL.name("MOBILEAVERAGE50DAYS"), SQLDataType.DOUBLE, this, ""); - - /** - * The column PUBLIC.QUOTES.MOBILEAVERAGE200DAYS. - */ - public final TableField MOBILEAVERAGE200DAYS = createField(DSL.name("MOBILEAVERAGE200DAYS"), SQLDataType.DOUBLE, this, ""); - - /** - * The column PUBLIC.QUOTES.PREVIOUSCLOSE. - */ - public final TableField PREVIOUSCLOSE = createField(DSL.name("PREVIOUSCLOSE"), SQLDataType.DOUBLE, this, ""); - - /** - * The column PUBLIC.QUOTES.PERATIO. - */ - public final TableField PERATIO = createField(DSL.name("PERATIO"), SQLDataType.DOUBLE, this, ""); - - /** - * The column PUBLIC.QUOTES.SHORTRATIO. - */ - public final TableField SHORTRATIO = createField(DSL.name("SHORTRATIO"), SQLDataType.DOUBLE, this, ""); - private Quotes(Name alias, Table aliased) { this(alias, aliased, null); } diff --git a/bourse/src/main/java/net/tuxanna/portefeuille/Quote.java b/bourse/src/main/java/net/tuxanna/portefeuille/Quote.java index bfac38f..c6b51fd 100644 --- a/bourse/src/main/java/net/tuxanna/portefeuille/Quote.java +++ b/bourse/src/main/java/net/tuxanna/portefeuille/Quote.java @@ -10,18 +10,10 @@ public class Quote { private DigitValue lastTradedPrice;//QuoteType.LAST_TRADED_PRICE - private DigitValue changeInPrice; // CHANGE_IN_PRICE private DigitValue openPrice;//OPEN_PRICE private DigitValue highPrice;//HIGH_PRICE private DigitValue lowPrice;//LOW_PRICE private DigitValue volume;//VOLUME - private DigitValue low52Week;//LOW_52W - private DigitValue high52Week;//HIGH_52W - private DigitValue mobileAverage50Days;//MA_50_DAY - private DigitValue mobileAverage200Days;//MA_200_DAY - private DigitValue previousClose;//PREVIOUS_CLOSE - private DigitValue peRatio;//PE_RATIO - private DigitValue shortRatio;//SHORT_RATIO private static final Logger logger = LogManager.getLogger(Quote.class); @Override @@ -29,18 +21,10 @@ public int hashCode() { return new HashCodeBuilder(17, 31). // two randomly chosen prime numbers // if deriving: appendSuper(super.hashCode()). append(lastTradedPrice). - append(changeInPrice). append(openPrice). append(highPrice). append(lowPrice). append(volume). - append(low52Week). - append(high52Week). - append(mobileAverage50Days). - append(mobileAverage200Days). - append(previousClose). - append(peRatio). - append(shortRatio). toHashCode(); } @@ -56,18 +40,10 @@ public boolean equals(Object obj) return new EqualsBuilder(). // if deriving: appendSuper(super.equals(obj)). append(lastTradedPrice,rhs.lastTradedPrice). - append(changeInPrice,rhs.changeInPrice). append(openPrice,rhs.openPrice). append(highPrice,rhs.highPrice). append(lowPrice,rhs.lowPrice). append(volume,rhs.volume). - append(low52Week,rhs.low52Week). - append(high52Week,rhs.high52Week). - append(mobileAverage50Days,rhs.mobileAverage50Days). - append(mobileAverage200Days,rhs.mobileAverage200Days). - append(previousClose,rhs.previousClose). - append(peRatio,rhs.peRatio). - append(shortRatio,rhs.shortRatio). isEquals(); } @@ -79,104 +55,88 @@ public Quote() super(); //init to defaut values for all lastTradedPrice=new DigitValue();//QuoteType.LAST_TRADED_PRICE - changeInPrice=new DigitValue(); // CHANGE_IN_PRICE openPrice=new DigitValue();//OPEN_PRICE highPrice=new DigitValue();//HIGH_PRICE lowPrice=new DigitValue();//LOW_PRICE volume=new DigitValue();//VOLUME - low52Week=new DigitValue();//LOW_52W - high52Week=new DigitValue();//HIGH_52W - mobileAverage50Days=new DigitValue();//MA_50_DAY - mobileAverage200Days=new DigitValue();//MA_200_DAY - previousClose=new DigitValue();//PREVIOUS_CLOSE - peRatio=new DigitValue();//PE_RATIO - shortRatio=new DigitValue();//SHORT_RATIO } - public Quote(String[] quotes) - { - super(); - //init to defaut values for all - lastTradedPrice=new DigitValue();//QuoteType.LAST_TRADED_PRICE - changeInPrice=new DigitValue(); // CHANGE_IN_PRICE - openPrice=new DigitValue();//OPEN_PRICE - highPrice=new DigitValue();//HIGH_PRICE - lowPrice=new DigitValue();//LOW_PRICE - volume=new DigitValue();//VOLUME - low52Week=new DigitValue();//LOW_52W - high52Week=new DigitValue();//HIGH_52W - mobileAverage50Days=new DigitValue();//MA_50_DAY - mobileAverage200Days=new DigitValue();//MA_200_DAY - previousClose=new DigitValue();//PREVIOUS_CLOSE - peRatio=new DigitValue();//PE_RATIO - shortRatio=new DigitValue();//SHORT_RATIO - - int index=0; - if (index < quotes.length) - { - setLastTradedPrice(quotes[index]); - index++; - if (index < quotes.length) - { - setChangeInPrice(quotes[index]); - index++; - if (index < quotes.length) - { - setOpenPrice(quotes[index]); - index++; - if (index < quotes.length) - { - setHighPrice(quotes[index]); - index++; - if (index < quotes.length) - { - setLowPrice(quotes[index]); - index++; - if (index < quotes.length) - { - setVolume(quotes[index]); - index++; - if (index < quotes.length) - { - setLow52Week(quotes[index]); - index++; - if (index < quotes.length) - { - setHigh52Week(quotes[index]); - index++; - if (index < quotes.length) - { - setMobileAverage50Days(quotes[index]); - index++; - if (index < quotes.length) - { - setMobileAverage200Days(quotes[index]); - index++; - if (index < quotes.length) - { - setPreviousClose(quotes[index]); - index++; - if (index < quotes.length) - { - setPeRatio(quotes[index]); - index++; - if (index < quotes.length) - { - setShortRatio(quotes[index]); - } - } - } - } - } - } - } - } - } - } - } - } - } - } +// public Quote(String[] quotes) +// { +// super(); +// //init to defaut values for all +// lastTradedPrice=new DigitValue();//QuoteType.LAST_TRADED_PRICE +// openPrice=new DigitValue();//OPEN_PRICE +// highPrice=new DigitValue();//HIGH_PRICE +// lowPrice=new DigitValue();//LOW_PRICE +// volume=new DigitValue();//VOLUME +// +// int index=0; +// if (index < quotes.length) +// { +// setLastTradedPrice(quotes[index]); +// index++; +// if (index < quotes.length) +// { +// setChangeInPrice(quotes[index]); +// index++; +// if (index < quotes.length) +// { +// setOpenPrice(quotes[index]); +// index++; +// if (index < quotes.length) +// { +// setHighPrice(quotes[index]); +// index++; +// if (index < quotes.length) +// { +// setLowPrice(quotes[index]); +// index++; +// if (index < quotes.length) +// { +// setVolume(quotes[index]); +// index++; +// if (index < quotes.length) +// { +// setLow52Week(quotes[index]); +// index++; +// if (index < quotes.length) +// { +// setHigh52Week(quotes[index]); +// index++; +// if (index < quotes.length) +// { +// setMobileAverage50Days(quotes[index]); +// index++; +// if (index < quotes.length) +// { +// setMobileAverage200Days(quotes[index]); +// index++; +// if (index < quotes.length) +// { +// setPreviousClose(quotes[index]); +// index++; +// if (index < quotes.length) +// { +// setPeRatio(quotes[index]); +// index++; +// if (index < quotes.length) +// { +// setShortRatio(quotes[index]); +// } +// } +// } +// } +// } +// } +// } +// } +// } +// } +// } +// } +// } +// } public DigitValue getLastTradedPrice() @@ -197,24 +157,6 @@ public void setLastTradedPrice(double lastTradedPrice2) this.lastTradedPrice =new DigitValue(lastTradedPrice2); } - public DigitValue getChangeInPrice() - { - return changeInPrice; - } - - public void setChangeInPrice(String p_changeInPrice) - { - this.changeInPrice = new DigitValue(p_changeInPrice); - if (changeInPrice.isValid() && changeInPrice.getValue()==0.0) - { - logger.error("invalid p_changeInPrice={}",p_changeInPrice); - } - } - public void setChangeInPrice(double changeInPrice) - { - this.changeInPrice = new DigitValue(changeInPrice); - } - public DigitValue getOpenPrice() { return openPrice; @@ -274,107 +216,6 @@ public void setVolume(double volume2) { volume=new DigitValue(volume2); } - public DigitValue getLow52Week() - { - return low52Week; - } - - public void setLow52Week(String low52Week) - { - this.low52Week = new DigitValue(low52Week); - } - public void setLow52Week(double low52Week) - { - this.low52Week = new DigitValue(low52Week); - } - - public DigitValue getHigh52Week() - { - return high52Week; - } - - public void setHigh52Week(String high52Week) - { - this.high52Week = new DigitValue(high52Week); - } - public void setHigh52Week(double high52Week) - { - this.high52Week = new DigitValue(high52Week); - } - - public DigitValue getMobileAverage50Days() - { - return mobileAverage50Days; - } - - public void setMobileAverage50Days(String mobileAverage50Days) - { - this.mobileAverage50Days = new DigitValue(mobileAverage50Days); - } - public void setMobileAverage50Days(double mobileAverage50Days) - { - this.mobileAverage50Days = new DigitValue(mobileAverage50Days); - } - - public DigitValue getMobileAverage200Days() - { - return mobileAverage200Days; - } - - public void setMobileAverage200Days(String mobileAverage200Days) - { - this.mobileAverage200Days = new DigitValue(mobileAverage200Days); - } - public void setMobileAverage200Days(double mobileAverage200Days) - { - this.mobileAverage200Days = new DigitValue(mobileAverage200Days); - } - - public DigitValue getPreviousClose() - { - return previousClose; - } - - public void setPreviousClose(String strPreviousClose) - { - this.previousClose = new DigitValue(strPreviousClose); - if (previousClose.isValid() && previousClose.getValue()==0.0) - { - logger.error("invalid p_previousClose={}",strPreviousClose); - } - } - public void setPreviousClose(double previousClose) - { - this.previousClose = new DigitValue(previousClose); - } - public DigitValue getPeRatio() - { - return peRatio; - } - - public void setPeRatio(String peRatio) - { - this.peRatio = new DigitValue(peRatio); - } - public void setPeRatio(double peRatio) - { - this.peRatio = new DigitValue(peRatio); - } - public DigitValue getShortRatio() - { - return shortRatio; - } - - public void setShortRatio(String shortRatio) - { - this.shortRatio = new DigitValue(shortRatio); - } - - - public void setShortRatio(double shortRatio) - { - this.shortRatio = new DigitValue(shortRatio); - } public boolean isLastTradedPriceValid() { @@ -391,11 +232,9 @@ public boolean isLastTradedPriceValid() @Override public String toString() { - return "Quote [lastTradedPrice=" + lastTradedPrice + ", changeInPrice=" + changeInPrice + ", openPrice=" + return "Quote [lastTradedPrice=" + lastTradedPrice + ", openPrice=" + openPrice + ", highPrice=" + highPrice + ", lowPrice=" + lowPrice + ", volume=" + volume - + ", low52Week=" + low52Week + ", high52Week=" + high52Week + ", mobileAverage50Days=" - + mobileAverage50Days + ", mobileAverage200Days=" + mobileAverage200Days + ", previousClose=" - + previousClose + ", peRatio=" + peRatio + ", shortRatio=" + shortRatio + "]"; + + "]"; } public boolean isValid() @@ -425,26 +264,7 @@ public void divideShare(Double divideShareRatio) { volume.setValue(volume.getValue() * divideShareRatio); } - if (low52Week.isValid()) - { - low52Week.setValue(low52Week.getValue() / divideShareRatio); - } - if (high52Week.isValid()) - { - high52Week.setValue(high52Week.getValue() / divideShareRatio); - } - if (mobileAverage50Days.isValid()) - { - mobileAverage50Days.setValue(mobileAverage50Days.getValue() / divideShareRatio); - } - if (mobileAverage200Days.isValid()) - { - mobileAverage200Days.setValue(mobileAverage200Days.getValue() / divideShareRatio); - } - if (previousClose.isValid()) - { - previousClose.setValue(previousClose.getValue() / divideShareRatio); - } + } diff --git a/bourse/src/main/java/net/tuxanna/portefeuille/business_logic/PortfolioManagement.java b/bourse/src/main/java/net/tuxanna/portefeuille/business_logic/PortfolioManagement.java index cb46419..94f9dd7 100644 --- a/bourse/src/main/java/net/tuxanna/portefeuille/business_logic/PortfolioManagement.java +++ b/bourse/src/main/java/net/tuxanna/portefeuille/business_logic/PortfolioManagement.java @@ -438,34 +438,34 @@ private void fillListOfQuotation(List listShares, if (quotation.isLastTradedPriceValid()) { QuoteDB qDB=new QuoteDB(share.getId(),quotation); - if (!quotation.getMobileAverage50Days().isValid()) - { - //compute it - MobileAverage average50=new MobileAverage(share, database, 50); - Double computedAverage50=average50.compute(); - if (computedAverage50 == null) - { - logger.debug("no average 50 for [ {} ]",ticker.getSymbol()); - } - else - { - quotation.setMobileAverage50Days(computedAverage50); - } - } - if (!quotation.getMobileAverage200Days().isValid()) - { - //compute it - MobileAverage average200=new MobileAverage(share, database, 200); - Double computedAverage200=average200.compute(); - if (computedAverage200 == null) - { - logger.debug("no average 200 for [ {} ]",ticker.getSymbol()); - } - else - { - quotation.setMobileAverage200Days(computedAverage200); - } - } +// if (!quotation.getMobileAverage50Days().isValid()) +// { +// //compute it +// MobileAverage average50=new MobileAverage(share, database, 50); +// Double computedAverage50=average50.compute(); +// if (computedAverage50 == null) +// { +// logger.debug("no average 50 for [ {} ]",ticker.getSymbol()); +// } +// else +// { +// quotation.setMobileAverage50Days(computedAverage50); +// } +// } +// if (!quotation.getMobileAverage200Days().isValid()) +// { +// //compute it +// MobileAverage average200=new MobileAverage(share, database, 200); +// Double computedAverage200=average200.compute(); +// if (computedAverage200 == null) +// { +// logger.debug("no average 200 for [ {} ]",ticker.getSymbol()); +// } +// else +// { +// quotation.setMobileAverage200Days(computedAverage200); +// } +// } listOfQuotationsDB.add(share,qDB); } else diff --git a/bourse/src/main/java/net/tuxanna/portefeuille/data_feed/boursorama/BoursoramaParser.java b/bourse/src/main/java/net/tuxanna/portefeuille/data_feed/boursorama/BoursoramaParser.java index 3850644..6505361 100644 --- a/bourse/src/main/java/net/tuxanna/portefeuille/data_feed/boursorama/BoursoramaParser.java +++ b/bourse/src/main/java/net/tuxanna/portefeuille/data_feed/boursorama/BoursoramaParser.java @@ -60,23 +60,6 @@ private boolean parseOpening(Elements doc,Quote quote) return true; } - private boolean parsePreviousClose(Elements doc,Quote quote) - { - Elements previousCloseItem = doc.select("span[class=c-instrument c-instrument--previousclose]"); - if (previousCloseItem==null) - { - logger.error("no previous close found for share"); - return false; - } - if (previousCloseItem.isEmpty()) - { - logger.error("empty previous close found for share"); - return false; - } - - quote.setPreviousClose(stripNonDigits(previousCloseItem.text())); - return true; - } private boolean parseHigh(Elements doc,Quote quote) { Elements highQuoteItem = doc.select("span[class=c-instrument c-instrument--high]"); @@ -165,11 +148,7 @@ public boolean parseShare(Document doc ,Quote quote) logger.error("problem reading opening\n"+doc.toString()+"\n"); return false; } - if (!parsePreviousClose(headerItem,quote)) - { - logger.error("problem reading prev close\n"+doc.toString()+"\n"); - return false; - } + if (!parseHigh(headerItem,quote)) { logger.error("problem reading high\n"+doc.toString()+"\n"); @@ -261,7 +240,6 @@ private boolean parseSicav(Document doc, Quote quote) logger.error("empty variation found for sicav\n"+doc.toString()+"\n"); return false; } - quote.setChangeInPrice(stripNonDigits(variationItem.text())); return true; } diff --git a/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java b/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java index 7e98a80..4b5f5d2 100644 --- a/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java +++ b/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java @@ -6,8 +6,8 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; -import java.sql.Types; import java.time.LocalDateTime; +import java.time.ZoneId; import java.util.ArrayList; import java.util.Calendar; import java.util.List; @@ -15,7 +15,9 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; + import org.jooq.DSLContext; +import org.jooq.InsertValuesStep7; import org.jooq.Record; import org.jooq.Record1; import org.jooq.Record2; @@ -367,210 +369,50 @@ public boolean readQuotations(List listQuote,SearchQuoteI seachQuote) } - - + /* (non-Javadoc) * @see net.tuxanna.database.jooq.DatabaseI#storeQuotation(java.util.List) */ @Override public boolean insertQuotation(List listQuote) { - final String INSERT_QUOTE = "insert into QUOTES(idShare,dateQuote,lastTradedPrice,changeInPrice,openPrice,highPrice,lowPrice,volume,low52Week,high52Week,mobileAverage50Days,mobileAverage200Days,previousClose,peRatio,shortRatio) values (?,?,?,?,?,?,? ,? ,?,?,?,?,?,?,?)"; - PreparedStatement insertStatement; - try - { - insertStatement = conn.prepareStatement(INSERT_QUOTE); - } - catch (SQLException e) - { - logger.error(e); - return false; - } + DSLContext create = DSL.using(conn, SQLDialect.HSQLDB); + InsertValuesStep7 request = create.insertInto(Quotes.QUOTES, + Quotes.QUOTES.IDSHARE, + Quotes.QUOTES.DATEQUOTE, + Quotes.QUOTES.LASTTRADEDPRICE, + Quotes.QUOTES.OPENPRICE, + Quotes.QUOTES.HIGHPRICE, + Quotes.QUOTES.LOWPRICE, + Quotes.QUOTES.VOLUME); + + boolean isSomethingToDo=false; for (QuoteDB quotation : listQuote) { if (quotation.hasRequiredDataForPersistance()) { - try - { - fillInsertStatementQuotation(insertStatement, quotation); - final int iUpdateCount = insertStatement.executeUpdate(); - if (iUpdateCount !=1) - { - logger.error("failed to insert {} {}",iUpdateCount,quotation.toString()); - } - } - catch (SQLException e) - { - logger.error(e); - try - { - insertStatement.close(); - } - catch (SQLException e1) - { - logger.error(e); - } - return false; - } + LocalDateTime dateToSave=quotation.getDate().toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDateTime(); + + request.values(quotation.getIdShare(), + dateToSave, + quotation.getQuotation().getLastTradedPrice().getValue(), + quotation.getQuotation().getOpenPrice().getValueOrNull(), + quotation.getQuotation().getHighPrice().getValueOrNull(), + quotation.getQuotation().getLowPrice().getValueOrNull(), + quotation.getQuotation().getVolume().getValueOrNull()); + isSomethingToDo=true; } - else - { - logger.error("invalid quotation {}",quotation.toString()); - } - - } - try - { - insertStatement.close(); } - catch (SQLException e) + if (isSomethingToDo) { - logger.error(e); - return false; + int result = request.execute(); + logger.debug("added {} returning ",listQuote.size(),result); } - logger.traceExit("added ",listQuote.size()); return true; } - private void fillInsertStatementQuotation(PreparedStatement insertStatement, QuoteDB quotation) throws SQLException - { - insertStatement.setInt(1, quotation.getIdShare()); - insertStatement.setDate(2, new java.sql.Date(quotation.getDate().getTime())); - insertStatement.setDouble(3,quotation.getQuotation().getLastTradedPrice().getValue()); - { - DigitValue valToSave = quotation.getQuotation().getChangeInPrice(); - if (valToSave.isValid()) - { - insertStatement.setDouble(4,valToSave.getValue()); - } - else - { - insertStatement.setNull(4,Types.DOUBLE); - } - } - { - DigitValue valToSave = quotation.getQuotation().getOpenPrice(); - if (valToSave.isValid()) - { - insertStatement.setDouble(5,valToSave.getValue()); - } - else - { - insertStatement.setNull(5,Types.DOUBLE); - } - } - { - DigitValue valToSave = quotation.getQuotation().getHighPrice(); - if (valToSave.isValid()) - { - insertStatement.setDouble(6,valToSave.getValue()); - } - else - { - insertStatement.setNull(6,Types.DOUBLE); - } - } - { - DigitValue valToSave = quotation.getQuotation().getLowPrice(); - if (valToSave.isValid()) - { - insertStatement.setDouble(7,valToSave.getValue()); - } - else - { - insertStatement.setNull(7,Types.DOUBLE); - } - } - { - DigitValue valToSave = quotation.getQuotation().getVolume(); - if (valToSave.isValid()) - { - insertStatement.setDouble(8,valToSave.getValue()); - } - else - { - insertStatement.setNull(8,Types.DOUBLE); - } - } - { - DigitValue valToSave = quotation.getQuotation().getLow52Week(); - if (valToSave.isValid()) - { - insertStatement.setDouble(9,valToSave.getValue()); - } - else - { - insertStatement.setNull(9,Types.DOUBLE); - } - } - { - DigitValue valToSave = quotation.getQuotation().getHigh52Week(); - if (valToSave.isValid()) - { - insertStatement.setDouble(10,valToSave.getValue()); - } - else - { - insertStatement.setNull(10,Types.DOUBLE); - } - } - { - DigitValue valToSave = quotation.getQuotation().getMobileAverage50Days(); - if (valToSave.isValid()) - { - insertStatement.setDouble(11,valToSave.getValue()); - } - else - { - insertStatement.setNull(11,Types.DOUBLE); - } - } - { - DigitValue valToSave = quotation.getQuotation().getMobileAverage200Days(); - if (valToSave.isValid()) - { - insertStatement.setDouble(12,valToSave.getValue()); - } - else - { - insertStatement.setNull(12,Types.DOUBLE); - } - } - { - DigitValue valToSave = quotation.getQuotation().getPreviousClose(); - if (valToSave.isValid()) - { - insertStatement.setDouble(13,valToSave.getValue()); - } - else - { - insertStatement.setNull(13,Types.DOUBLE); - } - } - { - DigitValue valToSave = quotation.getQuotation().getPeRatio(); - if (valToSave.isValid()) - { - insertStatement.setDouble(14,valToSave.getValue()); - } - else - { - insertStatement.setNull(14,Types.DOUBLE); - } - } - { - DigitValue valToSave = quotation.getQuotation().getShortRatio(); - if (valToSave.isValid()) - { - insertStatement.setDouble(15,valToSave.getValue()); - } - else - { - insertStatement.setNull(15,Types.DOUBLE); - } - } - } - /* (non-Javadoc) * @see net.tuxanna.database.jooq.DatabaseI#storeShares(java.util.List) */ @@ -1355,26 +1197,11 @@ public List readQuotations(ConditionQuoteI condition) private void fillQuotationFromDatabase(Record shareRecord, QuoteDB quoteDb) { Quote quote=new Quote(); - Double val = shareRecord.get(Quotes.QUOTES.CHANGEINPRICE); - if (val != null) - { - quote.setChangeInPrice(val); - } - val=shareRecord.get(Quotes.QUOTES.HIGH52WEEK); - if (val != null) - { - quote.setHigh52Week(val); - } - val=shareRecord.get(Quotes.QUOTES.HIGHPRICE); + Double val=shareRecord.get(Quotes.QUOTES.HIGHPRICE); if (val != null) { quote.setHighPrice(val); } - val=shareRecord.get(Quotes.QUOTES.LOW52WEEK); - if (val != null) - { - quote.setLow52Week(val); - } val=shareRecord.get(Quotes.QUOTES.LOWPRICE); if (val != null) { @@ -1386,37 +1213,12 @@ private void fillQuotationFromDatabase(Record shareRecord, QuoteDB quoteDb) quote.setLastTradedPrice(val); } - val=shareRecord.get(Quotes.QUOTES.MOBILEAVERAGE200DAYS); - if (val != null) - { - quote.setMobileAverage200Days(val); - } - val=shareRecord.get(Quotes.QUOTES.MOBILEAVERAGE50DAYS); - if (val != null) - { - quote.setMobileAverage50Days(val); - } val=shareRecord.get(Quotes.QUOTES.OPENPRICE); if (val != null) { quote.setOpenPrice(val); } - val=shareRecord.get(Quotes.QUOTES.PERATIO); - if (val != null) - { - quote.setPeRatio(val); - } - val=shareRecord.get(Quotes.QUOTES.PREVIOUSCLOSE); - if (val != null) - { - quote.setPreviousClose(val); - } - val=shareRecord.get(Quotes.QUOTES.SHORTRATIO); - if (val != null) - { - quote.setShortRatio(val); - } val=shareRecord.get(Quotes.QUOTES.VOLUME); if (val != null) { @@ -1460,51 +1262,19 @@ private UpdateConditionStep updateQuotationInDatabase(DSLContext dslCont logger.error("no update : last traded price missing"); return null; } - if (quote.getChangeInPrice().isValid()) - { - updateRequest.set(Quotes.QUOTES.CHANGEINPRICE, quote.getChangeInPrice().getValue()); - } - if (quote.getHigh52Week().isValid()) - { - updateRequest.set(Quotes.QUOTES.HIGH52WEEK, quote.getHigh52Week().getValue()); - } if (quote.getHighPrice().isValid()) { updateRequest.set(Quotes.QUOTES.HIGHPRICE, quote.getHighPrice().getValue()); } - if (quote.getLow52Week().isValid()) - { - updateRequest.set(Quotes.QUOTES.LOW52WEEK, quote.getLow52Week().getValue()); - } if (quote.getLowPrice().isValid()) { updateRequest.set(Quotes.QUOTES.LOWPRICE, quote.getLowPrice().getValue()); } - if (quote.getMobileAverage200Days().isValid()) - { - updateRequest.set(Quotes.QUOTES.MOBILEAVERAGE200DAYS, quote.getMobileAverage200Days().getValue()); - } - if (quote.getMobileAverage50Days().isValid()) - { - updateRequest.set(Quotes.QUOTES.MOBILEAVERAGE50DAYS, quote.getMobileAverage50Days().getValue()); - } if (quote.getOpenPrice().isValid()) { updateRequest.set(Quotes.QUOTES.OPENPRICE, quote.getOpenPrice().getValue()); } - if (quote.getPeRatio().isValid()) - { - updateRequest.set(Quotes.QUOTES.PERATIO, quote.getPeRatio().getValue()); - } - if (quote.getPreviousClose().isValid()) - { - updateRequest.set(Quotes.QUOTES.PREVIOUSCLOSE, quote.getPreviousClose().getValue()); - } - if (quote.getShortRatio().isValid()) - { - updateRequest.set(Quotes.QUOTES.SHORTRATIO, quote.getShortRatio().getValue()); - } if (quote.getVolume().isValid()) { updateRequest.set(Quotes.QUOTES.VOLUME, quote.getVolume().getValue()); @@ -1512,10 +1282,6 @@ private UpdateConditionStep updateQuotationInDatabase(DSLContext dslCont return req.where(Quotes.QUOTES.IDQUOTES.eq(quoteDB.getIdQuote())); -// .set(Quotes.QUOTES.HIGH52WEEK, 12.0) - // .set(AUTHOR.LAST_NAME, "Hesse") - // .where(Quotes.QUOTES.IDQUOTES.eq(3)) - // .execute(); } diff --git a/bourse/src/main/java/net/tuxanna/portefeuille/database/SearchQuoteAtOneDay.java b/bourse/src/main/java/net/tuxanna/portefeuille/database/SearchQuoteAtOneDay.java index 8be3b69..11a92d8 100644 --- a/bourse/src/main/java/net/tuxanna/portefeuille/database/SearchQuoteAtOneDay.java +++ b/bourse/src/main/java/net/tuxanna/portefeuille/database/SearchQuoteAtOneDay.java @@ -51,7 +51,7 @@ public boolean buildPreparedStatement(Connection conn) logger.debug("from "+strBefore+" to "+strAfter); } - final String SEARCH_QUOTE = "select dateQuote,lastTradedPrice,changeInPrice,openPrice,highPrice,lowPrice ,volume , low52Week, high52Week ,mobileAverage50Days ,mobileAverage200Days,previousClose,peRatio, shortRatio,idQuotes from QUOTES where idShare= ? and dateQuote >= ? and dateQuote <= ? order by dateQuote"; + final String SEARCH_QUOTE = "select dateQuote,lastTradedPrice,openPrice,highPrice,lowPrice,volume,idQuotes from QUOTES where idShare= ? and dateQuote >= ? and dateQuote <= ? order by dateQuote"; boolean res=true; try diff --git a/bourse/src/main/java/net/tuxanna/portefeuille/database/SearchQuoteStandard.java b/bourse/src/main/java/net/tuxanna/portefeuille/database/SearchQuoteStandard.java index 51efb9b..8c0b6b7 100644 --- a/bourse/src/main/java/net/tuxanna/portefeuille/database/SearchQuoteStandard.java +++ b/bourse/src/main/java/net/tuxanna/portefeuille/database/SearchQuoteStandard.java @@ -27,7 +27,7 @@ public SearchQuoteStandard(ShareDB p_share) public boolean buildPreparedStatement(Connection conn) { boolean res=true; - final String SEARCH_QUOTE = "select dateQuote,lastTradedPrice,changeInPrice,openPrice,highPrice,lowPrice ,volume , low52Week, high52Week ,mobileAverage50Days ,mobileAverage200Days,previousClose,peRatio, shortRatio,idQuotes from QUOTES where idShare= ? order by dateQuote"; + final String SEARCH_QUOTE = "select dateQuote,lastTradedPrice,openPrice,highPrice,lowPrice ,volume ,idQuotes from QUOTES where idShare= ? order by dateQuote"; try { selectStatement = conn.prepareStatement(SEARCH_QUOTE); @@ -69,13 +69,6 @@ protected QuoteDB loadQuoteFromDB( ResultSet results) throws SQLException double lastTradedPrice=results.getDouble("lastTradedPrice"); quotation.setLastTradedPrice(lastTradedPrice); } - { - double changeInPrice=results.getDouble("changeInPrice"); - if (!results.wasNull()) - { - quotation.setChangeInPrice(changeInPrice); - } - } { double openPrice=results.getDouble("openPrice"); @@ -106,56 +99,6 @@ protected QuoteDB loadQuoteFromDB( ResultSet results) throws SQLException quotation.setVolume(volume); } } - { - double low52Week=results.getDouble("low52Week"); - if (!results.wasNull()) - { - quotation.setLow52Week(low52Week); - } - } - { - double high52Week=results.getDouble("high52Week"); - if (!results.wasNull()) - { - quotation.setHigh52Week(high52Week); - } - } - - { - double mobileAverage50Days=results.getDouble("mobileAverage50Days"); - if (!results.wasNull()) - { - quotation.setMobileAverage50Days(mobileAverage50Days); - } - } - { - double mobileAverage200Days=results.getDouble("mobileAverage200Days"); - if (!results.wasNull()) - { - quotation.setMobileAverage200Days(mobileAverage200Days); - } - } - { - double previousClose=results.getDouble("previousClose"); - if (!results.wasNull()) - { - quotation.setPreviousClose(previousClose); - } - } - { - double peRatio=results.getDouble("peRatio"); - if (!results.wasNull()) - { - quotation.setPeRatio(peRatio); - } - } - { - double shortRatio=results.getDouble("shortRatio"); - if (!results.wasNull()) - { - quotation.setShortRatio(shortRatio); - } - } QuoteDB quoteDB=new QuoteDB(share.getId(),quotation); int id = results.getInt("idQuotes"); diff --git a/bourse/src/main/java/net/tuxanna/portefeuille/util/DigitValue.java b/bourse/src/main/java/net/tuxanna/portefeuille/util/DigitValue.java index b1e3617..7d07e83 100644 --- a/bourse/src/main/java/net/tuxanna/portefeuille/util/DigitValue.java +++ b/bourse/src/main/java/net/tuxanna/portefeuille/util/DigitValue.java @@ -1,6 +1,5 @@ package net.tuxanna.portefeuille.util; -import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -99,6 +98,14 @@ public boolean isValid() return isValid; } + public Double getValueOrNull() + { + if (isValid) + { + return value; + } + return null; + } @Override public String toString() { diff --git a/bourse/src/test/java/dataFeed/boursorama/BoursoramaParserTest.java b/bourse/src/test/java/dataFeed/boursorama/BoursoramaParserTest.java index 725d429..0ba2c58 100644 --- a/bourse/src/test/java/dataFeed/boursorama/BoursoramaParserTest.java +++ b/bourse/src/test/java/dataFeed/boursorama/BoursoramaParserTest.java @@ -33,7 +33,6 @@ public void testParseShare() assertEquals(0.0, quote.getOpenPrice().getValue(),0.001); assertEquals(0.0, quote.getHighPrice().getValue(),0.001); assertEquals(192.660, quote.getLowPrice().getValue(),0.001); - assertEquals(194.580, quote.getPreviousClose().getValue(),0.001); //TODO check non filled values @@ -55,7 +54,7 @@ public void testParseShare2() assertEquals(0, quote.getOpenPrice().getValue(),0.001); assertEquals(0, quote.getHighPrice().getValue(),0.001); assertEquals(0, quote.getLowPrice().getValue(),0.001); - assertEquals(70.34, quote.getPreviousClose().getValue(),0.001); + //TODO check non filled values } @@ -76,7 +75,6 @@ public void testParseUsShare() assertEquals(1539.74, quote.getOpenPrice().getValue(),0.001); assertEquals(1549.02, quote.getHighPrice().getValue(),0.001); assertEquals(1495.36, quote.getLowPrice().getValue(),0.001); - assertEquals(1544.92, quote.getPreviousClose().getValue(),0.001); //TODO check non filled values } @@ -92,7 +90,6 @@ public void testParseSicav() Quote quote=new Quote(); assertTrue(parser.parse(false /* sicav */,quote)); assertEquals(63.5900, quote.getLastTradedPrice().getValue(),0.001); - assertEquals(-0.19, quote.getChangeInPrice().getValue(),0.001); //TODO check non filled values } @@ -120,7 +117,6 @@ public void testWithRealBoursoramaDataFeed_ShareCase() assertTrue(quote.getOpenPrice().isValid()); assertTrue(quote.getHighPrice().isValid()); assertTrue(quote.getLowPrice().isValid()); - assertTrue(quote.getPreviousClose().isValid()); System.out.println(quote.toString()); } diff --git a/bourse/src/test/java/portefeuilleTest/AllTests.java b/bourse/src/test/java/portefeuilleTest/AllTests.java deleted file mode 100644 index 3813422..0000000 --- a/bourse/src/test/java/portefeuilleTest/AllTests.java +++ /dev/null @@ -1,12 +0,0 @@ -package portefeuilleTest; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -@RunWith(Suite.class) -@SuiteClasses({ TestQuote.class }) -public class AllTests -{ - -} diff --git a/bourse/src/test/java/portefeuilleTest/TestQuote.java b/bourse/src/test/java/portefeuilleTest/TestQuote.java deleted file mode 100644 index 4bdd194..0000000 --- a/bourse/src/test/java/portefeuilleTest/TestQuote.java +++ /dev/null @@ -1,362 +0,0 @@ -package portefeuilleTest; - -import static org.junit.Assert.*; - -import org.junit.Test; - -import net.tuxanna.portefeuille.Quote; - -public class TestQuote -{ - @Test - public void testEquals() - { - //same values (all) - { - String[] quotes={"53.83", "-0.60", "54.48", "54.48", "53.30", "1974540", "48.07", - "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes); - Quote val2=new Quote(quotes); - - assertTrue(val1.equals(val2)); - } - //try with some non set values - { - String[] quotes={"53.83", "-0.60", "54.48", "54.48", "53.30", "1974540", "48.07", - "68.50", "52.87", "53.88", "54.43", "14.41", "xxx"}; - Quote val1=new Quote(quotes); - Quote val2=new Quote(quotes); - - assertTrue(val1.equals(val2)); - } - { - String[] quotes={"53.83", "-0.60", "54.48", "54.48", "53.30", "1974540", "48.07", - "68.50", "52.87", "53.88", "54.43", "xxx", "0.00"}; - Quote val1=new Quote(quotes); - Quote val2=new Quote(quotes); - - assertTrue(val1.equals(val2)); - } - { - String[] quotes={"53.83", "-0.60", "54.48", "54.48", "53.30", "1974540", "48.07", - "68.50", "52.87", "53.88", "xxx", "14.41", "0.00"}; - Quote val1=new Quote(quotes); - Quote val2=new Quote(quotes); - - assertTrue(val1.equals(val2)); - } - { - String[] quotes={"53.83", "-0.60", "54.48", "54.48", "53.30", "1974540", "48.07", - "68.50", "52.87", "xxx", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes); - Quote val2=new Quote(quotes); - - assertTrue(val1.equals(val2)); - } - { - String[] quotes={"53.83", "-0.60", "54.48", "54.48", "53.30", "1974540", "48.07", - "68.50", "xxx", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes); - Quote val2=new Quote(quotes); - - assertTrue(val1.equals(val2)); - } - { - String[] quotes={"53.83", "-0.60", "54.48", "54.48", "53.30", "1974540", "48.07", - "xxx", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes); - Quote val2=new Quote(quotes); - - assertTrue(val1.equals(val2)); - } - { - String[] quotes={"53.83", "-0.60", "54.48", "54.48", "53.30", "1974540", "xxx", - "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes); - Quote val2=new Quote(quotes); - - assertTrue(val1.equals(val2)); - } - { - String[] quotes={"53.83", "-0.60", "54.48", "54.48", "53.30", "xxx", "48.07", - "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes); - Quote val2=new Quote(quotes); - - assertTrue(val1.equals(val2)); - } - { - String[] quotes={"53.83", "-0.60", "54.48", "54.48", "xxx", "1974540", "48.07", - "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes); - Quote val2=new Quote(quotes); - - assertTrue(val1.equals(val2)); - } - { - String[] quotes={"53.83", "-0.60", "54.48", "xx", "53.30", "1974540", "48.07", - "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes); - Quote val2=new Quote(quotes); - - assertTrue(val1.equals(val2)); - } - { - String[] quotes={"53.83", "-0.60", "xxx", "54.48", "53.30", "1974540", "48.07", - "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes); - Quote val2=new Quote(quotes); - - assertTrue(val1.equals(val2)); - } - - // now try with different values - { - String[] quotes1={"53.83", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - String[] quotes2={"53.903", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes1); - Quote val2=new Quote(quotes2); - - assertFalse(val1.equals(val2)); - } - - { - String[] quotes1={"53.83", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - String[] quotes2={"53.93", "-0.960", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes1); - Quote val2=new Quote(quotes2); - - assertFalse(val1.equals(val2)); - } - { - String[] quotes1={"53.83", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - String[] quotes2={"53.93", "-0.60", "54.19", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes1); - Quote val2=new Quote(quotes2); - - assertFalse(val1.equals(val2)); - } - { - String[] quotes1={"53.83", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - String[] quotes2={"53.93", "-0.60", "54.9", "54.148", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes1); - Quote val2=new Quote(quotes2); - - assertFalse(val1.equals(val2)); - } - { - String[] quotes1={"53.83", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - String[] quotes2={"53.93", "-0.60", "54.9", "54.48", "53.30", "974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes1); - Quote val2=new Quote(quotes2); - - assertFalse(val1.equals(val2)); - } - { - String[] quotes1={"53.83", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - String[] quotes2={"53.93", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.107", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes1); - Quote val2=new Quote(quotes2); - - assertFalse(val1.equals(val2)); - } - { - String[] quotes1={"53.83", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - String[] quotes2={"53.93", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.550", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes1); - Quote val2=new Quote(quotes2); - - assertFalse(val1.equals(val2)); - } - { - String[] quotes1={"53.83", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - String[] quotes2={"53.93", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.8217", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes1); - Quote val2=new Quote(quotes2); - - assertFalse(val1.equals(val2)); - } - { - String[] quotes1={"53.83", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - String[] quotes2={"53.93", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.817", "53.88", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes1); - Quote val2=new Quote(quotes2); - - assertFalse(val1.equals(val2)); - } - { - String[] quotes1={"53.83", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - String[] quotes2={"53.93", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.788", "54.43", "14.41", "0.00"}; - Quote val1=new Quote(quotes1); - Quote val2=new Quote(quotes2); - - assertFalse(val1.equals(val2)); - } - { - String[] quotes1={"53.83", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - String[] quotes2={"53.93", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.413", "14.41", "0.00"}; - Quote val1=new Quote(quotes1); - Quote val2=new Quote(quotes2); - - assertFalse(val1.equals(val2)); - } - { - String[] quotes1={"53.83", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - String[] quotes2={"53.93", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.441", "0.00"}; - Quote val1=new Quote(quotes1); - Quote val2=new Quote(quotes2); - - assertFalse(val1.equals(val2)); - } - { - String[] quotes1={"53.83", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - String[] quotes2={"53.93", "-0.60", "54.9", "54.48", "53.30", "1974540", "48.07", "68.550", "52.87", "53.88", "54.43", "14.41", "0.70"}; - Quote val1=new Quote(quotes1); - Quote val2=new Quote(quotes2); - - assertFalse(val1.equals(val2)); - } - } - - @Test - public void testFullParameterString() - { - String[] quotes={"53.83", "-0.60", "54.8", "54.48", "53.30", "1974540", "48.07", - "68.50", "52.87", "53.88", "54.43", "14.41", "0.00"}; - Quote val=new Quote(quotes); - - assertTrue(val.getLastTradedPrice().isValid()); - assertEquals(53.83, val.getLastTradedPrice().getValue(), 0.0001); - - assertTrue(val.getChangeInPrice().isValid()); - assertEquals(-0.6, val.getChangeInPrice().getValue(), 0.0001); - - assertTrue(val.getOpenPrice().isValid()); - assertEquals(54.8, val.getOpenPrice().getValue(), 0.0001); - - assertTrue(val.getHighPrice().isValid()); - assertEquals(54.48, val.getHighPrice().getValue(), 0.0001); - - assertTrue(val.getLowPrice().isValid()); - assertEquals(53.30, val.getLowPrice().getValue(), 0.0001); - - assertTrue(val.getVolume().isValid()); - assertEquals(1974540., val.getVolume().getValue(), 0.0001); - - assertTrue(val.getLow52Week().isValid()); - assertEquals(48.07, val.getLow52Week().getValue(), 0.0001); - - assertTrue(val.getHigh52Week().isValid()); - assertEquals(68.50, val.getHigh52Week().getValue(), 0.0001); - - assertTrue(val.getMobileAverage50Days().isValid()); - assertEquals(52.87, val.getMobileAverage50Days().getValue(), 0.0001); - - assertTrue(val.getMobileAverage200Days().isValid()); - assertEquals(53.88, val.getMobileAverage200Days().getValue(), 0.0001); - - assertTrue(val.getPreviousClose().isValid()); - assertEquals(54.43, val.getPreviousClose().getValue(), 0.0001); - - assertTrue(val.getPeRatio().isValid()); - assertEquals(14.41, val.getPeRatio().getValue(), 0.0001); - - assertTrue(val.getShortRatio().isValid()); - assertEquals(0.0, val.getShortRatio().getValue(), 0.0001); - - - //other possible test string [155.67, -1.21, 157.14, 157.70, 154.86, 2671852, 116.90, 165.00, 157.52, 154.03, 156.88, 12.66, 7.61] - } - - - @Test - public void testPartialParameterString() - { - String[] quotes={"53.83", "-0.60", "54.48", "54.48", "53.30", "1974540", "48.07", - "68.50", "52.87"}; - Quote val=new Quote(quotes); - - assertTrue(val.getLastTradedPrice().isValid()); - assertEquals(53.83, val.getLastTradedPrice().getValue(), 0.0001); - - assertTrue(val.getChangeInPrice().isValid()); - assertEquals(-0.6, val.getChangeInPrice().getValue(), 0.0001); - - assertTrue(val.getOpenPrice().isValid()); - assertEquals(54.48, val.getOpenPrice().getValue(), 0.0001); - - assertTrue(val.getHighPrice().isValid()); - assertEquals(54.48, val.getHighPrice().getValue(), 0.0001); - - assertTrue(val.getLowPrice().isValid()); - assertEquals(53.30, val.getLowPrice().getValue(), 0.0001); - - assertTrue(val.getVolume().isValid()); - assertEquals(1974540., val.getVolume().getValue(), 0.0001); - - assertTrue(val.getLow52Week().isValid()); - assertEquals(48.07, val.getLow52Week().getValue(), 0.0001); - - assertTrue(val.getHigh52Week().isValid()); - assertEquals(68.50, val.getHigh52Week().getValue(), 0.0001); - - assertTrue(val.getMobileAverage50Days().isValid()); - assertEquals(52.87, val.getMobileAverage50Days().getValue(), 0.0001); - - assertFalse(val.getMobileAverage200Days().isValid()); - assertFalse(val.getPreviousClose().isValid()); - assertFalse(val.getPeRatio().isValid()); - assertFalse(val.getShortRatio().isValid()); - } - - @Test - public void testWithInvalidValues() - { - String[] quotes={"53.83", "-0.60", "54.48", "54.48", "53.30", "N/A", "48.07", - "68.50", "52.87", "53.88", "bbbb", "14.41", ""}; - Quote val=new Quote(quotes); - - assertTrue(val.getLastTradedPrice().isValid()); - assertEquals(53.83, val.getLastTradedPrice().getValue(), 0.0001); - - assertTrue(val.getChangeInPrice().isValid()); - assertEquals(-0.6, val.getChangeInPrice().getValue(), 0.0001); - - assertTrue(val.getOpenPrice().isValid()); - assertEquals(54.48, val.getOpenPrice().getValue(), 0.0001); - - assertTrue(val.getHighPrice().isValid()); - assertEquals(54.48, val.getHighPrice().getValue(), 0.0001); - - assertTrue(val.getLowPrice().isValid()); - assertEquals(53.30, val.getLowPrice().getValue(), 0.0001); - - assertFalse(val.getVolume().isValid()); - - - assertTrue(val.getLow52Week().isValid()); - assertEquals(48.07, val.getLow52Week().getValue(), 0.0001); - - assertTrue(val.getHigh52Week().isValid()); - assertEquals(68.50, val.getHigh52Week().getValue(), 0.0001); - - assertTrue(val.getMobileAverage50Days().isValid()); - assertEquals(52.87, val.getMobileAverage50Days().getValue(), 0.0001); - - assertTrue(val.getMobileAverage200Days().isValid()); - assertEquals(53.88, val.getMobileAverage200Days().getValue(), 0.0001); - - assertFalse(val.getPreviousClose().isValid()); - - - assertTrue(val.getPeRatio().isValid()); - assertEquals(14.41, val.getPeRatio().getValue(), 0.0001); - - assertFalse(val.getShortRatio().isValid()); - - - - //other possible test string [155.67, -1.21, 157.14, 157.70, 154.86, 2671852, 116.90, 165.00, 157.52, 154.03, 156.88, 12.66, 7.61] - } -} - diff --git a/bourse/src/test/java/portefeuilleTest/businessLogic/FakeQuotationProvider.java b/bourse/src/test/java/portefeuilleTest/businessLogic/FakeQuotationProvider.java index d2012c3..6fcc116 100644 --- a/bourse/src/test/java/portefeuilleTest/businessLogic/FakeQuotationProvider.java +++ b/bourse/src/test/java/portefeuilleTest/businessLogic/FakeQuotationProvider.java @@ -55,84 +55,72 @@ public boolean getQuotes(Map list) { q.setLastTradedPrice(1.05); //was 1.03 in DB q.setOpenPrice(1.08); - q.setPreviousClose(1.03); q.setVolume(1000); } else if (shareTicker.compareTo((new FakeShareTicker(idx++)).getSymbol())==0) { q.setLastTradedPrice(1.53); //was 2.03 in DB q.setOpenPrice(2.00); - q.setPreviousClose(2.01); q.setVolume(1000); } else if (shareTicker.compareTo((new FakeShareTicker(idx++)).getSymbol())==0) { q.setLastTradedPrice(3.9); //was 3.03 in DB q.setOpenPrice(3.40); - q.setPreviousClose(3.51); q.setVolume(1000); } else if (shareTicker.compareTo((new FakeShareTicker(idx++)).getSymbol())==0) { q.setLastTradedPrice(42.53); //was 40.03 in DB q.setOpenPrice(41.00); - q.setPreviousClose(40.51); q.setVolume(1000); } else if (shareTicker.compareTo((new FakeShareTicker(idx++)).getSymbol())==0) { q.setLastTradedPrice(20.93); //was 25.93 in DB q.setOpenPrice(22.00); - q.setPreviousClose(24.51); q.setVolume(1000); } else if (shareTicker.compareTo((new FakeShareTicker(idx++)).getSymbol())==0) { q.setLastTradedPrice(6.02); //was 5.903 in DB q.setOpenPrice(6.00); - q.setPreviousClose(5.9031); q.setVolume(1000); } else if (shareTicker.compareTo((new FakeShareTicker(idx++)).getSymbol())==0) { q.setLastTradedPrice(58.02); //was 60 in DB q.setOpenPrice(60.00); - q.setPreviousClose(60.9031); q.setVolume(1000); } else if (shareTicker.compareTo((new FakeShareTicker(idx++)).getSymbol())==0) { q.setLastTradedPrice(69.02); //was 5.903 in DB q.setOpenPrice(69.900); - q.setPreviousClose(70.1); q.setVolume(1000); } else if (shareTicker.compareTo((new FakeShareTicker(idx++)).getSymbol())==0) { q.setLastTradedPrice(75.02); //was 80.903 in DB q.setOpenPrice(78.00); - q.setPreviousClose(80.903); q.setVolume(1000); } else if (shareTicker.compareTo((new FakeShareTicker(idx++)).getSymbol())==0) { q.setLastTradedPrice(10.02); q.setOpenPrice(10.00); - q.setPreviousClose(9.9071); q.setVolume(1000); } else if (shareTicker.compareTo((new FakeShareTicker(idx++)).getSymbol())==0) { q.setLastTradedPrice(16.2); //was 15.903 in DB q.setOpenPrice(16.03); - q.setPreviousClose(15.903); q.setVolume(1000); } else if (shareTicker.compareTo((new FakeShareTicker(idx++)).getSymbol())==0) { q.setLastTradedPrice(12.302); //was 11.903 in DB q.setOpenPrice(12.00); - q.setPreviousClose(11.903); q.setVolume(1000); } else diff --git a/bourse/src/test/java/portefeuilleTest/businessLogic/PredefinedQuotationProvider.java b/bourse/src/test/java/portefeuilleTest/businessLogic/PredefinedQuotationProvider.java index fa13b3a..8939055 100644 --- a/bourse/src/test/java/portefeuilleTest/businessLogic/PredefinedQuotationProvider.java +++ b/bourse/src/test/java/portefeuilleTest/businessLogic/PredefinedQuotationProvider.java @@ -48,18 +48,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice(7.45); - q.setChangeInPrice(0.03); + q.setOpenPrice(7.31); q.setHighPrice(7.5); q.setLowPrice(7.3); q.setVolume(30339.0); - q.setLow52Week(4.5); - q.setHigh52Week(8.34); - q.setMobileAverage50Days(7.63); - q.setMobileAverage200Days(6.49); - q.setPreviousClose(7.38); - q.setPeRatio(6.86); - q.setShortRatio(0); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker, q); @@ -68,18 +61,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("104.0"); - q.setChangeInPrice("1.25"); + q.setOpenPrice("102.95"); q.setHighPrice("104.35"); q.setLowPrice("102.5"); q.setVolume("1365492.0"); - q.setLow52Week("77.93"); - q.setHigh52Week("104.35"); - q.setMobileAverage50Days("94.28"); - q.setMobileAverage200Days("88.6"); - q.setPreviousClose("102.75"); - q.setPeRatio("20.88"); - q.setShortRatio("0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -88,17 +74,10 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("3.02"); - q.setChangeInPrice("-0.01"); q.setOpenPrice("3.03"); q.setHighPrice("3.03"); q.setLowPrice("3.02"); q.setVolume("102.0"); - q.setLow52Week("2.23"); - q.setHigh52Week("4.21"); - q.setMobileAverage50Days("3.04"); - q.setMobileAverage200Days("3.18"); - q.setPreviousClose("3.03"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker, q); } @@ -106,18 +85,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("0.19"); - q.setChangeInPrice("0.01"); + q.setOpenPrice("0.19"); q.setHighPrice("0.2"); q.setLowPrice("0.18"); q.setVolume("1602845.0"); - q.setLow52Week("0.12"); - q.setHigh52Week("0.28"); - q.setMobileAverage50Days("0.19"); - q.setMobileAverage200Days("0.2"); - q.setPreviousClose("0.18"); - q.setPeRatio("95.0"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker, q); @@ -126,17 +98,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("2.61"); - q.setChangeInPrice("-0.01"); + q.setOpenPrice("2.63"); q.setHighPrice("2.63"); q.setLowPrice("2.6"); q.setVolume("5843.0"); - q.setLow52Week("2.52"); - q.setHigh52Week("4.69"); - q.setMobileAverage50Days("2.69"); - q.setMobileAverage200Days("2.74"); - q.setPreviousClose("2.62"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -144,18 +110,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("45.57"); - q.setChangeInPrice("0.56"); + q.setOpenPrice("44.86"); q.setHighPrice("45.88"); q.setLowPrice("44.86"); q.setVolume("512679.0"); - q.setLow52Week("34.38"); - q.setHigh52Week("55.34"); - q.setMobileAverage50Days("44.67"); - q.setMobileAverage200Days("46.71"); - q.setPreviousClose("45.01"); - q.setPeRatio("0.74"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -163,18 +122,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("61.32"); - q.setChangeInPrice("1.33"); + q.setOpenPrice("60.13"); q.setHighPrice("61.74"); q.setLowPrice("60.05"); q.setVolume("2508521.0"); - q.setLow52Week("57.49"); - q.setHigh52Week("70.53"); - q.setMobileAverage50Days("60.46"); - q.setMobileAverage200Days("64.09"); - q.setPreviousClose("59.99"); - q.setPeRatio("21.63"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -182,18 +134,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("21.2"); - q.setChangeInPrice("0.54"); + q.setOpenPrice("20.76"); q.setHighPrice("21.2"); q.setLowPrice("20.76"); q.setVolume("11261.0"); - q.setLow52Week("14.3"); - q.setHigh52Week("21.51"); - q.setMobileAverage50Days("19.95"); - q.setMobileAverage200Days("18.77"); - q.setPreviousClose("20.66"); - q.setPeRatio("27.57"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -201,18 +146,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("103.7"); - q.setChangeInPrice("3.25"); + q.setOpenPrice("100.9"); q.setHighPrice("104.1"); q.setLowPrice("100.9"); q.setVolume("804459.0"); - q.setLow52Week("93.41"); - q.setHigh52Week("124.55"); - q.setMobileAverage50Days("101.54"); - q.setMobileAverage200Days("112.25"); - q.setPreviousClose("100.45"); - q.setPeRatio("28.64"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -220,17 +158,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("0.77"); - q.setChangeInPrice("0.0"); + q.setOpenPrice("0.77"); q.setHighPrice("0.78"); q.setLowPrice("0.76"); q.setVolume("99833.0"); - q.setLow52Week("0.71"); - q.setHigh52Week("1.89"); - q.setMobileAverage50Days("0.85"); - q.setMobileAverage200Days("1.27"); - q.setPreviousClose("0.77"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -238,18 +170,12 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("72.45"); - q.setChangeInPrice("-0.2"); + q.setOpenPrice("72.73"); q.setHighPrice("73.98"); q.setLowPrice("72.31"); q.setVolume("320202.0"); - q.setLow52Week("68.28"); - q.setHigh52Week("119.5"); - q.setMobileAverage50Days("72.83"); - q.setMobileAverage200Days("88.9"); - q.setPreviousClose("72.65"); - q.setPeRatio("19.55"); - q.setShortRatio("0.0"); + TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -257,17 +183,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("50.4"); - q.setChangeInPrice("0.3"); + q.setOpenPrice("50.41"); q.setHighPrice("50.5"); q.setLowPrice("49.79"); q.setVolume("483607.0"); - q.setLow52Week("30.33"); - q.setHigh52Week("54.48"); - q.setMobileAverage50Days("49.73"); - q.setMobileAverage200Days("44.86"); - q.setPreviousClose("50.1"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -275,36 +195,22 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("167.2"); - q.setChangeInPrice("4.6"); + q.setOpenPrice("162.95"); q.setHighPrice("168.4"); q.setLowPrice("162.7"); q.setVolume("901391.0"); - q.setLow52Week("142.65"); - q.setHigh52Week("177.9"); - q.setMobileAverage50Days("161.98"); - q.setMobileAverage200Days("167.36"); - q.setPreviousClose("162.6"); - q.setPeRatio("32.65"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("105.55"); - q.setChangeInPrice("0.7"); + q.setOpenPrice("104.85"); q.setHighPrice("105.85"); q.setLowPrice("104.8"); q.setVolume("554669.0"); - q.setLow52Week("77.4"); - q.setHigh52Week("106.3"); - q.setMobileAverage50Days("98.68"); - q.setMobileAverage200Days("94.1"); - q.setPreviousClose("104.85"); - q.setPeRatio("15.96"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -312,36 +218,23 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("0.69"); - q.setChangeInPrice("0.0"); + q.setOpenPrice("0.7"); q.setHighPrice("0.7"); q.setLowPrice("0.67"); q.setVolume("260486.0"); - q.setLow52Week("0.58"); - q.setHigh52Week("1.67"); - q.setMobileAverage50Days("0.69"); - q.setMobileAverage200Days("0.95"); - q.setPreviousClose("0.69"); - q.setShortRatio("0.0"); - + TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("63.74"); - q.setChangeInPrice("2.66"); + q.setOpenPrice("61.24"); q.setHighPrice("63.74"); q.setLowPrice("61.24"); q.setVolume("983213.0"); - q.setLow52Week("49.94"); - q.setHigh52Week("69.54"); - q.setMobileAverage50Days("61.06"); - q.setMobileAverage200Days("63.85"); - q.setPreviousClose("61.08"); - q.setPeRatio("15.52"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -349,18 +242,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("81.43"); - q.setChangeInPrice("-0.88"); + q.setOpenPrice("82.15"); q.setHighPrice("82.81"); q.setLowPrice("81.13"); q.setVolume("796082.0"); - q.setLow52Week("63.64"); - q.setHigh52Week("95.25"); - q.setMobileAverage50Days("75.95"); - q.setMobileAverage200Days("75.26"); - q.setPreviousClose("82.31"); - q.setPeRatio("7.59"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -368,18 +254,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("129.5"); - q.setChangeInPrice("0.25"); + q.setOpenPrice("129.0"); q.setHighPrice("129.95"); q.setLowPrice("128.85"); q.setVolume("80811.0"); - q.setLow52Week("79.9"); - q.setHigh52Week("136.0"); - q.setMobileAverage50Days("130.38"); - q.setMobileAverage200Days("120.97"); - q.setPreviousClose("129.25"); - q.setPeRatio("30.13"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -387,18 +266,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("65.06"); - q.setChangeInPrice("0.13"); + q.setOpenPrice("65.08"); q.setHighPrice("65.17"); q.setLowPrice("64.53"); q.setVolume("1044030.0"); - q.setLow52Week("45.31"); - q.setHigh52Week("65.17"); - q.setMobileAverage50Days("62.19"); - q.setMobileAverage200Days("59.37"); - q.setPreviousClose("64.93"); - q.setPeRatio("24.63"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -406,18 +278,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("13.345"); - q.setChangeInPrice("0.19"); + q.setOpenPrice("13.175"); q.setHighPrice("13.42"); q.setLowPrice("13.15"); q.setVolume("1358546.0"); - q.setLow52Week("12.725"); - q.setHigh52Week("17.9"); - q.setMobileAverage50Days("13.494"); - q.setMobileAverage200Days("14.051"); - q.setPreviousClose("13.155"); - q.setPeRatio("17.606"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -425,18 +290,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("34.72"); - q.setChangeInPrice("0.67"); + q.setOpenPrice("34.17"); q.setHighPrice("35.25"); q.setLowPrice("34.08"); q.setVolume("75468.0"); - q.setLow52Week("20.55"); - q.setHigh52Week("36.88"); - q.setMobileAverage50Days("32.19"); - q.setMobileAverage200Days("31.57"); - q.setPreviousClose("34.06"); - q.setPeRatio("22.55"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -444,18 +302,11 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("67.05"); - q.setChangeInPrice("0.13"); + q.setOpenPrice("67.15"); q.setHighPrice("67.94"); q.setLowPrice("66.29"); q.setVolume("925432.0"); - q.setLow52Week("35.11"); - q.setHigh52Week("68.04"); - q.setMobileAverage50Days("63.15"); - q.setMobileAverage200Days("54.11"); - q.setPreviousClose("66.92"); - q.setPeRatio("15.5"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); @@ -463,435 +314,268 @@ public void setupWithData_9_dec_2016(List listTicker) { Quote q = new Quote(); q.setLastTradedPrice("93.99"); - q.setChangeInPrice("1.78"); + q.setOpenPrice("92.3"); q.setHighPrice("94.51"); q.setLowPrice("92.23"); q.setVolume("129864.0"); - q.setLow52Week("66.65"); - q.setHigh52Week("99.5"); - q.setMobileAverage50Days("92.48"); - q.setMobileAverage200Days("87.23"); - q.setPreviousClose("92.21"); - q.setPeRatio("27.04"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("157.25"); - q.setChangeInPrice("-1.2"); + q.setOpenPrice("157.8"); q.setHighPrice("158.1"); q.setLowPrice("156.65"); q.setVolume("1562348.0"); - q.setLow52Week("118.35"); - q.setHigh52Week("166.2"); - q.setMobileAverage50Days("146.85"); - q.setMobileAverage200Days("136.34"); - q.setPreviousClose("158.45"); - q.setPeRatio("11.05"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("80.57"); - q.setChangeInPrice("-0.18"); + q.setOpenPrice("80.75"); q.setHighPrice("81.34"); q.setLowPrice("80.15"); q.setVolume("932055.0"); - q.setLow52Week("43.25"); - q.setHigh52Week("81.95"); - q.setMobileAverage50Days("77.99"); - q.setMobileAverage200Days("70.6"); - q.setPreviousClose("80.75"); - q.setPeRatio("30.62"); - q.setShortRatio("10.82"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("1142.63"); - q.setChangeInPrice("9.43"); + q.setVolume("0.0"); - q.setPreviousClose("1133.2"); + TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("7.52"); - q.setChangeInPrice("0.12"); + q.setOpenPrice("7.42"); q.setHighPrice("7.52"); q.setLowPrice("7.35"); q.setVolume("109519.0"); - q.setLow52Week("4.61"); - q.setHigh52Week("7.75"); - q.setMobileAverage50Days("7.48"); - q.setMobileAverage200Days("6.54"); - q.setPreviousClose("7.4"); - q.setPeRatio("14.22"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("23.945"); - q.setChangeInPrice("-0.42"); + q.setOpenPrice("24.36"); q.setHighPrice("24.46"); q.setLowPrice("23.845"); q.setVolume("8708789.0"); - q.setLow52Week("16.11"); - q.setHigh52Week("25.79"); - q.setMobileAverage50Days("21.621"); - q.setMobileAverage200Days("19.752"); - q.setPreviousClose("24.365"); - q.setPeRatio("10.609"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("23.28"); - q.setChangeInPrice("0.39"); + q.setOpenPrice("22.89"); q.setHighPrice("23.42"); q.setLowPrice("22.89"); q.setVolume("2952071.0"); - q.setLow52Week("20.9"); - q.setHigh52Week("27.86"); - q.setMobileAverage50Days("23.0"); - q.setMobileAverage200Days("22.9"); - q.setPreviousClose("22.89"); - q.setPeRatio("19.02"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("63.72"); - q.setChangeInPrice("0.78"); + q.setOpenPrice("63.0"); q.setHighPrice("63.91"); q.setLowPrice("62.95"); q.setVolume("301464.0"); - q.setLow52Week("55.23"); - q.setHigh52Week("72.77"); - q.setMobileAverage50Days("64.09"); - q.setMobileAverage200Days("66.43"); - q.setPreviousClose("62.94"); - q.setPeRatio("16.53"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("35.57"); - q.setChangeInPrice("-0.19"); + q.setOpenPrice("35.76"); q.setHighPrice("35.9"); q.setLowPrice("35.04"); q.setVolume("83027.0"); - q.setLow52Week("21.66"); - q.setHigh52Week("44.35"); - q.setMobileAverage50Days("31.31"); - q.setMobileAverage200Days("28.75"); - q.setPreviousClose("35.76"); - q.setPeRatio("10.68"); - q.setShortRatio("0.0"); + TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("109.142"); - q.setChangeInPrice("1.533"); + q.setOpenPrice("107.655"); q.setHighPrice("110.28"); q.setLowPrice("107.655"); q.setVolume("1747.0"); - q.setLow52Week("87.922"); - q.setHigh52Week("122.9"); - q.setMobileAverage50Days("111.612"); - q.setMobileAverage200Days("112.161"); - q.setPreviousClose("107.609"); - q.setPeRatio("22.485"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("71.0"); - q.setChangeInPrice("2.3"); + q.setOpenPrice("68.9"); q.setHighPrice("71.15"); q.setLowPrice("68.75"); q.setVolume("9175965.0"); - q.setLow52Week("67.0"); - q.setHigh52Week("80.05"); - q.setMobileAverage50Days("69.82"); - q.setMobileAverage200Days("74.55"); - q.setPreviousClose("68.7"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("67.5"); - q.setChangeInPrice("-0.3"); + q.setOpenPrice("67.75"); q.setHighPrice("67.9"); q.setLowPrice("66.6"); q.setVolume("1422431.0"); - q.setLow52Week("53.0"); - q.setHigh52Week("73.95"); - q.setMobileAverage50Days("65.44"); - q.setMobileAverage200Days("60.45"); - q.setPreviousClose("67.8"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("227.8"); - q.setChangeInPrice("7.4"); + q.setOpenPrice("220.5"); q.setHighPrice("228.7"); q.setLowPrice("220.5"); q.setVolume("2330197.0"); - q.setLow52Week("218.3"); - q.setHigh52Week("279.6"); - q.setMobileAverage50Days("227.41"); - q.setMobileAverage200Days("241.74"); - q.setPreviousClose("220.4"); - q.setPeRatio("21.98"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("231.0"); - q.setChangeInPrice("4.9"); + q.setOpenPrice("226.1"); q.setHighPrice("232.4"); q.setLowPrice("225.8"); q.setVolume("57322.0"); - q.setLow52Week("221.8"); - q.setHigh52Week("280.0"); - q.setMobileAverage50Days("230.64"); - q.setMobileAverage200Days("243.86"); - q.setPreviousClose("226.1"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("76.33"); - q.setChangeInPrice("1.25"); + q.setOpenPrice("75.32"); q.setHighPrice("76.95"); q.setLowPrice("75.28"); q.setVolume("3046253.0"); - q.setLow52Week("62.5"); - q.setHigh52Week("81.45"); - q.setMobileAverage50Days("25.5"); - q.setMobileAverage200Days("25.74"); - q.setPreviousClose("75.08"); - q.setPeRatio("23.42"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("46.36"); - q.setChangeInPrice("-0.5"); + q.setOpenPrice("46.7"); q.setHighPrice("46.97"); q.setLowPrice("46.03"); q.setVolume("6171352.0"); - q.setLow52Week("25.0"); - q.setHigh52Week("46.98"); - q.setMobileAverage50Days("38.71"); - q.setMobileAverage200Days("33.51"); - q.setPreviousClose("46.86"); - q.setPeRatio("10.04"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("317.6"); - q.setChangeInPrice("-2.7"); + q.setOpenPrice("319.0"); q.setHighPrice("321.5"); q.setLowPrice("315.1"); q.setVolume("217171.0"); - q.setLow52Week("246.2"); - q.setHigh52Week("373.0"); - q.setMobileAverage50Days("299.74"); - q.setMobileAverage200Days("281.49"); - q.setPreviousClose("320.3"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("46.425"); - q.setChangeInPrice("0.51"); q.setOpenPrice("45.93"); q.setHighPrice("46.62"); q.setLowPrice("45.79"); q.setVolume("6638654.0"); - q.setLow52Week("35.21"); - q.setHigh52Week("46.62"); - q.setMobileAverage50Days("43.919"); - q.setMobileAverage200Days("43.087"); - q.setPreviousClose("45.915"); - q.setPeRatio("28.746"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("180.0"); - q.setChangeInPrice("-3.2"); q.setOpenPrice("182.8"); q.setHighPrice("184.1"); q.setLowPrice("176.0"); q.setVolume("51205.0"); - q.setLow52Week("162.3"); - q.setHigh52Week("249.0"); - q.setMobileAverage50Days("188.15"); - q.setMobileAverage200Days("210.48"); - q.setPreviousClose("183.2"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("59.58"); - q.setChangeInPrice("0.26"); q.setOpenPrice("59.29"); q.setHighPrice("59.63"); q.setLowPrice("58.73"); q.setVolume("1926839.0"); - q.setLow52Week("48.07"); - q.setHigh52Week("67.01"); - q.setMobileAverage50Days("56.29"); - q.setMobileAverage200Days("53.56"); - q.setPreviousClose("59.32"); - q.setPeRatio("17.83"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("766.85"); - q.setChangeInPrice("-0.48"); q.setOpenPrice("770.0"); q.setHighPrice("770.25"); q.setLowPrice("765.34"); q.setVolume("1969576.0"); - q.setLow52Week("474.0"); - q.setHigh52Week("847.21"); - q.setMobileAverage50Days("773.87"); - q.setMobileAverage200Days("763.56"); - q.setPreviousClose("767.33"); - q.setPeRatio("175.68"); - q.setShortRatio("1.09"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("400.0"); - q.setChangeInPrice("5.5"); q.setOpenPrice("396.0"); q.setHighPrice("401.2"); q.setLowPrice("395.25"); q.setVolume("24448.0"); - q.setLow52Week("271.25"); - q.setHigh52Week("434.95"); - q.setMobileAverage50Days("412.09"); - q.setMobileAverage200Days("375.08"); - q.setPreviousClose("394.5"); - q.setPeRatio("79.82"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("52.31"); - q.setChangeInPrice("3.08"); + q.setOpenPrice("51.14"); q.setHighPrice("54.0"); q.setLowPrice("50.5"); q.setVolume("2086696.0"); - q.setLow52Week("46.53"); - q.setHigh52Week("66.87"); - q.setMobileAverage50Days("49.74"); - q.setMobileAverage200Days("55.23"); - q.setPreviousClose("49.24"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("178.75"); - q.setChangeInPrice("2.25"); q.setOpenPrice("176.55"); q.setHighPrice("179.75"); q.setLowPrice("176.25"); q.setVolume("77511.0"); - q.setLow52Week("166.7"); - q.setHigh52Week("238.1"); - q.setMobileAverage50Days("179.29"); - q.setMobileAverage200Days("180.68"); - q.setPreviousClose("176.5"); - q.setPeRatio("29.7"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } { Quote q = new Quote(); q.setLastTradedPrice("55.76"); - q.setChangeInPrice("-0.48"); + q.setOpenPrice("56.21"); q.setHighPrice("56.47"); q.setLowPrice("55.67"); q.setVolume("756162.0"); - q.setLow52Week("33.88"); - q.setHigh52Week("56.47"); - q.setMobileAverage50Days("52.13"); - q.setMobileAverage200Days("47.64"); - q.setPreviousClose("56.24"); - q.setPeRatio("16.5"); - q.setShortRatio("0.0"); TickerI ticker = listTicker.get(idx++); predefinedQuotesToSend.put(ticker,q); } diff --git a/bourse/src/test/java/portefeuilleTest/businessLogic/TestShareDivision.java b/bourse/src/test/java/portefeuilleTest/businessLogic/TestShareDivision.java index 4f45d8f..4ea8e96 100644 --- a/bourse/src/test/java/portefeuilleTest/businessLogic/TestShareDivision.java +++ b/bourse/src/test/java/portefeuilleTest/businessLogic/TestShareDivision.java @@ -23,18 +23,12 @@ public class TestShareDivision private static final String SHARE_TICKER="ticker does not matter"; private static final Currency CURRENCY=ShareDB.Currency.ENGLISH_POUND; private static final double FAKE_QUOTATION_1=125.9; - private static final double FAKE_VARIATION_1=1.9; - private static final double FAKE_PE_1 = 17.4; private static final double FAKE_VOLUME_1=10000; private static final double FAKE_QUOTATION_2=25.9; - private static final double FAKE_VARIATION_2=245.9; - private static final double FAKE_PE_2 = 210; private static final double FAKE_VOLUME_2=27700; private static final double FAKE_QUOTATION_3=35.9; - private static final double FAKE_VARIATION_3=345.9; - private static final double FAKE_PE_3 = 30; private static final double FAKE_VOLUME_3=37700; private static final double QTE_PORTFOLIO_1 = 500.; @@ -47,19 +41,19 @@ public class TestShareDivision private void fillFakeQuotationOriginal(List listQuoteOriginal) { { - Quote quotation1=buildFakeQuote(FAKE_QUOTATION_1,FAKE_VARIATION_1, FAKE_PE_1, FAKE_VOLUME_1); + Quote quotation1=buildFakeQuote(FAKE_QUOTATION_1, FAKE_VOLUME_1); QuoteDB quote1=new QuoteDB(SHARE_ID,quotation1); listQuoteOriginal.add(quote1); } { Quote quotation2=buildFakeQuote(FAKE_QUOTATION_2 - ,FAKE_VARIATION_2, FAKE_PE_2, FAKE_VOLUME_2); + , FAKE_VOLUME_2); QuoteDB quote2=new QuoteDB(SHARE_ID,quotation2); listQuoteOriginal.add(quote2); } { Quote quotation3=buildFakeQuote(FAKE_QUOTATION_3 - ,FAKE_VARIATION_3, FAKE_PE_3, FAKE_VOLUME_3); + , FAKE_VOLUME_3); QuoteDB quote3=new QuoteDB(SHARE_ID,quotation3); listQuoteOriginal.add(quote3); } @@ -67,39 +61,33 @@ private void fillFakeQuotationOriginal(List listQuoteOriginal) private void fillFakeQuotationExpected(List listQuoteExpected) { { - Quote quotation1=buildFakeQuote(FAKE_QUOTATION_1/DIVIDE_SHARE_RATIO,FAKE_VARIATION_1, FAKE_PE_1, FAKE_VOLUME_1*DIVIDE_SHARE_RATIO); + Quote quotation1=buildFakeQuote(FAKE_QUOTATION_1/DIVIDE_SHARE_RATIO,FAKE_VOLUME_1*DIVIDE_SHARE_RATIO); QuoteDB quote1=new QuoteDB(SHARE_ID,quotation1); listQuoteExpected.add(quote1); } { Quote quotation2=buildFakeQuote(FAKE_QUOTATION_2/DIVIDE_SHARE_RATIO - ,FAKE_VARIATION_2, FAKE_PE_2, FAKE_VOLUME_2*DIVIDE_SHARE_RATIO); + , FAKE_VOLUME_2*DIVIDE_SHARE_RATIO); QuoteDB quote2=new QuoteDB(SHARE_ID,quotation2); listQuoteExpected.add(quote2); } { Quote quotation3=buildFakeQuote(FAKE_QUOTATION_3/DIVIDE_SHARE_RATIO - ,FAKE_VARIATION_3, FAKE_PE_3, FAKE_VOLUME_3*DIVIDE_SHARE_RATIO); + , FAKE_VOLUME_3*DIVIDE_SHARE_RATIO); QuoteDB quote3=new QuoteDB(SHARE_ID,quotation3); listQuoteExpected.add(quote3); } } - private Quote buildFakeQuote(double fakeQuoteValue,double changeInPrice, double fakePE, double fakeVolume) + private Quote buildFakeQuote(double fakeQuoteValue, double fakeVolume) { Quote newQuote=new Quote(); newQuote.setLastTradedPrice(fakeQuoteValue); - newQuote.setChangeInPrice(changeInPrice); - newQuote.setHigh52Week(fakeQuoteValue*2.0); newQuote.setHighPrice(fakeQuoteValue*15.6); - newQuote.setLow52Week(fakeQuoteValue/2.0); + newQuote.setLowPrice(fakeQuoteValue*0.61); - newQuote.setMobileAverage200Days(fakeQuoteValue*2/3); - newQuote.setMobileAverage50Days(fakeQuoteValue*3/2); newQuote.setOpenPrice(fakeQuoteValue*1.078); - newQuote.setPeRatio(fakePE); - newQuote.setPreviousClose(fakeQuoteValue*10.); newQuote.setVolume(fakeVolume); return newQuote; } diff --git a/bourse/src/test/java/portefeuilleTest/database/TestDatabaseStorage.java b/bourse/src/test/java/portefeuilleTest/database/TestDatabaseStorage.java index 7abc667..2624457 100644 --- a/bourse/src/test/java/portefeuilleTest/database/TestDatabaseStorage.java +++ b/bourse/src/test/java/portefeuilleTest/database/TestDatabaseStorage.java @@ -82,8 +82,6 @@ public class TestDatabaseStorage private static final double lastTradedPrice_3 = 40.03; private static final double low52Week_3 = 40.04; private static final double lowPrice_3 = 40.05; - private static final double mobileAverage200Days_3 = 40.06; - private static final double mobileAverage50Days_3 = 40.07; private static final double openPrice_3 = 40.08; private static final double peRatio_3 = 40.09; private static final double previousClose_3 = 40.011; @@ -244,78 +242,38 @@ private Quote fillQuoteFully(int dataSet) switch(dataSet%5) { case 0: - quote.setChangeInPrice(changeInPrice_0); - quote.setHigh52Week(high52Week_0); quote.setHighPrice(highPrice_0); quote.setLastTradedPrice(lastTradedPrice_0); - quote.setLow52Week(low52Week_0); quote.setLowPrice(lowPrice_0); - quote.setMobileAverage200Days(mobileAverage200Days_0); - quote.setMobileAverage50Days(mobileAverage50Days_0); quote.setOpenPrice(openPrice_0); - quote.setPeRatio(peRatio_0); - quote.setPreviousClose(previousClose_0); - quote.setShortRatio(shortRatio_0); quote.setVolume(volume_0); break; case 1: - quote.setChangeInPrice(changeInPrice_1); - quote.setHigh52Week(high52Week_1); quote.setHighPrice(highPrice_1); quote.setLastTradedPrice(lastTradedPrice_1); - quote.setLow52Week(low52Week_1); quote.setLowPrice(lowPrice_1); - quote.setMobileAverage200Days(mobileAverage200Days_1); - quote.setMobileAverage50Days(mobileAverage50Days_1); quote.setOpenPrice(openPrice_1); - quote.setPeRatio(peRatio_1); - quote.setPreviousClose(previousClose_1); - quote.setShortRatio(shortRatio_1); quote.setVolume(volume_1); break; case 2: - quote.setChangeInPrice(changeInPrice_2); - quote.setHigh52Week(high52Week_2); quote.setHighPrice(highPrice_2); quote.setLastTradedPrice(lastTradedPrice_2); - quote.setLow52Week(low52Week_2); quote.setLowPrice(lowPrice_2); - quote.setMobileAverage200Days(mobileAverage200Days_2); - quote.setMobileAverage50Days(mobileAverage50Days_2); quote.setOpenPrice(openPrice_2); - quote.setPeRatio(peRatio_2); - quote.setPreviousClose(previousClose_2); - quote.setShortRatio(shortRatio_2); quote.setVolume(volume_2); break; case 3: - quote.setChangeInPrice(changeInPrice_3); - quote.setHigh52Week(high52Week_3); quote.setHighPrice(highPrice_3); quote.setLastTradedPrice(lastTradedPrice_3); - quote.setLow52Week(low52Week_3); quote.setLowPrice(lowPrice_3); - quote.setMobileAverage200Days(mobileAverage200Days_3); - quote.setMobileAverage50Days(mobileAverage50Days_3); quote.setOpenPrice(openPrice_3); - quote.setPeRatio(peRatio_3); - quote.setPreviousClose(previousClose_3); - quote.setShortRatio(shortRatio_3); quote.setVolume(volume_3); break; case 4: - quote.setChangeInPrice(changeInPrice_4); - quote.setHigh52Week(high52Week_4); quote.setHighPrice(highPrice_4); quote.setLastTradedPrice(lastTradedPrice_4); - quote.setLow52Week(low52Week_4); quote.setLowPrice(lowPrice_4); - quote.setMobileAverage200Days(mobileAverage200Days_4); - quote.setMobileAverage50Days(mobileAverage50Days_4); quote.setOpenPrice(openPrice_4); - quote.setPeRatio(peRatio_4); - quote.setPreviousClose(previousClose_4); - quote.setShortRatio(shortRatio_4); quote.setVolume(volume_4); break; @@ -331,78 +289,29 @@ private Quote fillQuotePartially(int dataSet) switch((dataSet+2)%5) { case 0: - quote.setChangeInPrice(changeInPrice_0+100.0); - //quote.setHigh52Week(high52Week_0+100.0); - //quote.setHighPrice(highPrice_0+100.0); quote.setLastTradedPrice(lastTradedPrice_0+100.0); - //quote.setLow52Week(low52Week_0+100.0); quote.setLowPrice(lowPrice_0+100.0); - //quote.setMobileAverage200Days(mobileAverage200Days_0+100.0); - //quote.setMobileAverage50Days(mobileAverage50Days_0+100.0); quote.setOpenPrice(openPrice_0+100.0); - //quote.setPeRatio(peRatio_0+100.0); - quote.setPreviousClose(previousClose_0+100.0); - //quote.setShortRatio(shortRatio_0+100.0); quote.setVolume(volume_0+100.0); break; case 1: - //quote.setChangeInPrice(changeInPrice_1+100.0); - //quote.setHigh52Week(high52Week_1+100.0); - //quote.setHighPrice(highPrice_1+100.0); quote.setLastTradedPrice(lastTradedPrice_1+100.0); - //quote.setLow52Week(low52Week_1+100.0); - //quote.setLowPrice(lowPrice_1+100.0); -// quote.setMobileAverage200Days(mobileAverage200Days_1+100.0); -// quote.setMobileAverage50Days(mobileAverage50Days_1+100.0); -// quote.setOpenPrice(openPrice_1+100.0); -// quote.setPeRatio(peRatio_1+100.0); - quote.setPreviousClose(previousClose_1+100.0); - //quote.setShortRatio(shortRatio_1+100.0); - //quote.setVolume(volume_1+100.0); break; case 2: - quote.setChangeInPrice(changeInPrice_2+100.0); -// quote.setHigh52Week(high52Week_2+100.0); -// quote.setHighPrice(highPrice_2+100.0); quote.setLastTradedPrice(lastTradedPrice_2+100.0); -// quote.setLow52Week(low52Week_2+100.0); -// quote.setLowPrice(lowPrice_2+100.0); -// quote.setMobileAverage200Days(mobileAverage200Days_2+100.0); -// quote.setMobileAverage50Days(mobileAverage50Days_2+100.0); -// quote.setOpenPrice(openPrice_2+100.0); -// quote.setPeRatio(peRatio_2+100.0); -// quote.setPreviousClose(previousClose_2+100.0); -// quote.setShortRatio(shortRatio_2+100.0); -// quote.setVolume(volume_2+100.0); break; case 3: - quote.setChangeInPrice(changeInPrice_3+100.0); - quote.setHigh52Week(high52Week_3+100.0); quote.setHighPrice(highPrice_3+100.0); quote.setLastTradedPrice(lastTradedPrice_3+100.0); - quote.setLow52Week(low52Week_3+100.0); quote.setLowPrice(lowPrice_3+100.0); -// quote.setMobileAverage200Days(mobileAverage200Days_3+100.0); -// quote.setMobileAverage50Days(mobileAverage50Days_3+100.0); quote.setOpenPrice(openPrice_3+100.0); - quote.setPeRatio(peRatio_3+100.0); - quote.setPreviousClose(previousClose_3+100.0); - quote.setShortRatio(shortRatio_3+100.0); quote.setVolume(volume_3+100.0); break; case 4: - quote.setChangeInPrice(changeInPrice_4+100.0); - quote.setHigh52Week(high52Week_4+100.0); quote.setHighPrice(highPrice_4+100.0); quote.setLastTradedPrice(lastTradedPrice_4+100.0); - quote.setLow52Week(low52Week_4+100.0); - quote.setLowPrice(lowPrice_4+100.0); - quote.setMobileAverage200Days(mobileAverage200Days_4+100.0); - quote.setMobileAverage50Days(mobileAverage50Days_4+100.0); - quote.setOpenPrice(openPrice_4+100.0); - quote.setPeRatio(peRatio_4+100.0); - quote.setPreviousClose(previousClose_4+100.0); - //quote.setShortRatio(shortRatio_4+100.0); + quote.setLowPrice(lowPrice_4+100.0); + quote.setOpenPrice(openPrice_4+100.0); quote.setVolume(volume_4+100.0); break; From bde89baae03ebe14eab80543f2744280d7f48540 Mon Sep 17 00:00:00 2001 From: christian dubettier Date: Tue, 15 Dec 2020 20:34:55 +0100 Subject: [PATCH 02/19] cosmetic --- bourse/TEST_DATA/stock_and_quotes.xml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bourse/TEST_DATA/stock_and_quotes.xml b/bourse/TEST_DATA/stock_and_quotes.xml index ab450db..00b37fc 100644 --- a/bourse/TEST_DATA/stock_and_quotes.xml +++ b/bourse/TEST_DATA/stock_and_quotes.xml @@ -108,16 +108,14 @@ VOLUME="25.9013" /> - - - - + + Date: Wed, 16 Dec 2020 13:41:19 +0100 Subject: [PATCH 03/19] fix bug: 1) makeLocalDateTimeAtMidnight() was giving a month earlier 2) checkVariationOutOfTolerance() was sending the opposite result (true when should be false) 3) rename tests suite and make one that contains all --- .../portefeuille/database/Database.java | 24 ++--- .../{AllTests.java => AllTestsDatafeed.java} | 2 +- .../test/java/portefeuilleTest/AllTests.java | 24 +++++ .../test/java/portefeuilleTest/TestCvs.java | 102 +++++++++--------- ...lTests.java => AllTestsBusinessLogic.java} | 2 +- .../eval/{AllTests.java => AllTestsEval.java} | 2 +- ...lTests.java => AllTestsMobileAverage.java} | 2 +- ...AllTests.java => AllTestsShareOrders.java} | 2 +- .../{AllTests.java => AllTestsDatabase.java} | 2 +- .../util/{AllTests.java => AllTestsUtil.java} | 2 +- 10 files changed, 94 insertions(+), 70 deletions(-) rename bourse/src/test/java/dataFeed/boursorama/{AllTests.java => AllTestsDatafeed.java} (87%) create mode 100644 bourse/src/test/java/portefeuilleTest/AllTests.java rename bourse/src/test/java/portefeuilleTest/businessLogic/{AllTests.java => AllTestsBusinessLogic.java} (91%) rename bourse/src/test/java/portefeuilleTest/businessLogic/eval/{AllTests.java => AllTestsEval.java} (90%) rename bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/{AllTests.java => AllTestsMobileAverage.java} (87%) rename bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/{AllTests.java => AllTestsShareOrders.java} (87%) rename bourse/src/test/java/portefeuilleTest/database/{AllTests.java => AllTestsDatabase.java} (91%) rename bourse/src/test/java/portefeuilleTest/util/{AllTests.java => AllTestsUtil.java} (90%) diff --git a/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java b/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java index 4b5f5d2..7c61c98 100644 --- a/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java +++ b/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java @@ -617,16 +617,16 @@ public boolean loadValidSellOrders(List listOrders,java.util.Date d fetch(); for (Record sellrecord : result) { - SellDB buyDb=new SellDB(); - buyDb.setIdSell(sellrecord.get(Sell.SELL.IDSELL)); - buyDb.setIdShare(sellrecord.get(Sell.SELL.IDSHARE)); - buyDb.setIdAccount(sellrecord.get(Sell.SELL.IDACCOUNT)); - buyDb.setQte(sellrecord.get(Sell.SELL.QTE)); - buyDb.setUnitPriceRequested(sellrecord.get(Sell.SELL.UNITPRICEREQUESTED)); + SellDB sellDb=new SellDB(); + sellDb.setIdSell(sellrecord.get(Sell.SELL.IDSELL)); + sellDb.setIdShare(sellrecord.get(Sell.SELL.IDSHARE)); + sellDb.setIdAccount(sellrecord.get(Sell.SELL.IDACCOUNT)); + sellDb.setQte(sellrecord.get(Sell.SELL.QTE)); + sellDb.setUnitPriceRequested(sellrecord.get(Sell.SELL.UNITPRICEREQUESTED)); - buyDb.setShareName(sellrecord.get(Shares.SHARES.NAME)); + sellDb.setShareName(sellrecord.get(Shares.SHARES.NAME)); - listOrders.add(buyDb); + listOrders.add(sellDb); } return true; } @@ -809,7 +809,7 @@ private LocalDateTime makeLocalDateTimeAtMidnight(java.util.Date date) //take all the day as valid final int year=cal.get(Calendar.YEAR); - final int month=cal.get(Calendar.MONTH); + final int month=cal.get(Calendar.MONTH)+1; //calendar use 0..11 instead of 1..12 final int dayOfMonth=cal.get(Calendar.DAY_OF_MONTH); final int hour=23; final int minute=59; //midnight @@ -1091,7 +1091,7 @@ private Double checkVariationForOneQuotation(List listIdToBeChecked, Record6 recordDate) { Double priceToCheck=recordDate.get(fieldToCheck ); - if (checkVariationOutOfTolerance(priceToCheck,lastPrice,MAX_CHANGE_INTRADAY)) + if (isVariationOutOfTolerance(priceToCheck,lastPrice,MAX_CHANGE_INTRADAY)) { Integer Id=recordDate.get(Quotes.QUOTES.IDQUOTES); listIdToBeChecked.add(Id); @@ -1107,7 +1107,7 @@ private Double checkVariationForOneQuotation(List listIdToBeChecked, return lastPrice; } - private boolean checkVariationOutOfTolerance(Double valueToCheck, + private boolean isVariationOutOfTolerance(Double valueToCheck, Double referencedValue, double maxAllowedChangeInPercent) { @@ -1122,7 +1122,7 @@ private boolean checkVariationOutOfTolerance(Double valueToCheck, // both have a value final double percentVariation=Math.abs(100.*valueToCheck/referencedValue -100.); final boolean isBelowAllowedChange= (percentVariation< maxAllowedChangeInPercent); - return isBelowAllowedChange; + return !isBelowAllowedChange; } @Override diff --git a/bourse/src/test/java/dataFeed/boursorama/AllTests.java b/bourse/src/test/java/dataFeed/boursorama/AllTestsDatafeed.java similarity index 87% rename from bourse/src/test/java/dataFeed/boursorama/AllTests.java rename to bourse/src/test/java/dataFeed/boursorama/AllTestsDatafeed.java index 802e365..5736942 100644 --- a/bourse/src/test/java/dataFeed/boursorama/AllTests.java +++ b/bourse/src/test/java/dataFeed/boursorama/AllTestsDatafeed.java @@ -6,7 +6,7 @@ @RunWith(Suite.class) @SuiteClasses({ BoursoramaParserTest.class }) -public class AllTests +public class AllTestsDatafeed { } diff --git a/bourse/src/test/java/portefeuilleTest/AllTests.java b/bourse/src/test/java/portefeuilleTest/AllTests.java new file mode 100644 index 0000000..bcd9a5f --- /dev/null +++ b/bourse/src/test/java/portefeuilleTest/AllTests.java @@ -0,0 +1,24 @@ +package portefeuilleTest; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +import dataFeed.boursorama.AllTestsDatafeed; +import portefeuilleTest.businessLogic.AllTestsBusinessLogic; +import portefeuilleTest.businessLogic.mobileAverage.AllTestsMobileAverage; +import portefeuilleTest.businessLogic.shareOrders.AllTestsShareOrders; +import portefeuilleTest.database.AllTestsDatabase; +import portefeuilleTest.util.AllTestsUtil; + +@RunWith(Suite.class) +@SuiteClasses({ AllTestsDatafeed.class, + AllTestsBusinessLogic.class, + AllTestsMobileAverage.class, + AllTestsShareOrders.class, + AllTestsDatabase.class, + AllTestsUtil.class}) +public class AllTests +{ + +} diff --git a/bourse/src/test/java/portefeuilleTest/TestCvs.java b/bourse/src/test/java/portefeuilleTest/TestCvs.java index 85a1210..e717426 100644 --- a/bourse/src/test/java/portefeuilleTest/TestCvs.java +++ b/bourse/src/test/java/portefeuilleTest/TestCvs.java @@ -63,56 +63,56 @@ public void testGetCSV() } - @Test - public void testGetCSVFromYahoo() - { - org.jooq.tools.csv.CSVReader csv=null; - try - { - URL url=new URL("http://download.finance.yahoo.com/d/quotes.csv?s=AIR.PA,IBM&f=l1c1ohgvjkm3m4prs7&e=.csv"); - BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream())); - csv = new org.jooq.tools.csv.CSVReader(br); - List all = csv.readAll(); - -// String str; -// do +// @Test +// public void testGetCSVFromYahoo() +// { +// org.jooq.tools.csv.CSVReader csv=null; +// try +// { +// URL url=new URL("http://download.finance.yahoo.com/d/quotes.csv?s=AIR.PA,IBM&f=l1c1ohgvjkm3m4prs7&e=.csv"); +// BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream())); +// csv = new org.jooq.tools.csv.CSVReader(br); +// List all = csv.readAll(); +// +//// String str; +//// do +//// { +//// str=br.readLine(); +//// } while (str!=null); +// +//// ReadableByteChannel rbc = Channels.newChannel(url.openStream()); +//// BufferedInputStream in=new BufferedInputStream(rbc.read(dst)) +//// FileOutputStream fos = new FileOutputStream("TEST_DATA/RESULT/information.txt"); +//// fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); +//// fos.close(); +// assertEquals(all.size(),2); +// assertEquals(all.get(0).length,13); +// assertEquals(all.get(1).length,13); +// } +// catch (MalformedURLException e) +// { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// catch (IOException e) +// { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// finally +// { +// if (csv != null) // { -// str=br.readLine(); -// } while (str!=null); - -// ReadableByteChannel rbc = Channels.newChannel(url.openStream()); -// BufferedInputStream in=new BufferedInputStream(rbc.read(dst)) -// FileOutputStream fos = new FileOutputStream("TEST_DATA/RESULT/information.txt"); -// fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); -// fos.close(); - assertEquals(all.size(),2); - assertEquals(all.get(0).length,13); - assertEquals(all.get(1).length,13); - } - catch (MalformedURLException e) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (IOException e) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } - finally - { - if (csv != null) - { - try - { - csv.close(); - } - catch (IOException e) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - } +// try +// { +// csv.close(); +// } +// catch (IOException e) +// { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } +// } +// } } diff --git a/bourse/src/test/java/portefeuilleTest/businessLogic/AllTests.java b/bourse/src/test/java/portefeuilleTest/businessLogic/AllTestsBusinessLogic.java similarity index 91% rename from bourse/src/test/java/portefeuilleTest/businessLogic/AllTests.java rename to bourse/src/test/java/portefeuilleTest/businessLogic/AllTestsBusinessLogic.java index 4758635..0ef6a3c 100644 --- a/bourse/src/test/java/portefeuilleTest/businessLogic/AllTests.java +++ b/bourse/src/test/java/portefeuilleTest/businessLogic/AllTestsBusinessLogic.java @@ -11,7 +11,7 @@ TestCsvExport.class, TestQuoteVariation.class , TestShareDivision.class}) -public class AllTests +public class AllTestsBusinessLogic { } diff --git a/bourse/src/test/java/portefeuilleTest/businessLogic/eval/AllTests.java b/bourse/src/test/java/portefeuilleTest/businessLogic/eval/AllTestsEval.java similarity index 90% rename from bourse/src/test/java/portefeuilleTest/businessLogic/eval/AllTests.java rename to bourse/src/test/java/portefeuilleTest/businessLogic/eval/AllTestsEval.java index bbef1de..00385d0 100644 --- a/bourse/src/test/java/portefeuilleTest/businessLogic/eval/AllTests.java +++ b/bourse/src/test/java/portefeuilleTest/businessLogic/eval/AllTestsEval.java @@ -6,7 +6,7 @@ @RunWith(Suite.class) @SuiteClasses({ TestEvaluation.class, TestQutotationMapStorage.class }) -public class AllTests +public class AllTestsEval { } diff --git a/bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/AllTests.java b/bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/AllTestsMobileAverage.java similarity index 87% rename from bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/AllTests.java rename to bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/AllTestsMobileAverage.java index bc0ec9f..3dd3f4f 100644 --- a/bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/AllTests.java +++ b/bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/AllTestsMobileAverage.java @@ -6,7 +6,7 @@ @RunWith(Suite.class) @SuiteClasses({ TestMobileAverage.class }) -public class AllTests +public class AllTestsMobileAverage { } diff --git a/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/AllTests.java b/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/AllTestsShareOrders.java similarity index 87% rename from bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/AllTests.java rename to bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/AllTestsShareOrders.java index 3997a46..5fc837e 100644 --- a/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/AllTests.java +++ b/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/AllTestsShareOrders.java @@ -6,7 +6,7 @@ @RunWith(Suite.class) @SuiteClasses({ TestBuy.class, TestSell.class }) -public class AllTests +public class AllTestsShareOrders { } diff --git a/bourse/src/test/java/portefeuilleTest/database/AllTests.java b/bourse/src/test/java/portefeuilleTest/database/AllTestsDatabase.java similarity index 91% rename from bourse/src/test/java/portefeuilleTest/database/AllTests.java rename to bourse/src/test/java/portefeuilleTest/database/AllTestsDatabase.java index 1c1d77b..904f2de 100644 --- a/bourse/src/test/java/portefeuilleTest/database/AllTests.java +++ b/bourse/src/test/java/portefeuilleTest/database/AllTestsDatabase.java @@ -11,7 +11,7 @@ TestCheckDatabase.class, TestShareCases.class }) -public class AllTests +public class AllTestsDatabase { } diff --git a/bourse/src/test/java/portefeuilleTest/util/AllTests.java b/bourse/src/test/java/portefeuilleTest/util/AllTestsUtil.java similarity index 90% rename from bourse/src/test/java/portefeuilleTest/util/AllTests.java rename to bourse/src/test/java/portefeuilleTest/util/AllTestsUtil.java index 02ea3f2..87db5fa 100644 --- a/bourse/src/test/java/portefeuilleTest/util/AllTests.java +++ b/bourse/src/test/java/portefeuilleTest/util/AllTestsUtil.java @@ -6,7 +6,7 @@ @RunWith(Suite.class) @SuiteClasses({ TestDigitalValue.class ,MailNotificatificationTest.class,TestCsv.class}) -public class AllTests +public class AllTestsUtil { } From 1e2bdcb576512bc6bd5e4f2084e9b9123b08c63e Mon Sep 17 00:00:00 2001 From: christian dubettier Date: Wed, 16 Dec 2020 15:26:29 +0100 Subject: [PATCH 04/19] fix bugs in testing: use highest price instead of last one for selling clsoe test db after using it (forgotten in 1 test) --- .../mobileAverage/TestMobileAverage.java | 1 + .../ShareOrderMockDataStorage.java | 14 +++--- ...reOrdersBuySellSharesMockDataProvider.java | 2 +- ...ShareOrdersSellBoughtMockDataProvider.java | 48 ++++++++----------- 4 files changed, 30 insertions(+), 35 deletions(-) diff --git a/bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/TestMobileAverage.java b/bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/TestMobileAverage.java index f9d5a1b..bb0d660 100644 --- a/bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/TestMobileAverage.java +++ b/bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/TestMobileAverage.java @@ -288,6 +288,7 @@ public void testComputeMobileAverageWithDbInput() final double expectedAverage=43.653; assertEquals(expectedAverage, average,0.005); + testDb.shutdown(); } catch (ClassNotFoundException e) diff --git a/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/ShareOrderMockDataStorage.java b/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/ShareOrderMockDataStorage.java index b258627..c8ecd62 100644 --- a/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/ShareOrderMockDataStorage.java +++ b/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/ShareOrderMockDataStorage.java @@ -148,25 +148,25 @@ public boolean hasBuySellThisExecutedValue(Integer buyId, Double newValue) return false; } - protected MockResult[] fillWithOneQuote(Integer Id) + protected MockResult[] fillHighPriceWithOneQuote(Integer Id) { DSLContext create = DSL.using( SQLDialect.HSQLDB); - Result> result = create.newResult(Quotes.QUOTES.LASTTRADEDPRICE); - Record1 item1=create.newRecord(Quotes.QUOTES.LASTTRADEDPRICE); + Result> result = create.newResult(Quotes.QUOTES.HIGHPRICE); + Record1 item1=create.newRecord(Quotes.QUOTES.HIGHPRICE); switch (Id.intValue()) { case ID_SHARE_1: - item1.setValue(Quotes.QUOTES.LASTTRADEDPRICE, CURRENT_VALUE_SHARE_1); + item1.setValue(Quotes.QUOTES.HIGHPRICE, CURRENT_VALUE_SHARE_1); break; case ID_SHARE_2: - item1.setValue(Quotes.QUOTES.LASTTRADEDPRICE, CURRENT_VALUE_SHARE_2); + item1.setValue(Quotes.QUOTES.HIGHPRICE, CURRENT_VALUE_SHARE_2); break; case ID_SHARE_3: - item1.setValue(Quotes.QUOTES.LASTTRADEDPRICE, CURRENT_VALUE_SHARE_3); + item1.setValue(Quotes.QUOTES.HIGHPRICE, CURRENT_VALUE_SHARE_3); break; default: - item1.setValue(Quotes.QUOTES.LASTTRADEDPRICE, 0.0); + item1.setValue(Quotes.QUOTES.HIGHPRICE, 0.0); } diff --git a/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/ShareOrdersBuySellSharesMockDataProvider.java b/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/ShareOrdersBuySellSharesMockDataProvider.java index a12076d..f4e7334 100644 --- a/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/ShareOrdersBuySellSharesMockDataProvider.java +++ b/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/ShareOrdersBuySellSharesMockDataProvider.java @@ -82,7 +82,7 @@ public MockResult[] execute(MockExecuteContext ctx) throws SQLException { Integer param = (Integer) ctx.bindings()[0]; - return fillWithOneQuote(param); + return fillHighPriceWithOneQuote(param); } if (sql.contains("from \"public\".\"quotes\"")) { diff --git a/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/ShareOrdersSellBoughtMockDataProvider.java b/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/ShareOrdersSellBoughtMockDataProvider.java index f50141f..71f0cb2 100644 --- a/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/ShareOrdersSellBoughtMockDataProvider.java +++ b/bourse/src/test/java/portefeuilleTest/businessLogic/shareOrders/ShareOrdersSellBoughtMockDataProvider.java @@ -1,9 +1,12 @@ package portefeuilleTest.businessLogic.shareOrders; +import static org.junit.Assert.fail; + import java.sql.SQLException; import java.time.LocalDateTime; import org.jooq.DSLContext; +import org.jooq.Record6; import org.jooq.Record8; import org.jooq.Result; import org.jooq.SQLDialect; @@ -14,6 +17,7 @@ import net.tuxanna.database.jooq.public_.tables.Buy; import net.tuxanna.database.jooq.public_.tables.Sell; +import net.tuxanna.database.jooq.public_.tables.Shares; public class ShareOrdersSellBoughtMockDataProvider extends ShareOrderMockDataStorage implements MockDataProvider @@ -32,7 +36,7 @@ public MockResult[] execute(MockExecuteContext ctx) throws SQLException if (sql.contains("select")) { - if (sql.contains("from \"public\".\"sell")) + if (sql.contains("\"public\".\"sell\".\"idsell\", \"public\".\"sell\".\"idshare\", \"public\".\"sell\".\"idaccount\", \"public\".\"sell\".\"qte\", \"public\".\"sell\".\"unitpricerequested\", \"public\".\"shares\".\"name\" from \"public\".\"sell\", \"public\".\"shares\"")) { return fillWithSell(); } @@ -50,16 +54,18 @@ public MockResult[] execute(MockExecuteContext ctx) throws SQLException return fillWithPortfolio(shareID); } - if (sql.contains("select \"public\".\"quotes\".\"lasttradedprice\" from \"public\".\"quotes\"")) + + if (sql.contains("select \"public\".\"quotes\".\"highprice\" from \"public\".\"quotes\"")) { Integer param = (Integer) ctx.bindings()[0]; - return fillWithOneQuote(param); + return fillHighPriceWithOneQuote(param); } if (sql.contains("from \"public\".\"quotes\"")) { return fillWithQuotes(); } + fail("unexpected request"); } if (sql.contains("update \"public\".\"portfolio")) //update "public"."portfolio" set "public"."portfolio"."unitprice" = cast(? as double), "public"."portfolio"."qte" = cast(? as double) where "public"."portfolio"."idportfolio" = cast(? as int) { @@ -88,55 +94,43 @@ public MockResult[] execute(MockExecuteContext ctx) throws SQLException private MockResult[] fillWithSell() { + DSLContext create = DSL.using( SQLDialect.HSQLDB); - Result> result = create.newResult( + Result> result = create.newResult( Sell.SELL.IDSELL, Sell.SELL.IDSHARE, Sell.SELL.IDACCOUNT, - Sell.SELL.DATEEXPIRATION, Sell.SELL.QTE, - Sell.SELL.STATE, - Sell.SELL.UNITPRICESOLD, - Sell.SELL.UNITPRICEREQUESTED); - - final Integer stateValid=0; - final Double dummyPrice=0.1; + Sell.SELL.UNITPRICEREQUESTED, + Shares.SHARES.NAME); result.add(create .newRecord(Sell.SELL.IDSELL, Sell.SELL.IDSHARE, Sell.SELL.IDACCOUNT, - Sell.SELL.DATEEXPIRATION, Sell.SELL.QTE, - Sell.SELL.STATE, - Sell.SELL.UNITPRICESOLD, - Sell.SELL.UNITPRICEREQUESTED) + Sell.SELL.UNITPRICEREQUESTED, + Shares.SHARES.NAME) .values(ID_SELL_2, ID_SHARE_2, ID_ACCOUNT_1, - LocalDateTime.now(),//not used sellQte, - stateValid, - dummyPrice, - SELL_PRICE_SHARE_2)); // current price > requested for selling -> sold + SELL_PRICE_SHARE_2, // current price > requested for selling -> sold + "name share 2")); result.add(create .newRecord(Sell.SELL.IDSELL, Sell.SELL.IDSHARE, Sell.SELL.IDACCOUNT, - Sell.SELL.DATEEXPIRATION, Sell.SELL.QTE, - Sell.SELL.STATE, - Sell.SELL.UNITPRICESOLD, - Sell.SELL.UNITPRICEREQUESTED) + Sell.SELL.UNITPRICEREQUESTED, + Shares.SHARES.NAME) .values(ID_SELL_1, ID_SHARE_1, ID_ACCOUNT_1, - LocalDateTime.now(),//not used sellQte, - stateValid, - dummyPrice, - CURRENT_VALUE_SHARE_1+1.0)); //current price too low for selling + CURRENT_VALUE_SHARE_1+1.0,//current price too low for selling + "name share1")); return new MockResult[] { new MockResult(2, result) From a369edc7b970b8b9e1aa41a547146805bada13b0 Mon Sep 17 00:00:00 2001 From: christian dubettier Date: Mon, 4 Jan 2021 18:48:40 +0100 Subject: [PATCH 05/19] trace --- .../share_orders/SellManagement.java | 4 +- .../portefeuille/database/Database.java | 38 ++++++++++--------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/bourse/src/main/java/net/tuxanna/portefeuille/business_logic/share_orders/SellManagement.java b/bourse/src/main/java/net/tuxanna/portefeuille/business_logic/share_orders/SellManagement.java index c1594a1..6591f21 100644 --- a/bourse/src/main/java/net/tuxanna/portefeuille/business_logic/share_orders/SellManagement.java +++ b/bourse/src/main/java/net/tuxanna/portefeuille/business_logic/share_orders/SellManagement.java @@ -71,13 +71,13 @@ private boolean findExecutedSellOrders(Date date) } else { - logger.error("unexpected qte="+shareInPortfolio.getQte().getValue()+" for id="+shareId); + logger.error("unexpected qte {} for id= {}",shareInPortfolio.getQte().getValue(),shareId); result=false; } } else { - logger.error("empty qte or price for id="+shareId); + logger.error("empty qte or price for id={}",shareId); result=false; } } diff --git a/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java b/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java index 7c61c98..b6e9d11 100644 --- a/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java +++ b/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java @@ -408,7 +408,7 @@ public boolean insertQuotation(List listQuote) if (isSomethingToDo) { int result = request.execute(); - logger.debug("added {} returning ",listQuote.size(),result); + logger.debug("added {} returning {}",listQuote.size(),result); } return true; } @@ -455,13 +455,15 @@ private static String createTableShares() private static String createTableQuotes() { return "create table QUOTES(idQuotes integer generated by default as IDENTITY(start with 0 increment by 1) primary key," - + "idShare integer,dateQuote TIMESTAMP WITHOUT TIME ZONE not NULL,lastTradedPrice DOUBLE not NULL,changeInPrice DOUBLE, openPrice DOUBLE,highPrice DOUBLE,lowPrice DOUBLE,volume DOUBLE,low52Week DOUBLE,high52Week DOUBLE, mobileAverage50Days DOUBLE, mobileAverage200Days DOUBLE,previousClose DOUBLE,peRatio DOUBLE,shortRatio DOUBLE,FOREIGN KEY (idShare) REFERENCES SHARES(idShare))"; + + "idShare integer,dateQuote TIMESTAMP WITHOUT TIME ZONE not NULL,lastTradedPrice DOUBLE not NULL,changeInPrice DOUBLE" + +",openPrice DOUBLE,highPrice DOUBLE," + +"lowPrice DOUBLE,volume DOUBLE,low52Week DOUBLE,high52Week DOUBLE,mobileAverage50Days DOUBLE, mobileAverage200Days DOUBLE,previousClose DOUBLE,peRatio DOUBLE,shortRatio DOUBLE,FOREIGN KEY (idShare) REFERENCES SHARES(idShare))"; } private static String createTablePortfolio() { //quantity for funds could be not an int - return "create table PORTFOLIO(idPortfolio integer generated by default as IDENTITY(start with 0 increment by 1) primary key,idShare integer, idAccount integer, qte DOUBLE,unitPrice DOUBLE,useForSummary integer NOT NULL ,FOREIGN KEY (idShare) REFERENCES SHARES(idShare),FOREIGN KEY (idAccount) REFERENCES ACCOUNT(idAccount))"; + return "create table PORTFOLIO(idPortfolio integer generated by default as IDENTITY(start with 0 increment by 1) primary key,idShare integer, idAccount integer, qte DOUBLE, unitPrice DOUBLE ,useForSummary integer NOT NULL, FOREIGN KEY(idShare) REFERENCES SHARES(idShare),FOREIGN KEY (idAccount) REFERENCES ACCOUNT(idAccount))"; } private static String createTableAccount() @@ -498,20 +500,20 @@ public boolean checkIfTableExist(String tableName) throws SQLException selectRequest.append(tableName); selectRequest.append("' LIMIT 1"); - PreparedStatement selectStatement; - selectStatement = conn.prepareStatement(selectRequest.toString()); - - boolean exist; - ResultSet results = selectStatement.executeQuery(); - if (results.next()) - { - exist=true; - } - else + boolean exist=false; + try (PreparedStatement selectStatement = conn.prepareStatement(selectRequest.toString())) { - exist=false; + ResultSet results = selectStatement.executeQuery(); + if (results.next()) + { + exist=true; + } + else + { + exist=false; + } + selectStatement.close(); //TODO manage correctly exception to avoid not closing } - selectStatement.close(); //TODO manage correctly exception to avoid not closing return exist; } @@ -708,13 +710,13 @@ public boolean updatePortfolio(PortfolioDB portfolioDB) } else { - logger.error("failed to update, invalid price {}",portfolioDB.toString()); + logger.error("failed to update, invalid price {}",portfolioDB); return false; } } else { - logger.error("failed to update, invalid qte {}",portfolioDB.toString()); + logger.error("failed to update, invalid qte {}",portfolioDB); return false; } @@ -1095,7 +1097,7 @@ private Double checkVariationForOneQuotation(List listIdToBeChecked, { Integer Id=recordDate.get(Quotes.QUOTES.IDQUOTES); listIdToBeChecked.add(Id); - logger.warn("quotation invalid found for IDQUOTES={}",Id.toString()); + logger.warn("quotation invalid found for IDQUOTES={}",Id); } else { From 91e96f1e32705198d61332376c6ec714fba1e8e9 Mon Sep 17 00:00:00 2001 From: dchris Date: Sun, 21 Feb 2021 16:52:16 +0100 Subject: [PATCH 06/19] jooq 3.14.7 --- bourse/build.gradle | 8 +--- .../database/jooq/public_/tables/Buy.java | 13 ++++- .../jooq/public_/tables/Portfolio.java | 13 ++++- .../database/jooq/public_/tables/Quotes.java | 47 ++++++++++++++++++- .../database/jooq/public_/tables/Sell.java | 13 ++++- 5 files changed, 80 insertions(+), 14 deletions(-) diff --git a/bourse/build.gradle b/bourse/build.gradle index 72e4b2d..c9de856 100644 --- a/bourse/build.gradle +++ b/bourse/build.gradle @@ -58,13 +58,7 @@ dependencies { } jooq { - version = '3.14.4' // the default (can be omitted) - edition = nu.studer.gradle.jooq.JooqEdition.OSS // the default (can be omitted) -} - - -jooq { - version = '3.14.4' + version = '3.14.7' edition = nu.studer.gradle.jooq.JooqEdition.OSS configurations { diff --git a/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Buy.java b/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Buy.java index e63209f..7a7175c 100644 --- a/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Buy.java +++ b/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Buy.java @@ -145,12 +145,21 @@ public List> getKeys() { return Arrays.>asList(Keys.SYS_FK_10156, Keys.SYS_FK_10157); } + private transient Shares _shares; + private transient Account _account; + public Shares shares() { - return new Shares(this, Keys.SYS_FK_10156); + if (_shares == null) + _shares = new Shares(this, Keys.SYS_FK_10156); + + return _shares; } public Account account() { - return new Account(this, Keys.SYS_FK_10157); + if (_account == null) + _account = new Account(this, Keys.SYS_FK_10157); + + return _account; } @Override diff --git a/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Portfolio.java b/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Portfolio.java index 93ae614..d9798ce 100644 --- a/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Portfolio.java +++ b/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Portfolio.java @@ -134,12 +134,21 @@ public List> getKeys() { return Arrays.>asList(Keys.SYS_FK_10123, Keys.SYS_FK_10124); } + private transient Shares _shares; + private transient Account _account; + public Shares shares() { - return new Shares(this, Keys.SYS_FK_10123); + if (_shares == null) + _shares = new Shares(this, Keys.SYS_FK_10123); + + return _shares; } public Account account() { - return new Account(this, Keys.SYS_FK_10124); + if (_account == null) + _account = new Account(this, Keys.SYS_FK_10124); + + return _account; } @Override diff --git a/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Quotes.java b/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Quotes.java index d980ba3..cefe254 100644 --- a/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Quotes.java +++ b/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Quotes.java @@ -67,6 +67,11 @@ public Class getRecordType() { */ public final TableField LASTTRADEDPRICE = createField(DSL.name("LASTTRADEDPRICE"), SQLDataType.DOUBLE.nullable(false), this, ""); + /** + * The column PUBLIC.QUOTES.CHANGEINPRICE. + */ + public final TableField CHANGEINPRICE = createField(DSL.name("CHANGEINPRICE"), SQLDataType.DOUBLE, this, ""); + /** * The column PUBLIC.QUOTES.OPENPRICE. */ @@ -87,6 +92,41 @@ public Class getRecordType() { */ public final TableField VOLUME = createField(DSL.name("VOLUME"), SQLDataType.DOUBLE, this, ""); + /** + * The column PUBLIC.QUOTES.LOW52WEEK. + */ + public final TableField LOW52WEEK = createField(DSL.name("LOW52WEEK"), SQLDataType.DOUBLE, this, ""); + + /** + * The column PUBLIC.QUOTES.HIGH52WEEK. + */ + public final TableField HIGH52WEEK = createField(DSL.name("HIGH52WEEK"), SQLDataType.DOUBLE, this, ""); + + /** + * The column PUBLIC.QUOTES.MOBILEAVERAGE50DAYS. + */ + public final TableField MOBILEAVERAGE50DAYS = createField(DSL.name("MOBILEAVERAGE50DAYS"), SQLDataType.DOUBLE, this, ""); + + /** + * The column PUBLIC.QUOTES.MOBILEAVERAGE200DAYS. + */ + public final TableField MOBILEAVERAGE200DAYS = createField(DSL.name("MOBILEAVERAGE200DAYS"), SQLDataType.DOUBLE, this, ""); + + /** + * The column PUBLIC.QUOTES.PREVIOUSCLOSE. + */ + public final TableField PREVIOUSCLOSE = createField(DSL.name("PREVIOUSCLOSE"), SQLDataType.DOUBLE, this, ""); + + /** + * The column PUBLIC.QUOTES.PERATIO. + */ + public final TableField PERATIO = createField(DSL.name("PERATIO"), SQLDataType.DOUBLE, this, ""); + + /** + * The column PUBLIC.QUOTES.SHORTRATIO. + */ + public final TableField SHORTRATIO = createField(DSL.name("SHORTRATIO"), SQLDataType.DOUBLE, this, ""); + private Quotes(Name alias, Table aliased) { this(alias, aliased, null); } @@ -145,8 +185,13 @@ public List> getKeys() { return Arrays.>asList(Keys.SYS_FK_10107); } + private transient Shares _shares; + public Shares shares() { - return new Shares(this, Keys.SYS_FK_10107); + if (_shares == null) + _shares = new Shares(this, Keys.SYS_FK_10107); + + return _shares; } @Override diff --git a/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Sell.java b/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Sell.java index 264b215..280969d 100644 --- a/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Sell.java +++ b/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Sell.java @@ -145,12 +145,21 @@ public List> getKeys() { return Arrays.>asList(Keys.SYS_FK_10138, Keys.SYS_FK_10139); } + private transient Shares _shares; + private transient Account _account; + public Shares shares() { - return new Shares(this, Keys.SYS_FK_10138); + if (_shares == null) + _shares = new Shares(this, Keys.SYS_FK_10138); + + return _shares; } public Account account() { - return new Account(this, Keys.SYS_FK_10139); + if (_account == null) + _account = new Account(this, Keys.SYS_FK_10139); + + return _account; } @Override From 05a32e3624df431ad2c3d7df888e1de7be7c43d7 Mon Sep 17 00:00:00 2001 From: dchris Date: Sun, 21 Feb 2021 16:54:02 +0100 Subject: [PATCH 07/19] remove unused var --- .../database/TestDatabaseStorage.java | 38 ------------------- 1 file changed, 38 deletions(-) diff --git a/bourse/src/test/java/portefeuilleTest/database/TestDatabaseStorage.java b/bourse/src/test/java/portefeuilleTest/database/TestDatabaseStorage.java index 2624457..622b1b3 100644 --- a/bourse/src/test/java/portefeuilleTest/database/TestDatabaseStorage.java +++ b/bourse/src/test/java/portefeuilleTest/database/TestDatabaseStorage.java @@ -34,72 +34,34 @@ public class TestDatabaseStorage private static final String TICKER1 = "ticker1"; private static final String NAME1 = "name1"; - private static final double changeInPrice_0 = 1.05; - private static final double high52Week_0 = 1.01; private static final double highPrice_0 = 1.02; private static final double lastTradedPrice_0 = 1.03; - private static final double low52Week_0 = 1.04; private static final double lowPrice_0 = 1.05; - private static final double mobileAverage200Days_0 = 1.06; - private static final double mobileAverage50Days_0 = 1.07; private static final double openPrice_0 = 1.08; - private static final double peRatio_0 = 1.09; - private static final double previousClose_0 = 1.011; - private static final double shortRatio_0 = 1.012; private static final double volume_0 = 1.013; - private static final double changeInPrice_1 = 2.05; - private static final double high52Week_1 = 2.01; private static final double highPrice_1 = 2.02; private static final double lastTradedPrice_1 = 2.03; - private static final double low52Week_1 = 2.04; private static final double lowPrice_1 = 2.05; - private static final double mobileAverage200Days_1 = 2.06; - private static final double mobileAverage50Days_1 = 2.07; private static final double openPrice_1 = 2.08; - private static final double peRatio_1 = 2.09; - private static final double previousClose_1 = 2.011; - private static final double shortRatio_1 = 2.012; private static final double volume_1 = 2.013; - private static final double changeInPrice_2 = 3.05; - private static final double high52Week_2 = 3.01; private static final double highPrice_2 = 3.02; private static final double lastTradedPrice_2 = 3.03; - private static final double low52Week_2 = 3.04; private static final double lowPrice_2 = 3.05; - private static final double mobileAverage200Days_2 = 3.06; - private static final double mobileAverage50Days_2 = 3.07; private static final double openPrice_2 = 3.08; - private static final double peRatio_2 = 3.09; - private static final double previousClose_2 = 3.011; - private static final double shortRatio_2 = 3.012; private static final double volume_2 = 3.013; - private static final double changeInPrice_3 = 40.05; - private static final double high52Week_3 = 40.01; private static final double highPrice_3 = 40.02; private static final double lastTradedPrice_3 = 40.03; - private static final double low52Week_3 = 40.04; private static final double lowPrice_3 = 40.05; private static final double openPrice_3 = 40.08; - private static final double peRatio_3 = 40.09; - private static final double previousClose_3 = 40.011; - private static final double shortRatio_3 = 40.012; private static final double volume_3 = 40.013; - private static final double changeInPrice_4 = 25.905; - private static final double high52Week_4 = 25.901; private static final double highPrice_4 = 25.902; private static final double lastTradedPrice_4 = 25.903; - private static final double low52Week_4 = 25.904; private static final double lowPrice_4 = 25.905; - private static final double mobileAverage200Days_4 = 25.906; - private static final double mobileAverage50Days_4 = 25.907; private static final double openPrice_4 = 25.908; - private static final double peRatio_4 = 25.909; - private static final double previousClose_4 = 25.9011; - private static final double shortRatio_4 = 25.9012; private static final double volume_4 = 25.9013; private RamDatabaseForTest testDb; From 86b26517fc529badf617d270c0943331b8548b27 Mon Sep 17 00:00:00 2001 From: dchris Date: Sun, 21 Feb 2021 17:38:54 +0100 Subject: [PATCH 08/19] supression des champs yahoo non utilise par bourso alter table quotes drop column CHANGEINPRICE; alter table quotes drop column SHORTRATIO; alter table quotes drop column PERATIO; alter table quotes drop column MOBILEAVERAGE200DAYS; alter table quotes drop column MOBILEAVERAGE50DAYS; alter table quotes drop column HIGH52WEEK; alter table quotes drop column LOW52WEEK; alter table quotes drop column PREVIOUSCLOSE; --- .../database/jooq/public_/tables/Quotes.java | 40 ------------------- .../mobile_average/MobileAverage.java | 2 +- .../portefeuille/database/Database.java | 4 +- .../database/TestDatabaseWithDbUnit.java | 9 ++--- 4 files changed, 6 insertions(+), 49 deletions(-) diff --git a/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Quotes.java b/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Quotes.java index cefe254..bbb1120 100644 --- a/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Quotes.java +++ b/bourse/src/generated/jooq/net/tuxanna/database/jooq/public_/tables/Quotes.java @@ -67,11 +67,6 @@ public Class getRecordType() { */ public final TableField LASTTRADEDPRICE = createField(DSL.name("LASTTRADEDPRICE"), SQLDataType.DOUBLE.nullable(false), this, ""); - /** - * The column PUBLIC.QUOTES.CHANGEINPRICE. - */ - public final TableField CHANGEINPRICE = createField(DSL.name("CHANGEINPRICE"), SQLDataType.DOUBLE, this, ""); - /** * The column PUBLIC.QUOTES.OPENPRICE. */ @@ -92,41 +87,6 @@ public Class getRecordType() { */ public final TableField VOLUME = createField(DSL.name("VOLUME"), SQLDataType.DOUBLE, this, ""); - /** - * The column PUBLIC.QUOTES.LOW52WEEK. - */ - public final TableField LOW52WEEK = createField(DSL.name("LOW52WEEK"), SQLDataType.DOUBLE, this, ""); - - /** - * The column PUBLIC.QUOTES.HIGH52WEEK. - */ - public final TableField HIGH52WEEK = createField(DSL.name("HIGH52WEEK"), SQLDataType.DOUBLE, this, ""); - - /** - * The column PUBLIC.QUOTES.MOBILEAVERAGE50DAYS. - */ - public final TableField MOBILEAVERAGE50DAYS = createField(DSL.name("MOBILEAVERAGE50DAYS"), SQLDataType.DOUBLE, this, ""); - - /** - * The column PUBLIC.QUOTES.MOBILEAVERAGE200DAYS. - */ - public final TableField MOBILEAVERAGE200DAYS = createField(DSL.name("MOBILEAVERAGE200DAYS"), SQLDataType.DOUBLE, this, ""); - - /** - * The column PUBLIC.QUOTES.PREVIOUSCLOSE. - */ - public final TableField PREVIOUSCLOSE = createField(DSL.name("PREVIOUSCLOSE"), SQLDataType.DOUBLE, this, ""); - - /** - * The column PUBLIC.QUOTES.PERATIO. - */ - public final TableField PERATIO = createField(DSL.name("PERATIO"), SQLDataType.DOUBLE, this, ""); - - /** - * The column PUBLIC.QUOTES.SHORTRATIO. - */ - public final TableField SHORTRATIO = createField(DSL.name("SHORTRATIO"), SQLDataType.DOUBLE, this, ""); - private Quotes(Name alias, Table aliased) { this(alias, aliased, null); } diff --git a/bourse/src/main/java/net/tuxanna/portefeuille/business_logic/mobile_average/MobileAverage.java b/bourse/src/main/java/net/tuxanna/portefeuille/business_logic/mobile_average/MobileAverage.java index 33232d3..23f25d5 100644 --- a/bourse/src/main/java/net/tuxanna/portefeuille/business_logic/mobile_average/MobileAverage.java +++ b/bourse/src/main/java/net/tuxanna/portefeuille/business_logic/mobile_average/MobileAverage.java @@ -30,7 +30,7 @@ public MobileAverage(ShareDB p_share,QuoteI p_db, int p_nbDay) public Double compute() { - //we cannot extract exactly the number because soome item will be discarded (quote on saturday-> no quotation -> do not add duplication) + //we cannot extract exactly the number because some item will be discarded (quote on saturday-> no quotation -> do not add duplication) final int nbItemToExtractFromDb=(int) ((float)nbDay*1.2); SearchLimitedNumberOfQuote search=new SearchLimitedNumberOfQuote(share, nbItemToExtractFromDb); List listQuote=new ArrayList(); diff --git a/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java b/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java index b6e9d11..be6f1fd 100644 --- a/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java +++ b/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java @@ -455,9 +455,9 @@ private static String createTableShares() private static String createTableQuotes() { return "create table QUOTES(idQuotes integer generated by default as IDENTITY(start with 0 increment by 1) primary key," - + "idShare integer,dateQuote TIMESTAMP WITHOUT TIME ZONE not NULL,lastTradedPrice DOUBLE not NULL,changeInPrice DOUBLE" + + "idShare integer,dateQuote TIMESTAMP WITHOUT TIME ZONE not NULL,lastTradedPrice DOUBLE not NULL" +",openPrice DOUBLE,highPrice DOUBLE," - +"lowPrice DOUBLE,volume DOUBLE,low52Week DOUBLE,high52Week DOUBLE,mobileAverage50Days DOUBLE, mobileAverage200Days DOUBLE,previousClose DOUBLE,peRatio DOUBLE,shortRatio DOUBLE,FOREIGN KEY (idShare) REFERENCES SHARES(idShare))"; + +"lowPrice DOUBLE,volume DOUBLE, FOREIGN KEY (idShare) REFERENCES SHARES(idShare))"; } private static String createTablePortfolio() diff --git a/bourse/src/test/java/portefeuilleTest/database/TestDatabaseWithDbUnit.java b/bourse/src/test/java/portefeuilleTest/database/TestDatabaseWithDbUnit.java index d080b40..262d476 100644 --- a/bourse/src/test/java/portefeuilleTest/database/TestDatabaseWithDbUnit.java +++ b/bourse/src/test/java/portefeuilleTest/database/TestDatabaseWithDbUnit.java @@ -204,9 +204,8 @@ public void testReadQuotationAtOneDay() // should be // assertEquals(50,quote.getIdQuote()); assertEquals(10.03, quote.getQuotation().getLastTradedPrice().getValue(), 0.0001 /* delta */); } @@ -525,10 +524,8 @@ public void LoadQuotesBeforeDefinedDate() //expected // + //LASTTRADEDPRICE="560.0" OPENPRICE="40.08" + //HIGHPRICE="40.02" LOWPRICE="40.05" VOLUME="40.013" assertEquals(14, cal.get(Calendar.DAY_OF_MONTH)); assertEquals(2016, cal.get(Calendar.YEAR)); assertEquals(9, cal.get(Calendar.MONTH)); //month starts at 0 From 4086c1d10567cb79769361d0203d0e71de59f58b Mon Sep 17 00:00:00 2001 From: dchris Date: Sun, 21 Feb 2021 17:39:13 +0100 Subject: [PATCH 09/19] supression var inulite --- .../businessLogic/mobileAverage/TestMobileAverage.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/TestMobileAverage.java b/bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/TestMobileAverage.java index bb0d660..7dfe458 100644 --- a/bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/TestMobileAverage.java +++ b/bourse/src/test/java/portefeuilleTest/businessLogic/mobileAverage/TestMobileAverage.java @@ -19,11 +19,11 @@ public class TestMobileAverage { - final double PRICE_1=100.0; - final double PRICE_2=105.0; - final double PRICE_3=109.0; - final double PRICE_4=119.0; - final double PRICE_NOT_USED=1; + final private double PRICE_1=100.0; + final private double PRICE_2=105.0; + final private double PRICE_3=109.0; + final private double PRICE_4=119.0; + final private double PRICE_NOT_USED=1; @Test public void testCompute() From 67e70d117ff7aff655e3a033bd8dadf28918ba13 Mon Sep 17 00:00:00 2001 From: dchris Date: Sun, 21 Feb 2021 17:51:02 +0100 Subject: [PATCH 10/19] fix bug already fixed in master --- .../main/java/net/tuxanna/portefeuille/database/Database.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java b/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java index be6f1fd..3511e1a 100644 --- a/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java +++ b/bourse/src/main/java/net/tuxanna/portefeuille/database/Database.java @@ -917,7 +917,7 @@ public void deleteOutdatedQuotes(java.util.Date limitDateForDeletion) cal.setTime(limitDateForDeletion); // sets calendar time/date //take all the day as valid final int year=cal.get(Calendar.YEAR); - final int month=cal.get(Calendar.MONTH); + final int month=cal.get(Calendar.MONTH)+1;//month from 0..11 final int dayOfMonth=cal.get(Calendar.DAY_OF_MONTH); final int hour=cal.get(Calendar.HOUR); final int minute=cal.get(Calendar.MINUTE); From fe57aa8115c86344ca092656a89c5116af7d20e6 Mon Sep 17 00:00:00 2001 From: dchris Date: Sun, 21 Feb 2021 17:54:34 +0100 Subject: [PATCH 11/19] version --- bourse/src/main/java/net/tuxanna/portefeuille/Portefeuille.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bourse/src/main/java/net/tuxanna/portefeuille/Portefeuille.java b/bourse/src/main/java/net/tuxanna/portefeuille/Portefeuille.java index 1037de4..ddd12f1 100644 --- a/bourse/src/main/java/net/tuxanna/portefeuille/Portefeuille.java +++ b/bourse/src/main/java/net/tuxanna/portefeuille/Portefeuille.java @@ -25,7 +25,7 @@ public class Portefeuille implements Runnable { - private static final String VERSION="1.09"; + private static final String VERSION="2.00.0"; private static final Logger logger = LogManager.getLogger(Portefeuille.class); @Option(names={"-create"}, description="create database", required=false) From 6bb391ef26ddefa1f1228cbc2ad98363ecf8daef Mon Sep 17 00:00:00 2001 From: dchris Date: Tue, 21 Sep 2021 19:33:08 +0200 Subject: [PATCH 12/19] adding tracker feature --- ...on Bourse Euronext Paris - Boursorama.html | 3762 +++++++++++++++++ .../1162c4c08db38cbf9c16b473.js | 1 + .../122017e829d38aae427b02d2.js | 1 + .../17.png | Bin 0 -> 1049 bytes .../17_002.png | Bin 0 -> 1049 bytes .../17_003.png | Bin 0 -> 1049 bytes .../2406683d26548faf95fcc36a.js | 1 + .../2467268df3b112be3f8bf3c3.js | 1 + .../4268af09fd05f2b4d9de32d2.js | 2 + .../47f225bf69661c570ac0ab.js | 2 + .../5723.css | 1448 +++++++ .../7098c073bbeec7f12de4062e.js | 1 + .../719854f50ba40eb59c85ad9a.js | 2 + .../86742ed654f9e31376c3b368.js | 1 + .../9654dd2334711dc242d4b95.js | 1 + .../9716377c04288278b5d00f06.js | 2 + .../9755b6b140eefd3ddcf20591.js | 2 + ...a9Vf3jyCHmNQPA-EZoOIH1zIedNp4bAVMc3qX6.jpg | Bin 0 -> 975 bytes .../a.html | 2 + .../a_002.html | 2 + .../ads876bedd4dfca41fc1266.js | 1 + .../boomerang0446b5597235a183dc6f.js | 1 + ...HnioNZITinfYPvMYCLoS6Ua7I-7rYZ4VmQIvws.jpg | Bin 0 -> 970 bytes .../foot2cfa80a5e11f5be2a1ea.js | 2 + .../foot_trading70fb88151cdf90f3a6e4.js | 2 + .../globalf14bcbffb9b6bef086b7.js | 2 + .../head.css | 824 ++++ .../loader.js | 1 + .../outbrain.js | 47 + ...HdsjAANAOo8cfpCN2uGUUCNoaS9fbelnNFwpB1.jpg | Bin 0 -> 975 bytes .../rum56666899a9e9f78dfc14.js | 1 + .../runtime18cf396f7cdabdc7fb0d.js | 1 + .../sdk.js | 2 + .../business_logic/PortfolioManagement.java | 4 +- .../tuxanna/portefeuille/dataFeed/Ticker.java | 18 +- .../portefeuille/dataFeed/TickerI.java | 11 +- .../boursorama/BoursoramaParser.java | 6 +- .../BoursoramaQuotationProvider.java | 21 +- .../portefeuille/database/Database.java | 6 +- .../portefeuille/database/ShareDB.java | 67 +- .../portefeuille/util/DataConverter.java | 21 +- .../boursorama/BoursoramaParserTest.java | 33 +- .../businessLogic/FakeShareTicker.java | 4 +- .../businessLogic/TestCsvExport.java | 5 +- .../TestPortfolioManagement.java | 5 +- .../businessLogic/TestShareDivision.java | 7 +- .../businessLogic/eval/FakeDatabase.java | 9 +- .../businessLogic/eval/TestEvaluation.java | 5 +- .../eval/TestQutotationMapStorage.java | 5 +- .../database/TestDatabaseStorage.java | 11 +- .../database/TestDatabaseWithDbUnit.java | 7 +- .../portefeuilleTest/database/TestSearch.java | 3 +- .../java/portefeuilleTest/util/TestCsv.java | 7 +- 53 files changed, 6277 insertions(+), 93 deletions(-) create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama.html create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/1162c4c08db38cbf9c16b473.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/122017e829d38aae427b02d2.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/17.png create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/17_002.png create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/17_003.png create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/2406683d26548faf95fcc36a.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/2467268df3b112be3f8bf3c3.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/4268af09fd05f2b4d9de32d2.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/47f225bf69661c570ac0ab.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/5723.css create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/7098c073bbeec7f12de4062e.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/719854f50ba40eb59c85ad9a.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/86742ed654f9e31376c3b368.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/9654dd2334711dc242d4b95.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/9716377c04288278b5d00f06.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/9755b6b140eefd3ddcf20591.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/Jj5qMxw4UzAiN6GBLxk8xea9Vf3jyCHmNQPA-EZoOIH1zIedNp4bAVMc3qX6.jpg create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/a.html create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/a_002.html create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/ads876bedd4dfca41fc1266.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/boomerang0446b5597235a183dc6f.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/cH2nG5XXqCYTb1REYeZyizHnioNZITinfYPvMYCLoS6Ua7I-7rYZ4VmQIvws.jpg create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/foot2cfa80a5e11f5be2a1ea.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/foot_trading70fb88151cdf90f3a6e4.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/globalf14bcbffb9b6bef086b7.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/head.css create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/loader.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/outbrain.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/pGB1joXLMbpzwsEiXoisljHdsjAANAOo8cfpCN2uGUUCNoaS9fbelnNFwpB1.jpg create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/rum56666899a9e9f78dfc14.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/runtime18cf396f7cdabdc7fb0d.js create mode 100644 bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/sdk.js diff --git a/bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama.html b/bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama.html new file mode 100644 index 0000000..1ad29b5 --- /dev/null +++ b/bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama.html @@ -0,0 +1,3762 @@ + + + + + + + +AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama + Aller au contenu principal + Activer le contraste adaptéDésactiver le contraste adapté
  1. + Aide
    1. +
    2. + + + +
    3. +
    4. + + Espace Client +
    5. +
    6. + + +
    7. +
    +
  1. + Aide
    1. +
    2. + + + +
    3. +
    4. + + Espace Client +
    5. +
    6. + + +
    7. +
    +
+
+

Cours

+ AMUNDI MSCI EM ASIA UCITS ETF - USD +

42.4379 USD
+ (Valeur liquidative au 21.09.21 / 17:35:00) +
+0.17%  +
valeur indicative 36.1834 EUR

LU1681044563 - Amundi Luxembourg S.A.

Euronext Paris données temps réel
Sous-jacent MSCI Emerging Markets Asia
Politique d'exécution
JavaScript chart by amCharts 3.20.2020/0920/0942434445
  • + indice de référence +

    + MSCI Emerging Markets Asia +

  • + catégorie morningstar +

    + Actions Asie hors Japon +

  • + ouverture +

    42.4622

  • + clôture veille +

    42.3640

  • + + haut +

    42.7106

  • + + bas +

    42.3579

  • + volume +

    10 808

  • + dernier échange +

    21.09.21 / 17:35:00

  • + limite à la baisse +

    + 41.2929 +

  • + limite à la hausse +

    + 43.8471 +

  • + Éligibilité +

    -

  • + Risque du fonds +

    6/7

  • + Portefeuille

  • + Liste

+
+
+
+ +

+
+
+
+ +
+ + + + + Carnet d'ordres
+
+ +

+ +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

ordres

+
+

+ quantité + qté +

+
+

achat

+
+

vente

+
+

+ quantité + qté +

+
+

ordres

+
14040.100046.9000401
135038.000046.50005001
130034.650042.86853 0241
130037.000042.65431 3621
125039.800042.62502 9991
13 08741.991942.624089 6001
11 36242.183042.57157 0811
189 60042.184042.55504 6711
12 99942.262742.53032 7211
14 67142.300042.48077 4761
10102 959totaltotal119 47410
+ +
+ +
+
+
+ +
+
+
+ + +
+ +
+
+
+
+
+ 1J +
+
+ 5J +
+
+
+
+ 1M +
+
+ 3M +
+
+ 6M +
+
+
+
+ 1A +
+
+ 5A +
+
+ 10A +
+
+ 20A +
+
+
+
+
+
1 MINUTE
+
5 MINUTES
+
10 MINUTES
+
15 MINUTES
+
30 MINUTES
+
1 HEURE
+
2 HEURES
+
4 HEURES
+
JOUR
+
HEBDO
+
MENSUEL
+
+
+
+
+
+ Indicateurs les plus utilisés +
VOLUMES
+
MOYENNE MOBILE
+
RSI
+
MACD
+
+ + Indicateurs principaux +
ALLIGATOR
+
BANDES DE BOLLINGER
+
BANDES DE KELTNER
+
CANAL DE DONCHIAN
+
COURBE REGRESSION LINEAIRE
+
DOUBLE EMA
+
DROITE REGRESSION LINEAIRE
+
ENVELOPPE MOYENNE MOBILE
+
EVENEMENTS FINANCIERS
+
ICHIMOKU
+
MOYENNE MOBILE
+
MOYENNE MOBILE EXPO.
+
MOYENNE MOBILE PONDEREE
+
MOYENNE TRIANGULAIRE
+
NOUVEAUX PLUS HAUTS/BAS
+
PARABOLIQUE SAR
+
POINTS PIVOTS
+
SUPERTREND
+
SUPPORTS/RESISTANCES
+
TRIPLE EMA
+
ZIG ZAG
+
+
+ Indicateurs secondaires +
AWESOME OSCILLATOR
+
ACCUMULATION-DISTRIBUTION
+
ACCUMULATION SWING INDEX
+
ADX - ADXR
+
AROON
+
AVERAGE TRUE RANGE
+
BALANCE OF POWER
+
BOLLINGER %B
+
BOLLINGER BANDWITH
+
CCI
+
CHAIKIN MONEY FLOW
+
COURBE DE COPPOCK
+
DEMAND INDEX
+
DMI
+
EASE OF MOVEMENT
+
ELDER RAY - BULL POWER
+
ELDER RAY - BEAR POWER
+
FORCE INDEX
+
KNOW SURE THING
+
KLINGER VOLUME OSCILLATOR
+
MACD
+
MACD HISTOGRAMME
+
MACD ZERO LAG
+
MASS INDEX
+
MOMENTUM
+
MONEY FLOW INDEX
+
NEGATIVE VOLUME INDEX
+
ON BALANCE VOLUME
+
OSCILL. REGRESSION LINEAIRE
+
PERFORMANCE INDEX
+
PHASES DE LUNE
+
POSITIVE VOLUME INDEX
+
Q-STICK INDICATOR
+
RATE OF CHANGE (ROC)
+
RSI
+
STANDARD DEVIATION
+
STOCHASTIQUE
+
STOCHASTIQUE MOMENTUM
+
STOCHASTIQUE RSI
+
TRIX
+
TRUE STRENGTH INDEX
+
ULCER INDEX
+
ULTIMATE OSCILLATOR
+
VOLUMES
+
VOLUME ROC
+
VORTEX INDICATOR
+
WAVE TREND OSCILLATOR
+
WILLIAMS ACCUMULATION
+
WILLIAMS %R
+
+
+ Détections de figures +
DOJI
+
ENGLOBANTES
+
FIGURES EN PINCE
+
GAPS
+
HARAMIS
+
KEY REVERSAL
+
MARTEAUX
+
MARUBOZU
+
PENDUS
+
3 SOLDATS
+
+
+
+
+
+
+ AIRE +
+
+ BAR CHART COLORÉS +
+
+ BOUGIES +
+
+ HEIKIN ASHI +
+
+ HOLLOW CANDLES +
+
+ KAGI +
+
+ LIGNE +
+
+ LINE BREAK +
+
+ PERFORMANCE +
+
+ RENKO +
+
+
+
+
+ +
+
+
+ Comparer +
+
+
+
+
+ + + +
+ +
+
+
+
+ RETICULE +
+
+ POINTEUR +
+
+ GOMME +
+
+ ZOOMER +
+
+ DEZOOMER +
+
+
+ +
+
+
1 MINUTE
+
5 MINUTES
+
10 MINUTES
+
15 MINUTES
+
30 MINUTES
+
1 HEURE
+
2 HEURES
+
4 HEURES
+
JOUR
+
HEBDO
+
MENSUEL
+
+
+ +
+
+
+ Indicateurs les plus utilisés +
VOLUMES
+
MOYENNE MOBILE
+
RSI
+
MACD
+
+ + Indicateurs principaux +
ALLIGATOR
+
BANDES DE BOLLINGER
+
BANDES DE KELTNER
+
CANAL DE DONCHIAN
+
COURBE REGRESSION LINEAIRE
+
DOUBLE EMA
+
DROITE REGRESSION LINEAIRE
+
ENVELOPPE MOYENNE MOBILE
+
EVENEMENTS FINANCIERS
+
ICHIMOKU
+
MOYENNE MOBILE
+
MOYENNE MOBILE EXPO.
+
MOYENNE MOBILE PONDEREE
+
MOYENNE TRIANGULAIRE
+
NOUVEAUX PLUS HAUTS/BAS
+
PARABOLIQUE SAR
+
POINTS PIVOTS
+
SUPERTREND
+
SUPPORTS/RESISTANCES
+
TRIPLE EMA
+
ZIG ZAG
+
+
+ Indicateurs secondaires +
AWESOME OSCILLATOR
+
ACCUMULATION-DISTRIBUTION
+
ACCUMULATION SWING INDEX
+
ADX - ADXR
+
AROON
+
AVERAGE TRUE RANGE
+
BALANCE OF POWER
+
BOLLINGER %B
+
BOLLINGER BANDWITH
+
CCI
+
CHAIKIN MONEY FLOW
+
COURBE DE COPPOCK
+
DEMAND INDEX
+
DMI
+
EASE OF MOVEMENT
+
ELDER RAY - BULL POWER
+
ELDER RAY - BEAR POWER
+
FORCE INDEX
+
KNOW SURE THING
+
KLINGER VOLUME OSCILLATOR
+
MACD
+
MACD HISTOGRAMME
+
MACD ZERO LAG
+
MASS INDEX
+
MOMENTUM
+
MONEY FLOW INDEX
+
NEGATIVE VOLUME INDEX
+
ON BALANCE VOLUME
+
OSCILL. REGRESSION LINEAIRE
+
PERFORMANCE INDEX
+
PHASES DE LUNE
+
POSITIVE VOLUME INDEX
+
Q-STICK INDICATOR
+
RATE OF CHANGE (ROC)
+
RSI
+
STANDARD DEVIATION
+
STOCHASTIQUE
+
STOCHASTIQUE MOMENTUM
+
STOCHASTIQUE RSI
+
TRIX
+
TRUE STRENGTH INDEX
+
ULCER INDEX
+
ULTIMATE OSCILLATOR
+
VOLUMES
+
VOLUME ROC
+
VORTEX INDICATOR
+
WAVE TREND OSCILLATOR
+
WILLIAMS ACCUMULATION
+
WILLIAMS %R
+
+
+ Détections de figures +
DOJI
+
ENGLOBANTES
+
FIGURES EN PINCE
+
GAPS
+
HARAMIS
+
KEY REVERSAL
+
MARTEAUX
+
MARUBOZU
+
PENDUS
+
3 SOLDATS
+
+
+
+ +
+
+ +
+
+ +
+
+
+ AIRE +
+
+ BAR CHART COLORÉS +
+
+ BOUGIES +
+
+ HEIKIN ASHI +
+
+ HOLLOW CANDLES +
+
+ KAGI +
+
+ LIGNE +
+
+ LINE BREAK +
+
+ PERFORMANCE +
+
+ RENKO +
+
+
+ +
+
+
Actualités
+
Evénements
+
+
+ +
+ Comparer +
+ +
+
+
+ +
+
+ +
+ + +
+
+ +
+
+
+
+ +
 
+ + + +
+
+
+ +
+ + + +
+ +
+
+ + + +
+ +
+ +
+ +
+
+
+ Ouv. + 42.4622 +
+
+ +haut + 42.7106 +
+
+ +bas + 42.3579 +
+
+ Der. + 42.4379 +
+
+ Var. + +0.10% +
+
+ Vol. + 10 808 +
+
+
+
+
+
volume
AMUNDI MSCI EM ASIA UCITS ETF - USDVAR. : -3.30%5 JOURS - 2 MINUTES
COURS
+
+ + + + + + + +
+ + + + + + + +
+ + + + + + +
+ + + +
+
+ +

+
+
+ + + + + Historique 5 jours
+
+ +

+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
15-0916-0917-0920-0921-09
+ Der. + 43.690 + 43.419 + 43.351 + 42.395 + 42.438
+ Var. + -0.96% + -0.62% + -0.16% + -2.20% + 0.17%
+ Ouv. + 43.885 + 43.260 + 43.713 + 42.655 + 42.462
+ +Haut + 43.895 + 43.419 + 43.758 + 42.655 + 42.711
+ +Bas + 43.690 + 43.260 + 43.351 + 42.256 + 42.358
+ Vol. + 340 + 765 + 914 + 37 423 + 10 808
+ +
+
+

+ Variation sur 5 jours : + + -2.87% + +

+
+
+
+
+
+
+
+ +

+
+
+
+ +
+ + + + + Dernières transactions
+
+ +

+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

heures

cours

quantité

+ 17:35:00 + 42.4379 + 0
+ 17:24:09 + 42.4259 + 28
+ 17:24:09 + 42.4259 + 8
+ 17:20:45 + 42.4269 + 87
+ 17:19:30 + 42.4224 + 1 740
+ + +
+
+
+
+ +
+
+
+ +

+
+
+ + + + + Caractéristiques
+
+ +

+ +
+
+
  • + Date de création +

    + 22.03.2018 +

  • + Promoteur +

    + Amundi Luxembourg S.A. +

  • + Gérants +

    + ND +

  • + Catégorie morningstar +

    + Actions Asie hors Japon +

  • + Forme juridique +

    + SICAV +

  • + Classe d'actifs +

    + Actions Asie/Pacifique +

  • + Zone géographique +

    + Asie Marchés Emergents +

  • + Dividende +

    + ND +

  • + Frais d'entrée +

    + ND +

  • + Frais de sortie +

    + ND +

  • + Frais de gestion +

    + 0.1 % +

  • Voir le DICI

+
+
+
+ +

+
+
+ + + + + Liste des autres trackers de +cette catégorie : Actions Asie hors Japon +
+
+ +

+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Libellé

Morningstar

Dern. VL

Date VL

Perf.
1ER Janv.

Perf.
3 ans

+ Amundi IS MSCI Em Asia ETF-C USD + +
3
+ 30.14170 + + 10 oct. 2018 + + 2.05% + + 37.42% +
+ iShares MSCI EM Asia ETF USD Acc + +
3
+ 129.53070 + + 11 oct. 2018 + + 2.20% + + 37.09% +
+ SPDR® MSCI EM Asia ETF + +
3
+ 54.99262 + + 4 juin 2015 + + 0.45% + + 33.20% +
+ HSBC MSCI EM Far East ETF + +
3
+ 41.30660 + + 11 oct. 2018 + + -3.40% + + 30.76% +
+ +
+
+
+
+
+
+
+ +

+
+
+
+ +
+ + + + + éléments d'analyses
+
+ +

+ + + +
+
+
+
+
+

Notation morningstar (1) + du 31 août 2021 +

+
+
+

Risque du fonds

+

/7

+
+ +
+
+
+ +

+
+
+ + + + + Ratio de Sharpe
+
+ +

+ +
+
+

+ Ces informations sont exclusivement réservées aux clients Boursorama Banque. +

+
+
+
+
+
+
+
+
+
+
+ +

+
+
+
+ +
+ + + + + Performances
+
+ +

+ + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1er JANV.1 MOIS3 MOIS6 MOIS1 AN3 ANS5 ANS10 ANS
+ ETF + 3.41% + 3.08% + -2.3% + -2.53% + 18.62% + 32.79% + 62.18% + 138.27%
+ RANG + 60 + 26 + 50 + 51 + 54 + 51 + 42 + 50
+ CAT. MORNING* + 4.93% + 2.11% + -2.07% + -2.23% + 19.41% + 35.17% + 60.09% + 138.98%
+ +
+

*Données + calculées par Morningstar. Rangs calculés en percentile par Morningstar + sur la dernière valeur liquidative du mois précédent.

+
+
1
Mouchard
Outbrain
+ +
+
+
+
+ \ No newline at end of file diff --git a/bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/1162c4c08db38cbf9c16b473.js b/bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/1162c4c08db38cbf9c16b473.js new file mode 100644 index 0000000..82999cb --- /dev/null +++ b/bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/1162c4c08db38cbf9c16b473.js @@ -0,0 +1 @@ +(self.webpackChunkweb_fr_portal_20=self.webpackChunkweb_fr_portal_20||[]).push([[1162],{6077:function(t,r,n){var e=n(111);t.exports=function(t){if(!e(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},8533:function(t,r,n){"use strict";var e=n(2092).forEach,o=n(9341),i=n(9207),u=o("forEach"),a=i("forEach");t.exports=u&&a?[].forEach:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}},648:function(t,r,n){var e=n(1694),o=n(4326),i=n(5112)("toStringTag"),u="Arguments"==o(function(){return arguments}());t.exports=e?o:function(t){var r,n,e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,r){try{return t[r]}catch(t){}}(r=Object(t),i))?n:u?o(r):"Object"==(e=o(r))&&"function"==typeof r.callee?"Arguments":e}},8544:function(t,r,n){var e=n(7293);t.exports=!e((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},4994:function(t,r,n){"use strict";var e=n(3383).IteratorPrototype,o=n(30),i=n(9114),u=n(8003),a=n(7497),c=function(){return this};t.exports=function(t,r,n){var s=r+" Iterator";return t.prototype=o(e,{next:i(1,n)}),u(t,s,!1,!0),a[s]=c,t}},654:function(t,r,n){"use strict";var e=n(2109),o=n(4994),i=n(9518),u=n(7674),a=n(8003),c=n(8880),s=n(1320),f=n(5112),l=n(1913),p=n(7497),v=n(3383),g=v.IteratorPrototype,y=v.BUGGY_SAFARI_ITERATORS,h=f("iterator"),d="keys",S="values",b="entries",m=function(){return this};t.exports=function(t,r,n,f,v,x,O){o(n,r,f);var w,E,j,L=function(t){if(t===v&&I)return I;if(!y&&t in A)return A[t];switch(t){case d:case S:case b:return function(){return new n(this,t)}}return function(){return new n(this)}},T=r+" Iterator",_=!1,A=t.prototype,P=A[h]||A["@@iterator"]||v&&A[v],I=!y&&P||L(v),k="Array"==r&&A.entries||P;if(k&&(w=i(k.call(new t)),g!==Object.prototype&&w.next&&(l||i(w)===g||(u?u(w,g):"function"!=typeof w[h]&&c(w,h,m)),a(w,T,!0,!0),l&&(p[T]=m))),v==S&&P&&P.name!==S&&(_=!0,I=function(){return P.call(this)}),l&&!O||A[h]===I||c(A,h,I),p[r]=I,v)if(E={values:L(S),keys:x?I:L(d),entries:L(b)},O)for(j in E)(y||_||!(j in A))&&s(A,j,E[j]);else e({target:r,proto:!0,forced:y||_},E);return E}},7235:function(t,r,n){var e=n(857),o=n(6656),i=n(6061),u=n(3070).f;t.exports=function(t){var r=e.Symbol||(e.Symbol={});o(r,t)||u(r,t,{value:i.f(t)})}},8324:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},647:function(t,r,n){var e=n(7908),o=Math.floor,i="".replace,u=/\$([$&'`]|\d\d?|<[^>]*>)/g,a=/\$([$&'`]|\d\d?)/g;t.exports=function(t,r,n,c,s,f){var l=n+t.length,p=c.length,v=a;return void 0!==s&&(s=e(s),v=u),i.call(f,v,(function(e,i){var u;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return r.slice(0,n);case"'":return r.slice(l);case"<":u=s[i.slice(1,-1)];break;default:var a=+i;if(0===a)return e;if(a>p){var f=o(a/10);return 0===f?e:f<=p?void 0===c[f-1]?i.charAt(1):c[f-1]+i.charAt(1):e}u=c[a-1]}return void 0===u?"":u}))}},3383:function(t,r,n){"use strict";var e,o,i,u=n(7293),a=n(9518),c=n(8880),s=n(6656),f=n(5112),l=n(1913),p=f("iterator"),v=!1;[].keys&&("next"in(i=[].keys())?(o=a(a(i)))!==Object.prototype&&(e=o):v=!0);var g=null==e||u((function(){var t={};return e[p].call(t)!==t}));g&&(e={}),l&&!g||s(e,p)||c(e,p,(function(){return this})),t.exports={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:v}},7497:function(t){t.exports={}},3009:function(t,r,n){var e=n(7854),o=n(3111).trim,i=n(1361),u=e.parseInt,a=/^[+-]?0[Xx]/,c=8!==u(i+"08")||22!==u(i+"0x16");t.exports=c?function(t,r){var n=o(String(t));return u(n,r>>>0||(a.test(n)?16:10))}:u},1156:function(t,r,n){var e=n(5656),o=n(8006).f,i={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return u&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(t){return u.slice()}}(t):o(e(t))}},9518:function(t,r,n){var e=n(6656),o=n(7908),i=n(6200),u=n(8544),a=i("IE_PROTO"),c=Object.prototype;t.exports=u?Object.getPrototypeOf:function(t){return t=o(t),e(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?c:null}},7674:function(t,r,n){var e=n(9670),o=n(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),r=n instanceof Array}catch(t){}return function(n,i){return e(n),o(i),r?t.call(n,i):n.__proto__=i,n}}():void 0)},288:function(t,r,n){"use strict";var e=n(1694),o=n(648);t.exports=e?{}.toString:function(){return"[object "+o(this)+"]"}},8003:function(t,r,n){var e=n(3070).f,o=n(6656),i=n(5112)("toStringTag");t.exports=function(t,r,n){t&&!o(t=n?t:t.prototype,i)&&e(t,i,{configurable:!0,value:r})}},1694:function(t,r,n){var e={};e[n(5112)("toStringTag")]="z",t.exports="[object z]"===String(e)},6061:function(t,r,n){var e=n(5112);r.f=e},9554:function(t,r,n){"use strict";var e=n(2109),o=n(8533);e({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})},6992:function(t,r,n){"use strict";var e=n(5656),o=n(1223),i=n(7497),u=n(9909),a=n(654),c="Array Iterator",s=u.set,f=u.getterFor(c);t.exports=a(Array,"Array",(function(t,r){s(this,{type:c,target:e(t),index:0,kind:r})}),(function(){var t=f(this),r=t.target,n=t.kind,e=t.index++;return!r||e>=r.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:e,done:!1}:"values"==n?{value:r[e],done:!1}:{value:[e,r[e]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},9600:function(t,r,n){"use strict";var e=n(2109),o=n(8361),i=n(5656),u=n(9341),a=[].join,c=o!=Object,s=u("join",",");e({target:"Array",proto:!0,forced:c||!s},{join:function(t){return a.call(i(this),void 0===t?",":t)}})},1539:function(t,r,n){var e=n(1694),o=n(1320),i=n(288);e||o(Object.prototype,"toString",i,{unsafe:!0})},1058:function(t,r,n){var e=n(2109),o=n(3009);e({global:!0,forced:parseInt!=o},{parseInt:o})},9714:function(t,r,n){"use strict";var e=n(1320),o=n(9670),i=n(7293),u=n(7066),a="toString",c=RegExp.prototype,s=c.toString,f=i((function(){return"/a/b"!=s.call({source:"a",flags:"b"})})),l=s.name!=a;(f||l)&&e(RegExp.prototype,a,(function(){var t=o(this),r=String(t.source),n=t.flags;return"/"+r+"/"+String(void 0===n&&t instanceof RegExp&&!("flags"in c)?u.call(t):n)}),{unsafe:!0})},8783:function(t,r,n){"use strict";var e=n(8710).charAt,o=n(9909),i=n(654),u="String Iterator",a=o.set,c=o.getterFor(u);i(String,"String",(function(t){a(this,{type:u,string:String(t),index:0})}),(function(){var t,r=c(this),n=r.string,o=r.index;return o>=n.length?{value:void 0,done:!0}:(t=e(n,o),r.index+=t.length,{value:t,done:!1})}))},4723:function(t,r,n){"use strict";var e=n(7007),o=n(9670),i=n(7466),u=n(4488),a=n(1530),c=n(7651);e("match",1,(function(t,r,n){return[function(r){var n=u(this),e=null==r?void 0:r[t];return void 0!==e?e.call(r,n):new RegExp(r)[t](String(n))},function(t){var e=n(r,t,this);if(e.done)return e.value;var u=o(t),s=String(this);if(!u.global)return c(u,s);var f=u.unicode;u.lastIndex=0;for(var l,p=[],v=0;null!==(l=c(u,s));){var g=String(l[0]);p[v]=g,""===g&&(u.lastIndex=a(s,i(u.lastIndex),f)),v++}return 0===v?null:p}]}))},5306:function(t,r,n){"use strict";var e=n(7007),o=n(9670),i=n(7466),u=n(9958),a=n(4488),c=n(1530),s=n(647),f=n(7651),l=Math.max,p=Math.min;e("replace",2,(function(t,r,n,e){var v=e.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,g=e.REPLACE_KEEPS_$0,y=v?"$":"$0";return[function(n,e){var o=a(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,o,e):r.call(String(o),n,e)},function(t,e){if(!v&&g||"string"==typeof e&&-1===e.indexOf(y)){var a=n(r,t,this,e);if(a.done)return a.value}var h=o(t),d=String(this),S="function"==typeof e;S||(e=String(e));var b=h.global;if(b){var m=h.unicode;h.lastIndex=0}for(var x=[];;){var O=f(h,d);if(null===O)break;if(x.push(O),!b)break;""===String(O[0])&&(h.lastIndex=c(d,i(h.lastIndex),m))}for(var w,E="",j=0,L=0;L=j&&(E+=d.slice(j,_)+R,j=_+T.length)}return E+d.slice(j)}]}))},1817:function(t,r,n){"use strict";var e=n(2109),o=n(9781),i=n(7854),u=n(6656),a=n(111),c=n(3070).f,s=n(9920),f=i.Symbol;if(o&&"function"==typeof f&&(!("description"in f.prototype)||void 0!==f().description)){var l={},p=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),r=this instanceof p?new f(t):void 0===t?f():f(t);return""===t&&(l[r]=!0),r};s(p,f);var v=p.prototype=f.prototype;v.constructor=p;var g=v.toString,y="Symbol(test)"==String(f("test")),h=/^Symbol\((.*)\)[^)]+$/;c(v,"description",{configurable:!0,get:function(){var t=a(this)?this.valueOf():this,r=g.call(t);if(u(l,t))return"";var n=y?r.slice(7,-1):r.replace(h,"$1");return""===n?void 0:n}}),e({global:!0,forced:!0},{Symbol:p})}},2165:function(t,r,n){n(7235)("iterator")},2526:function(t,r,n){"use strict";var e=n(2109),o=n(7854),i=n(5005),u=n(1913),a=n(9781),c=n(133),s=n(3307),f=n(7293),l=n(6656),p=n(3157),v=n(111),g=n(9670),y=n(7908),h=n(5656),d=n(7593),S=n(9114),b=n(30),m=n(1956),x=n(8006),O=n(1156),w=n(5181),E=n(1236),j=n(3070),L=n(5296),T=n(8880),_=n(1320),A=n(2309),P=n(6200),I=n(3501),k=n(9711),R=n(5112),C=n(6061),M=n(7235),N=n(8003),G=n(9909),$=n(2092).forEach,D=P("hidden"),F="Symbol",U=R("toPrimitive"),V=G.set,B=G.getterFor(F),H=Object.prototype,z=o.Symbol,J=i("JSON","stringify"),X=E.f,Y=j.f,q=O.f,K=L.f,Q=A("symbols"),W=A("op-symbols"),Z=A("string-to-symbol-registry"),tt=A("symbol-to-string-registry"),rt=A("wks"),nt=o.QObject,et=!nt||!nt.prototype||!nt.prototype.findChild,ot=a&&f((function(){return 7!=b(Y({},"a",{get:function(){return Y(this,"a",{value:7}).a}})).a}))?function(t,r,n){var e=X(H,r);e&&delete H[r],Y(t,r,n),e&&t!==H&&Y(H,r,e)}:Y,it=function(t,r){var n=Q[t]=b(z.prototype);return V(n,{type:F,tag:t,description:r}),a||(n.description=r),n},ut=s?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof z},at=function(t,r,n){t===H&&at(W,r,n),g(t);var e=d(r,!0);return g(n),l(Q,e)?(n.enumerable?(l(t,D)&&t[D][e]&&(t[D][e]=!1),n=b(n,{enumerable:S(0,!1)})):(l(t,D)||Y(t,D,S(1,{})),t[D][e]=!0),ot(t,e,n)):Y(t,e,n)},ct=function(t,r){g(t);var n=h(r),e=m(n).concat(pt(n));return $(e,(function(r){a&&!st.call(n,r)||at(t,r,n[r])})),t},st=function(t){var r=d(t,!0),n=K.call(this,r);return!(this===H&&l(Q,r)&&!l(W,r))&&(!(n||!l(this,r)||!l(Q,r)||l(this,D)&&this[D][r])||n)},ft=function(t,r){var n=h(t),e=d(r,!0);if(n!==H||!l(Q,e)||l(W,e)){var o=X(n,e);return!o||!l(Q,e)||l(n,D)&&n[D][e]||(o.enumerable=!0),o}},lt=function(t){var r=q(h(t)),n=[];return $(r,(function(t){l(Q,t)||l(I,t)||n.push(t)})),n},pt=function(t){var r=t===H,n=q(r?W:h(t)),e=[];return $(n,(function(t){!l(Q,t)||r&&!l(H,t)||e.push(Q[t])})),e};c||(_((z=function(){if(this instanceof z)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,r=k(t),n=function(t){this===H&&n.call(W,t),l(this,D)&&l(this[D],r)&&(this[D][r]=!1),ot(this,r,S(1,t))};return a&&et&&ot(H,r,{configurable:!0,set:n}),it(r,t)}).prototype,"toString",(function(){return B(this).tag})),_(z,"withoutSetter",(function(t){return it(k(t),t)})),L.f=st,j.f=at,E.f=ft,x.f=O.f=lt,w.f=pt,C.f=function(t){return it(R(t),t)},a&&(Y(z.prototype,"description",{configurable:!0,get:function(){return B(this).description}}),u||_(H,"propertyIsEnumerable",st,{unsafe:!0}))),e({global:!0,wrap:!0,forced:!c,sham:!c},{Symbol:z}),$(m(rt),(function(t){M(t)})),e({target:F,stat:!0,forced:!c},{for:function(t){var r=String(t);if(l(Z,r))return Z[r];var n=z(r);return Z[r]=n,tt[n]=r,n},keyFor:function(t){if(!ut(t))throw TypeError(t+" is not a symbol");if(l(tt,t))return tt[t]},useSetter:function(){et=!0},useSimple:function(){et=!1}}),e({target:"Object",stat:!0,forced:!c,sham:!a},{create:function(t,r){return void 0===r?b(t):ct(b(t),r)},defineProperty:at,defineProperties:ct,getOwnPropertyDescriptor:ft}),e({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:lt,getOwnPropertySymbols:pt}),e({target:"Object",stat:!0,forced:f((function(){w.f(1)}))},{getOwnPropertySymbols:function(t){return w.f(y(t))}}),J&&e({target:"JSON",stat:!0,forced:!c||f((function(){var t=z();return"[null]"!=J([t])||"{}"!=J({a:t})||"{}"!=J(Object(t))}))},{stringify:function(t,r,n){for(var e,o=[t],i=1;arguments.length>i;)o.push(arguments[i++]);if(e=r,(v(r)||void 0!==t)&&!ut(t))return p(r)||(r=function(t,r){if("function"==typeof e&&(r=e.call(this,t,r)),!ut(r))return r}),o[1]=r,J.apply(null,o)}}),z.prototype[U]||T(z.prototype,U,z.prototype.valueOf),N(z,F),I[D]=!0},3948:function(t,r,n){var e=n(7854),o=n(8324),i=n(6992),u=n(8880),a=n(5112),c=a("iterator"),s=a("toStringTag"),f=i.values;for(var l in o){var p=e[l],v=p&&p.prototype;if(v){if(v[c]!==f)try{u(v,c,f)}catch(t){v[c]=f}if(v[s]||u(v,s,l),o[l])for(var g in i)if(v[g]!==i[g])try{u(v,g,i[g])}catch(t){v[g]=i[g]}}}}}]); \ No newline at end of file diff --git a/bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/122017e829d38aae427b02d2.js b/bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/122017e829d38aae427b02d2.js new file mode 100644 index 0000000..a7f9fbc --- /dev/null +++ b/bourse/TEST_DATA/DATA_FEED/AMUNDI MSCI EM ASIA UCITS ETF - USD - USD, Cours Tracker AASU, Cotation Bourse Euronext Paris - Boursorama_fichiers/122017e829d38aae427b02d2.js @@ -0,0 +1 @@ +(self.webpackChunkweb_fr_portal_20=self.webpackChunkweb_fr_portal_20||[]).push([[1220],{3099:function(t){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},1223:function(t,n,e){var r=e(5112),o=e(30),c=e(3070),i=r("unscopables"),u=Array.prototype;null==u[i]&&c.f(u,i,{configurable:!0,value:o(null)}),t.exports=function(t){u[i][t]=!0}},1530:function(t,n,e){"use strict";var r=e(8710).charAt;t.exports=function(t,n,e){return n+(e?r(t,n).length:1)}},2092:function(t,n,e){var r=e(9974),o=e(8361),c=e(7908),i=e(7466),u=e(5417),a=[].push,l=function(t){var n=1==t,e=2==t,l=3==t,f=4==t,s=6==t,p=7==t,v=5==t||s;return function(x,d,g,h){for(var y,E,R=c(x),O=o(R),b=r(d,g,3),A=i(O.length),S=0,m=h||u,w=n?m(x,A):e||p?m(x,0):void 0;A>S;S++)if((v||S in O)&&(E=b(y=O[S],S,R),t))if(n)w[S]=E;else if(E)switch(t){case 3:return!0;case 5:return y;case 6:return S;case 2:a.call(w,y)}else switch(t){case 4:return!1;case 7:a.call(w,y)}return s?-1:l||f?f:w}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterOut:l(7)}},9341:function(t,n,e){"use strict";var r=e(7293);t.exports=function(t,n){var e=[][t];return!!e&&r((function(){e.call(null,n||function(){throw 1},1)}))}},9207:function(t,n,e){var r=e(9781),o=e(7293),c=e(6656),i=Object.defineProperty,u={},a=function(t){throw t};t.exports=function(t,n){if(c(u,t))return u[t];n||(n={});var e=[][t],l=!!c(n,"ACCESSORS")&&n.ACCESSORS,f=c(n,0)?n[0]:a,s=c(n,1)?n[1]:void 0;return u[t]=!!e&&!o((function(){if(l&&!r)return!0;var t={length:-1};l?i(t,1,{enumerable:!0,get:a}):t[1]=1,e.call(t,f,s)}))}},5417:function(t,n,e){var r=e(111),o=e(3157),c=e(5112)("species");t.exports=function(t,n){var e;return o(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!o(e.prototype)?r(e)&&null===(e=e[c])&&(e=void 0):e=void 0),new(void 0===e?Array:e)(0===n?0:n)}},7007:function(t,n,e){"use strict";e(4916);var r=e(1320),o=e(7293),c=e(5112),i=e(2261),u=e(8880),a=c("species"),l=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")})),f="$0"==="a".replace(/./,"$0"),s=c("replace"),p=!!/./[s]&&""===/./[s]("a","$0"),v=!o((function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var e="ab".split(t);return 2!==e.length||"a"!==e[0]||"b"!==e[1]}));t.exports=function(t,n,e,s){var x=c(t),d=!o((function(){var n={};return n[x]=function(){return 7},7!=""[t](n)})),g=d&&!o((function(){var n=!1,e=/a/;return"split"===t&&((e={}).constructor={},e.constructor[a]=function(){return e},e.flags="",e[x]=/./[x]),e.exec=function(){return n=!0,null},e[x](""),!n}));if(!d||!g||"replace"===t&&(!l||!f||p)||"split"===t&&!v){var h=/./[x],y=e(x,""[t],(function(t,n,e,r,o){return n.exec===i?d&&!o?{done:!0,value:h.call(n,e,r)}:{done:!0,value:t.call(e,n,r)}:{done:!1}}),{REPLACE_KEEPS_$0:f,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:p}),E=y[0],R=y[1];r(String.prototype,t,E),r(RegExp.prototype,x,2==n?function(t,n){return R.call(t,this,n)}:function(t){return R.call(t,this)})}s&&u(RegExp.prototype[x],"sham",!0)}},9974:function(t,n,e){var r=e(3099);t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 0:return function(){return t.call(n)};case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},490:function(t,n,e){var r=e(5005);t.exports=r("document","documentElement")},3157:function(t,n,e){var r=e(4326);t.exports=Array.isArray||function(t){return"Array"==r(t)}},30:function(t,n,e){var r,o=e(9670),c=e(6048),i=e(748),u=e(3501),a=e(490),l=e(317),f=e(6200)("IE_PROTO"),s=function(){},p=function(t){return"