Skip to content

Commit

Permalink
change old_quantity of StockSimulationBookingPosition
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuizi7 committed Oct 17, 2018
1 parent b31fd71 commit 9f7a2a3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions rqalpha/mod/rqalpha_mod_sys_simulation/booking.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,13 @@ def quantity(self):

@property
def old_quantity(self):
user_system_log.warn(_("Quantity of stock has not been classfied "))
return 0
if self._direction == POSITION_DIRECTION.SHORT:
return 0
return self._position.sellable

@property
def today_quantity(self):
if self._direction == POSITION_DIRECTION.SHORT:
return 0
return self.quantity
return self.quantity - self.old_quantity

@property
def avg_price(self):
Expand Down

0 comments on commit 9f7a2a3

Please sign in to comment.