|
|
@ -49,7 +49,6 @@ export class YahooFinanceService implements DataProviderInterface {
|
|
|
|
* Currency: USDCHF -> USDCHF=X
|
|
|
|
* Currency: USDCHF -> USDCHF=X
|
|
|
|
* Cryptocurrency: BTCUSD -> BTC-USD
|
|
|
|
* Cryptocurrency: BTCUSD -> BTC-USD
|
|
|
|
* DOGEUSD -> DOGE-USD
|
|
|
|
* DOGEUSD -> DOGE-USD
|
|
|
|
* SOL1USD -> SOL1-USD
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public convertToYahooFinanceSymbol(aSymbol: string) {
|
|
|
|
public convertToYahooFinanceSymbol(aSymbol: string) {
|
|
|
|
if (aSymbol.includes(baseCurrency) && aSymbol.length >= 6) {
|
|
|
|
if (aSymbol.includes(baseCurrency) && aSymbol.length >= 6) {
|
|
|
@ -57,9 +56,7 @@ export class YahooFinanceService implements DataProviderInterface {
|
|
|
|
return `${aSymbol}=X`;
|
|
|
|
return `${aSymbol}=X`;
|
|
|
|
} else if (
|
|
|
|
} else if (
|
|
|
|
this.cryptocurrencyService.isCryptocurrency(
|
|
|
|
this.cryptocurrencyService.isCryptocurrency(
|
|
|
|
aSymbol
|
|
|
|
aSymbol.replace(new RegExp(`-${baseCurrency}$`), baseCurrency)
|
|
|
|
.replace(new RegExp(`-${baseCurrency}$`), baseCurrency)
|
|
|
|
|
|
|
|
.replace('1', '')
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
// Add a dash before the last three characters
|
|
|
|
// Add a dash before the last three characters
|
|
|
@ -246,9 +243,7 @@ export class YahooFinanceService implements DataProviderInterface {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
(quoteType === 'CRYPTOCURRENCY' &&
|
|
|
|
(quoteType === 'CRYPTOCURRENCY' &&
|
|
|
|
this.cryptocurrencyService.isCryptocurrency(
|
|
|
|
this.cryptocurrencyService.isCryptocurrency(
|
|
|
|
symbol
|
|
|
|
symbol.replace(new RegExp(`-${baseCurrency}$`), baseCurrency)
|
|
|
|
.replace(new RegExp(`-${baseCurrency}$`), baseCurrency)
|
|
|
|
|
|
|
|
.replace('1', '')
|
|
|
|
|
|
|
|
)) ||
|
|
|
|
)) ||
|
|
|
|
quoteType === 'EQUITY' ||
|
|
|
|
quoteType === 'EQUITY' ||
|
|
|
|
quoteType === 'ETF'
|
|
|
|
quoteType === 'ETF'
|
|
|
|