-
Notifications
You must be signed in to change notification settings - Fork 0
/
events.py
34 lines (25 loc) · 946 Bytes
/
events.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
Definition of events.
"""
from abc import ABC
EVENT_LOG = 'eLog' #Log Event
EVENT_MARKETDATA = 'eMarketData' #Pushing MarketData Event
EVENT_TRADE = 'eTrade' #Trade Event
EVENT_BUY = 'eBuy' #Buy Event
EVENT_SELL = 'eSell' #Sell Event
EVENT_CANCEL = 'eCancel' #Cancel Event
EVENT_POSITION = 'ePosition' #Position Query Event
EVENT_STATUS = 'eStatus' #Order Status Event
EVENT_ACCOUNT = 'eAccount' #Account Query Event
EVENT_PROFIT_CHANGED = 'eProfitChanged' #Profit Event
class StrategyEvent:
def __init__(self, type_=None, even_param_=None):
self.type_ = type_
self.even_param_ = even_param_
def clear(self):
"""
Delete unreferenced source.
"""
self.even_param_.clear()
class EventEngine(ABC):
pass