forked from ericjang/cryptocurrency_arbitrage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorder.py
More file actions
18 lines (17 loc) · 716 Bytes
/
order.py
File metadata and controls
18 lines (17 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# represents a single order object
# very simple data structure!
class Order(object):
def __init__(self, price, volume, type=None, pair=None, orderID=None, timestamp=None):
"""
markets are usually expressed in terms of BASE_ALT where you buy
and sell units of BASE with ALT.
price = price (in units alt) of 1 unit of base
volume = total volume of base desired
orderID = necessary for tracking & cancelling & ignoring already executed orders when backtesting
"""
self.p = price
self.v = volume
self.type = type # buy or sell
self.pair = pair # market we are trading on
self.id = orderID
self.time = timestamp