Target weights and portfolio values does not match at all when using SetHoldings. What can be the reason for that? (Please, note that I am using FX market and check those hourly so the change in asset prices can't be the reason for such a large deviation)


values = []
for asset in trade_assets:
values.append(self.Portfolio[asset].Quantity * self.Portfolio[asset].Price)
pvalues = np.array(values)
pvalues /= np.sum(np.abs(pvalues))


for i, asset in enumerate(trade_assets):
self.SetHoldings(asset, target_weights[i])