Coverage for source/environment/order.py: 100%
7 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-08-01 20:51 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-08-01 20:51 +0000
1# environment/order.py
3# global imports
5# local imports
7class Order():
8 """
9 Class storing information regarding particular order.
10 """
12 def __init__(self, amount: float, is_buy_order: bool, stop_loss: float, take_profit: float) -> None:
13 """
14 Class constructor.
16 Parameters:
17 amount (float): Amount of money assigned to order.
18 is_buy_order (bool): Indicates whether order should be treated as buy (long)
19 position - when true - or as sell (short) postion - when false
20 stop_loss (float): Coefficient used to close order when stock behaves contrary
21 to expectations.
22 take_profit (float): Coefficient used to close order when stock behaves accordingly
23 to expectations.
24 """
26 self.initial_value: float = amount
27 self.current_value: float = amount
28 self.is_buy_order: bool = is_buy_order
29 self.stop_loss: float = stop_loss
30 self.take_profit: float = take_profit