73 Commits

Author SHA1 Message Date
Thomas
3589e72aea
Harmonize prisma service (#266) 2021-08-07 22:38:07 +02:00
Valentin Zickner
dfcf826b4f
implement support for buy-sell(-buy) scenario (#262)
Co-authored-by: Valentin Zickner <github@zickner.ch>
2021-08-07 07:07:12 +02:00
Thomas
7f047362cc
Bugfix/fix division by zero in calculate overall gross performance (#253)
* Fix error with division by zero

* Update changelog
2021-08-05 07:49:25 +02:00
Thomas
4bd41ffa41
Feature/eliminate name from timeline position (#245)
* Eliminate name from timeline position: Get the name from the symbolProfileService instead

* Update changelog
2021-08-01 20:43:12 +02:00
Thomas
823501f43e
Sort imports (#242) 2021-08-01 09:41:44 +02:00
Valentin Zickner
4bbd17a37a fix tests 2021-08-01 00:55:10 +02:00
Thomas
6a7def6c48 Clean up 2021-08-01 00:55:10 +02:00
Thomas
ea219f0b88 Add guard 2021-08-01 00:55:10 +02:00
Valentin Zickner
23b2e03923 refactor rule evaluation 2021-08-01 00:55:10 +02:00
Thomas
c47578bd3e Clean up 2021-08-01 00:55:10 +02:00
Thomas
9e4a49d811 Remove fallback 2021-08-01 00:55:10 +02:00
Thomas
a3a98c68a5 Fix missing currency conversion 2021-08-01 00:55:10 +02:00
Valentin Zickner
de83dc7b84 create investment endpoint for analysis timeline
Co-authored-by: Thomas <dotsilver@gmail.com>
2021-08-01 00:55:10 +02:00
Valentin Zickner
d23addb673 change getDetails to portfolio-calculator.ts
Co-authored-by: Thomas <dotsilver@gmail.com>
2021-08-01 00:55:10 +02:00
Thomas
fb15cebb64 Add test (#237)
* Add test

* fix calculation for overall gross performance percentage

Co-authored-by: Valentin Zickner <github@zickner.ch>
2021-08-01 00:55:10 +02:00
Valentin Zickner
9c51a257ae fix performance of combination of investments 2021-08-01 00:55:10 +02:00
Thomas
9821b7f8f0 Add TWR test scenario 1 (#236)
* Add TWR test scenario 1

* fix second transaction item

* change time-weighted rate algorithm

Co-authored-by: Valentin Zickner <valentin.zickner@flowable.com>
2021-08-01 00:55:10 +02:00
Valentin Zickner
ed731afc66 fix market price fetch in case symbols are missing 2021-08-01 00:55:10 +02:00
Thomas
bd0e53525b Refactoring 2021-08-01 00:55:10 +02:00
Thomas
cbdb68e2f8 Refactoring 2021-08-01 00:55:10 +02:00
Thomas
8571709014 Refactoring 2021-08-01 00:55:10 +02:00
Thomas
e7ef1d426e Refactoring 2021-08-01 00:55:10 +02:00
Thomas
39cba0a8eb Refactoring 2021-08-01 00:55:10 +02:00
Thomas
a90c314e30 Refactoring 2021-08-01 00:55:10 +02:00
Thomas
47d71405e1 Refactoring 2021-08-01 00:55:10 +02:00
Thomas
5e9cecc6c1 Refactoring 2021-08-01 00:55:10 +02:00
Thomas
fb9e66318f Improve test 2021-08-01 00:55:10 +02:00
Thomas
b8194eb64f Clean up code 2021-08-01 00:55:10 +02:00
Thomas
cbb81916ee Sort imports 2021-08-01 00:55:10 +02:00
Valentin Zickner
409afac2a9 fix rate conversion for todays symbols 2021-08-01 00:55:10 +02:00
Valentin Zickner
b031b028f1 add today to getValues 2021-08-01 00:55:10 +02:00
Valentin Zickner
3b7e0a0106 remove unnecessary if condition 2021-08-01 00:55:10 +02:00
Valentin Zickner
ea66081073 move interfaces to separate files 2021-08-01 00:55:10 +02:00
Valentin Zickner
602a770a09 fix typo 2021-08-01 00:55:10 +02:00
Thomas
e522722aa6 Update comment 2021-08-01 00:55:10 +02:00
Valentin Zickner
03ca5d7663 add further tests for portfolio-calculator with one transaction 2021-08-01 00:55:10 +02:00
Valentin Zickner
136563c949 fix single buy test 2021-08-01 00:55:10 +02:00
Thomas
948c45c602 Update test 2021-08-01 00:55:10 +02:00
Thomas
e0be792e46 Re-enable all tests 2021-08-01 00:55:10 +02:00
Thomas
c3d010135f Add test for single buy 2021-08-01 00:55:10 +02:00
Valentin Zickner
34c13c80ec add error handling for current positions 2021-08-01 00:55:10 +02:00
Valentin Zickner
f65a108436 change hardcoded timestamp in test to timezone specific 2021-08-01 00:55:10 +02:00
Valentin Zickner
993f066e08 remove console.time statements during portfolio calls 2021-08-01 00:55:10 +02:00
Valentin Zickner
852902d1ab add current position calculation with holding period return calculation 2021-08-01 00:55:10 +02:00
Thomas
ee89822bfe Fix tests 2021-08-01 00:55:10 +02:00
Thomas
e0435e5cad Add name to position 2021-08-01 00:55:10 +02:00
Thomas
e2c23703dc Fix tests 2021-08-01 00:55:10 +02:00
Thomas
1226c26a9d Refactor positions 2021-08-01 00:55:10 +02:00
Valentin Zickner
fdc89f7182 optimize performance of positions endpoint 2021-08-01 00:55:10 +02:00
Valentin Zickner
04e03bd080 add multi-date fetch for current values 2021-08-01 00:55:10 +02:00