implement losscut in MM algorithm

This commit is contained in:
2023-07-23 08:55:06 +09:00
parent f6413a3389
commit e376eea76b
3 changed files with 74 additions and 12 deletions

View File

@@ -14,6 +14,24 @@ class Player:
})
self._check(res)
async def orderMarketSell(self, pair, amount):
res = await self._post("user/spot/order", data={
"pair": f"{pair[0]}_{pair[1]}",
"amount": str(amount),
"side": "sell",
"type": "market",
})
return self._check(res)["data"]["order_id"]
async def orderMarketBuy(self, pair, amount):
res = await self._post("user/spot/order", data={
"pair": f"{pair[0]}_{pair[1]}",
"amount": str(amount),
"side": "buy",
"type": "market",
})
return self._check(res)["data"]["order_id"]
async def orderLimitSell(self, pair, amount, price):
res = await self._post("user/spot/order", data={
"pair": f"{pair[0]}_{pair[1]}",