Skip to content

Commit

Permalink
Converters take Yahoo Finance currency over export currency (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
dickwolff authored Aug 16, 2024
1 parent 751eb97 commit 8619886
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
next-version: 0.17.0
next-version: 0.17.1
assembly-informational-format: "{NuGetVersion}"
mode: ContinuousDeployment
branches:
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "export-to-ghostfolio",
"version": "0.17.0",
"version": "0.17.1",
"type": "module",
"description": "Convert multiple broker exports to Ghostfolio import",
"scripts": {
Expand All @@ -16,12 +16,12 @@
"devDependencies": {
"@types/cacache": "^17.0.2",
"@types/jest": "^29.5.11",
"@types/node": "^20.14.10",
"@types/node": "^22.3.0",
"jest": "^29.7.0",
"ts-jest": "^29.2.2",
"ts-node": "^10.9.2",
"tsx": "^4.16.2",
"typescript": "^5.5.3"
"tsx": "^4.17.0",
"typescript": "^5.5.4"
},
"dependencies": {
"@types/cli-progress": "^3.11.6",
Expand All @@ -30,7 +30,7 @@
"cli-progress": "^3.12.0",
"closest-match": "^1.3.3",
"csv-parse": "^5.5.6",
"dayjs": "^1.11.11",
"dayjs": "^1.11.12",
"dotenv": "^16.4.5",
"yahoo-finance2": "^2.11.3"
}
Expand Down
2 changes: 1 addition & 1 deletion src/converters/buxConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export class BuxConverter extends AbstractConverter {
quantity: quantity,
type: GhostfolioOrderType[record.transactionType],
unitPrice: unitPrice,
currency: record.transactionCurrency,
currency: security.currency ?? record.transactionCurrency,
dataSource: "YAHOO",
date: dayjs(record.transactionTimeCet).format("YYYY-MM-DDTHH:mm:ssZ"),
symbol: security.symbol
Expand Down
2 changes: 1 addition & 1 deletion src/converters/etoroConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export class EtoroConverter extends AbstractConverter {
quantity: record.units,
type: GhostfolioOrderType[record.type],
unitPrice: unitPrice,
currency: currency,
currency: security.currency ?? currency,
dataSource: "YAHOO",
date: date.format("YYYY-MM-DDTHH:mm:ssZ"),
symbol: security.symbol
Expand Down
2 changes: 1 addition & 1 deletion src/converters/finpensionConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class FinpensionConverter extends AbstractConverter {
quantity: numberOfShares,
type: GhostfolioOrderType[record.category],
unitPrice: assetPriceInChf,
currency: record.assetCurrency,
currency: security.currency ?? record.assetCurrency,
dataSource: "YAHOO",
date: dayjs(record.date).format("YYYY-MM-DDTHH:mm:ssZ"),
symbol: security.symbol
Expand Down
2 changes: 1 addition & 1 deletion src/converters/ibkrConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class IbkrConverter extends AbstractConverter {
quantity: quantity,
type: type,
unitPrice: price,
currency: currency,
currency: security.currency ?? currency,
dataSource: "YAHOO",
date: date.format("YYYY-MM-DDTHH:mm:ssZ"),
symbol: security.symbol
Expand Down
2 changes: 1 addition & 1 deletion src/converters/rabobankConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class RabobankConverter extends AbstractConverter {
quantity: quantity,
type: GhostfolioOrderType[record.type],
unitPrice: price,
currency: record.currency,
currency: security.currency ?? record.currency,
dataSource: "YAHOO",
date: date.format("YYYY-MM-DDTHH:mm:ssZ"),
symbol: security.symbol
Expand Down
2 changes: 1 addition & 1 deletion src/converters/swissquoteConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class SwissquoteConverter extends AbstractConverter {
quantity: record.quantity,
type: GhostfolioOrderType[record.transaction],
unitPrice: record.unitPrice,
currency: record.netAmountCurrency ?? record.currency,
currency: security.currency ?? record.netAmountCurrency ?? record.currency,
dataSource: "YAHOO",
date: date.format("YYYY-MM-DDTHH:mm:ssZ"),
symbol: security.symbol
Expand Down
2 changes: 1 addition & 1 deletion src/converters/trading212Converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export class Trading212Converter extends AbstractConverter {
quantity: record.noOfShares,
type: GhostfolioOrderType[record.action],
unitPrice: record.priceShare,
currency: record.currencyPriceShare,
currency: security.currency ?? record.currencyPriceShare,
dataSource: "YAHOO",
date: dayjs(record.time).format("YYYY-MM-DDTHH:mm:ssZ"),
symbol: security.symbol
Expand Down
2 changes: 1 addition & 1 deletion src/converters/xtbConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class XtbConverter extends AbstractConverter {
quantity: quantity,
type: GhostfolioOrderType[record.type],
unitPrice: unitPrice,
currency: security.currency,
currency: security.currency ?? security.currency,
dataSource: "YAHOO",
date: date.format("YYYY-MM-DDTHH:mm:ssZ"),
symbol: security.symbol,
Expand Down

0 comments on commit 8619886

Please sign in to comment.