wbportfolio 1.54.1__py2.py3-none-any.whl → 1.54.2__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of wbportfolio might be problematic. Click here for more details.

@@ -16,7 +16,7 @@ from django.db.models import (
16
16
  Sum,
17
17
  When,
18
18
  )
19
- from django.db.models.functions import Coalesce
19
+ from django.db.models.functions import Coalesce, Round
20
20
  from django.db.models.signals import post_save
21
21
  from django.dispatch import receiver
22
22
  from django.utils.functional import cached_property
@@ -66,8 +66,8 @@ class TradeQueryset(OrderedModelQuerySet):
66
66
  ),
67
67
  Decimal(0),
68
68
  ),
69
- effective_weight=F("_previous_weight") * F("drift_factor"),
70
- target_weight=F("effective_weight") + F("weighting"),
69
+ effective_weight=Round(F("_previous_weight") * F("drift_factor"), precision=8),
70
+ target_weight=Round(F("effective_weight") + F("weighting"), precision=8),
71
71
  effective_shares=Coalesce(
72
72
  Subquery(
73
73
  AssetPosition.objects.filter(
@@ -485,7 +485,7 @@ class Trade(TransactionMixin, ImportMixin, OrderedModel, models.Model):
485
485
  date=self._last_effective_date,
486
486
  portfolio=self.portfolio,
487
487
  ).aggregate(s=Sum("weighting"))["s"] or Decimal(0)
488
- return previous_weight * self.drift_factor
488
+ return round(previous_weight * self.drift_factor, 8)
489
489
 
490
490
  @property
491
491
  @admin.display(description="Effective Shares")
@@ -504,7 +504,7 @@ class Trade(TransactionMixin, ImportMixin, OrderedModel, models.Model):
504
504
  @property
505
505
  @admin.display(description="Target Weight")
506
506
  def _target_weight(self) -> Decimal:
507
- return getattr(self, "target_weight", self._effective_weight + self.weighting)
507
+ return getattr(self, "target_weight", round(self._effective_weight + self.weighting, 8))
508
508
 
509
509
  @property
510
510
  @admin.display(description="Target Shares")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wbportfolio
3
- Version: 1.54.1
3
+ Version: 1.54.2
4
4
  Author-email: Christopher Wittlinger <c.wittlinger@stainly.com>
5
5
  License-File: LICENSE
6
6
  Requires-Dist: cryptography==3.4.*
@@ -284,7 +284,7 @@ wbportfolio/models/transactions/dividends.py,sha256=mmOdGWR35yndUMoCuG24Y6BdtxDh
284
284
  wbportfolio/models/transactions/fees.py,sha256=wJtlzbBCAq1UHvv0wqWTE2BEjCF5RMtoaSDS3kODFRo,7112
285
285
  wbportfolio/models/transactions/rebalancing.py,sha256=obzgewWKOD4kJbCoF5fhtfDk502QkbrjPKh8T9KDGew,7355
286
286
  wbportfolio/models/transactions/trade_proposals.py,sha256=ikc3QMSBBWcBwCdl67_G-OomHuC-Tb9I-KttKkbgWwc,32399
287
- wbportfolio/models/transactions/trades.py,sha256=x-wy3Ak-XYvAv0XVw9fZKTx6g8iai7CtEPCrsRsvwuU,33323
287
+ wbportfolio/models/transactions/trades.py,sha256=yCySLaU0r1f1lHKPYlJ2W6uijGBV6N38WSzFTab1X6Q,33390
288
288
  wbportfolio/models/transactions/transactions.py,sha256=XTcUeMUfkf5XTSZaR2UAyGqCVkOhQYk03_vzHLIgf8Q,3807
289
289
  wbportfolio/pms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
290
290
  wbportfolio/pms/typing.py,sha256=izDCw5g6AUpqXriDDWa9KHpx7D7PSGLddBqhzXgryNQ,7875
@@ -521,7 +521,7 @@ wbportfolio/viewsets/transactions/mixins.py,sha256=WipvJoi5hylkpD0y9VATe30WAcwIH
521
521
  wbportfolio/viewsets/transactions/rebalancing.py,sha256=6rIrdK0rtKL1afJ-tYfAGdQVTN2MH1kG_yCeVkmyK8k,1263
522
522
  wbportfolio/viewsets/transactions/trade_proposals.py,sha256=zdb9yqyAE1-hcMmxxN3CYePWoPVWIW3WP3v8agErDeY,6210
523
523
  wbportfolio/viewsets/transactions/trades.py,sha256=GHOw5jtcqoaHiRrxxxL29c9405QiPisEn4coGELKDrE,22146
524
- wbportfolio-1.54.1.dist-info/METADATA,sha256=e7bohc0HnRhd7b5r86W16YcAXZjR0h2x698-uBl64yw,702
525
- wbportfolio-1.54.1.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
526
- wbportfolio-1.54.1.dist-info/licenses/LICENSE,sha256=jvfVH0SY8_YMHlsJHKe_OajiscQDz4lpTlqT6x24sVw,172
527
- wbportfolio-1.54.1.dist-info/RECORD,,
524
+ wbportfolio-1.54.2.dist-info/METADATA,sha256=LHlogq2kuHLrwNppV-kOmZUIuxkLxWFlTZbxM8FuHao,702
525
+ wbportfolio-1.54.2.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
526
+ wbportfolio-1.54.2.dist-info/licenses/LICENSE,sha256=jvfVH0SY8_YMHlsJHKe_OajiscQDz4lpTlqT6x24sVw,172
527
+ wbportfolio-1.54.2.dist-info/RECORD,,