Skip to content

Commit 6e4dd2b

Browse files
committed
Fix absolute net gain calculation
1 parent 7c38484 commit 6e4dd2b

File tree

1 file changed

+2
-2
lines changed
  • investing_algorithm_framework/domain/models/trade

1 file changed

+2
-2
lines changed

investing_algorithm_framework/domain/models/trade/trade.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def net_gain_absolute(self):
208208

209209
if self.last_reported_price is not None:
210210
gain = (
211-
self.remaining *
211+
self.available_amount *
212212
(self.last_reported_price - self.open_price)
213213
)
214214

@@ -228,7 +228,7 @@ def net_gain_percentage(self):
228228

229229
if self.last_reported_price is not None:
230230
gain = (
231-
self.remaining *
231+
self.available_amount *
232232
(self.last_reported_price - self.open_price)
233233
)
234234

0 commit comments

Comments
 (0)