forked from c9s/bbgo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2af3dfb
commit e29b6e8
Showing
11 changed files
with
150 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .balance import Balance | ||
from .kline import KLine | ||
from .order import Order |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass | ||
class Balance: | ||
exchange: str | ||
currency: str | ||
available: float | ||
locked: float |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from dataclasses import dataclass | ||
from datetime import datetime | ||
|
||
|
||
@dataclass | ||
class KLine: | ||
exchange: str | ||
symbol: str | ||
open: float | ||
high: float | ||
low: float | ||
close: float | ||
volume: float | ||
session: str = None | ||
start_time: datetime = None | ||
end_time: datetime = None | ||
quote_volume: float = None | ||
closed: bool = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from dataclasses import dataclass | ||
from datetime import datetime | ||
|
||
from ..enums import OrderType | ||
from ..enums import SideType | ||
|
||
|
||
@dataclass | ||
class Order: | ||
order_id: str | ||
side: SideType | ||
order_type: OrderType | ||
price: float | ||
stop_price: float | ||
average_price: float | ||
status: str | ||
market: str | ||
created_at: datetime | ||
volume: float | ||
remaining_volume: float | ||
executed_volume: float | ||
trade_count: int | ||
client_order_id: str | ||
group_id: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from .channel_type import ChannelType | ||
from .event_type import EventType | ||
from .order_type import OrderType | ||
from .side_type import SideType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from enum import Enum | ||
|
||
|
||
class ChannelType(Enum): | ||
BOOK = 'book' | ||
TRADE = 'trade' | ||
TICKER = 'ticker' | ||
USER = 'user' | ||
KLINE = 'kline' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from enum import Enum | ||
|
||
|
||
class EventType(Enum): | ||
ERROR = 'error' | ||
SUBSCRIBED = 'subscribed' | ||
UNSUBSCRIBED = 'unsubscribed' | ||
AUTHENTICATED = 'authenticated' | ||
SNAPSHOT = 'snapshot' | ||
UPDATE = 'update' | ||
ORDER_SNAPSHOT = 'order_snapshot' | ||
ORDER_UPDATE = 'order_update' | ||
TRADE_SNAPSHOT = 'trade_snapshot' | ||
TRADE_UPDATE = 'trade_update' | ||
ACCOUNT_SNAPSHOT = 'account_snapshot' | ||
ACCOUNT_UPDATE = 'account_update' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from enum import Enum | ||
|
||
|
||
class OrderType(Enum): | ||
MARKET = 'market' | ||
LIMIT = 'limit' | ||
STOP_MARKET = 'stop_market' | ||
STOP_LIMIT = 'stop_limit' | ||
POST_ONLY = 'post_only' | ||
IOC_LIMIT = 'ioc_limit' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from enum import Enum | ||
|
||
|
||
class SideType(Enum): | ||
BUY = 'buy' | ||
SELL = 'sell' |
Large diffs are not rendered by default.
Oops, something went wrong.