improve MM
This commit is contained in:
@@ -4,18 +4,12 @@ import asyncio
|
||||
MAX_ITEMS = 10
|
||||
|
||||
class Depth:
|
||||
def __init__(self):
|
||||
def __init__(self, order_unit):
|
||||
self.bids = []
|
||||
self.asks = []
|
||||
|
||||
self._event = asyncio.Event()
|
||||
self._event = asyncio.Event()
|
||||
self._order_unit = order_unit
|
||||
|
||||
async def wait(self):
|
||||
await self._event.wait()
|
||||
|
||||
def askVolumeUntil(self, price):
|
||||
ret = 0
|
||||
for i in range(len(self.asks)):
|
||||
if self.asks[i][0] > price: break
|
||||
ret += self.asks[i][1]
|
||||
return ret
|
||||
|
Reference in New Issue
Block a user