Browse Source
Feature/improve symbol conversion in eod historical data service (#2457)
* Improve conversion of currency symbols
* Update changelog
pull/2459/head
Thomas Kaul
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
6 additions and
5 deletions
-
CHANGELOG.md
-
apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts
|
|
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
- Improved the display of the results in the search for a holding |
|
|
|
- Changed the queue jobs view in the admin control panel to an `@angular/material` data table |
|
|
|
- Improved the symbol conversion in the _EOD Historical Data_ service |
|
|
|
|
|
|
|
## 2.9.0 - 2023-10-08 |
|
|
|
|
|
|
|
|
|
@ -283,7 +283,6 @@ export class EodHistoricalDataService implements DataProviderInterface { |
|
|
|
if (symbol.endsWith('.FOREX')) { |
|
|
|
symbol = symbol.replace('GBX', 'GBp'); |
|
|
|
symbol = symbol.replace('.FOREX', ''); |
|
|
|
symbol = `${DEFAULT_CURRENCY}${symbol}`; |
|
|
|
} |
|
|
|
|
|
|
|
return symbol; |
|
|
@ -292,7 +291,7 @@ export class EodHistoricalDataService implements DataProviderInterface { |
|
|
|
/** |
|
|
|
* Converts a symbol to a EOD symbol |
|
|
|
* |
|
|
|
* Currency: USDCHF -> CHF.FOREX |
|
|
|
* Currency: USDCHF -> USDCHF.FOREX |
|
|
|
*/ |
|
|
|
private convertToEodSymbol(aSymbol: string) { |
|
|
|
if ( |
|
|
@ -304,9 +303,10 @@ export class EodHistoricalDataService implements DataProviderInterface { |
|
|
|
aSymbol.substring(0, aSymbol.length - DEFAULT_CURRENCY.length) |
|
|
|
) |
|
|
|
) { |
|
|
|
return `${aSymbol |
|
|
|
.replace('GBp', 'GBX') |
|
|
|
.replace(DEFAULT_CURRENCY, '')}.FOREX`;
|
|
|
|
let symbol = aSymbol; |
|
|
|
symbol = symbol.replace('GBp', 'GBX'); |
|
|
|
|
|
|
|
return `${symbol}.FOREX`; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|