mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-18 18:04:31 +08:00
black format
This commit is contained in:
@@ -4,6 +4,7 @@ import pandas as pd
|
||||
from dataclasses import dataclass, field
|
||||
from typing import ClassVar
|
||||
|
||||
|
||||
@dataclass
|
||||
class Order:
|
||||
"""
|
||||
@@ -17,6 +18,7 @@ class Order:
|
||||
factor : float
|
||||
presents the weight factor assigned in Exchange()
|
||||
"""
|
||||
|
||||
stock_id: str
|
||||
amount: float
|
||||
start_time: pd.Timestamp
|
||||
@@ -27,9 +29,7 @@ class Order:
|
||||
SELL: ClassVar[int] = 0
|
||||
BUY: ClassVar[int] = 1
|
||||
|
||||
|
||||
def __post_init__(self):
|
||||
if self.direction not in {Order.SELL, Order.BUY}:
|
||||
raise NotImplementedError("direction not supported, `Order.SELL` for sell, `Order.BUY` for buy")
|
||||
self.deal_amount = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user