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