mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 23:04:21 +01:00
Added example of MARKET order with price=None
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
1.2.4
|
||||
-) Added example of MARKET order with price=None
|
||||
|
||||
1.2.3
|
||||
-) Tests adjusted
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import asyncio
|
||||
import time
|
||||
sys.path.append('../../../')
|
||||
from bfxapi import Client
|
||||
from bfxapi.models import OrderType
|
||||
|
||||
API_KEY=os.getenv("BFX_KEY")
|
||||
API_SECRET=os.getenv("BFX_SECRET")
|
||||
@@ -15,7 +16,7 @@ bfx = Client(
|
||||
)
|
||||
|
||||
async def create_order():
|
||||
response = await bfx.rest.submit_order("tBTCUSD", 10, 0.1)
|
||||
response = await bfx.rest.submit_order(symbol="tBTCUSD", amount=10, price=None, market_type=OrderType.MARKET)
|
||||
# response is in the form of a Notification object
|
||||
for o in response.notify_info:
|
||||
# each item is in the form of an Order object
|
||||
|
||||
@@ -34,7 +34,7 @@ def log_error(msg):
|
||||
|
||||
@bfx.ws.on('authenticated')
|
||||
async def submit_order(auth_message):
|
||||
await bfx.ws.submit_order('tBTCUSD', 19000, 0.01, Order.Type.EXCHANGE_MARKET)
|
||||
await bfx.ws.submit_order(symbol='tBTCUSD', price=None, amount=0.01, market_type=Order.Type.EXCHANGE_MARKET)
|
||||
|
||||
# If you dont want to use a decorator
|
||||
# ws.on('authenticated', submit_order)
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
This module contains the current version of the bfxapi lib
|
||||
"""
|
||||
|
||||
__version__ = '1.2.3'
|
||||
__version__ = '1.2.4'
|
||||
|
||||
2
setup.py
2
setup.py
@@ -11,7 +11,7 @@ from os import path
|
||||
here = path.abspath(path.dirname(__file__))
|
||||
setup(
|
||||
name='bitfinex-api-py',
|
||||
version='1.2.3',
|
||||
version='1.2.4',
|
||||
description='Official Bitfinex Python API',
|
||||
long_description='A Python reference implementation of the Bitfinex API for both REST and websocket interaction',
|
||||
long_description_content_type='text/markdown',
|
||||
|
||||
Reference in New Issue
Block a user