Skip to content

Commit

Permalink
removed some warnings 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaron committed Feb 23, 2024
1 parent b11e48b commit ac84491
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion roboquant/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def closed(self):
return self in OrderStatus._CLOSE

def __repr__(self) -> str:
return self.name
return self.name # type: ignore


@dataclass
Expand Down
4 changes: 2 additions & 2 deletions roboquant/traders/flextrader.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(
) -> None:
super().__init__()
self.one_order_only = one_order_only
self.size_ndigits: int = size_fractions
self.size_digits: int = size_fractions
self.min_buying_power: float = min_buying_power
self.increase_position = increase_position
self.shorting = shorting
Expand All @@ -66,7 +66,7 @@ def __init__(
def _get_order_size(self, rating: float, contract_price: float, max_order_value: float) -> Decimal:
"""Return the order size"""
size = Decimal(rating * max_order_value / contract_price)
rounded_size = round(size, self.size_ndigits)
rounded_size = round(size, self.size_digits)
return rounded_size

def create_orders(self, signals: dict[str, Signal], event: Event, account: Account) -> list[Order]:
Expand Down

0 comments on commit ac84491

Please sign in to comment.