Commit a22194e2 authored by François Schmidts's avatar François Schmidts Committed by Vincent A

[hsbc] correcting diff ratio for investments

parent 334f0096
......@@ -385,10 +385,15 @@ class RetrieveInvestmentsPage(LoggedPage, JsonPage):
obj_valuation = CleanDecimal(Dict(
'holdingDetailInformation/0/holdingDetailMultipleCurrencyInformation/0/productHoldingMarketValueAmount'
), default=NotAvailable)
obj_diff_ratio = CleanDecimal(Dict(
'holdingDetailInformation/0/holdingDetailMultipleCurrencyInformation/0'
'/profitLossUnrealizedPercent'
), default=NotAvailable)
def obj_diff_ratio(self):
ratio = CleanDecimal(Dict(
'holdingDetailInformation/0/holdingDetailMultipleCurrencyInformation/0/profitLossUnrealizedPercent'
), default=NotAvailable)(self)
if ratio is not NotAvailable:
ratio /= 100
return ratio
obj_portfolio_share = NotAvailable # must be computed from the sum of iter_investments
def obj_original_currency(self):
......@@ -443,9 +448,15 @@ class RetrieveInvestmentsPage(LoggedPage, JsonPage):
obj_unitprice = CleanDecimal(Dict(
'holdingSummaryMultipleCurrencyInformation/0/productHoldingUnitCostAverageAmount'
), default=NotAvailable)
obj_diff_ratio = CleanDecimal(Dict(
'holdingSummaryMultipleCurrencyInformation/0/profitLossUnrealizedPercent'
), default=NotAvailable)
def obj_diff_ratio(self):
ratio = CleanDecimal(Dict(
'holdingSummaryMultipleCurrencyInformation/0/profitLossUnrealizedPercent'
), default=NotAvailable)(self)
if ratio is not NotAvailable:
ratio /= 100
return ratio
obj_diff = CleanDecimal(Dict(
'holdingSummaryMultipleCurrencyInformation/0/profitLossUnrealizedAmount'
), default=NotAvailable)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment