Ccxt: La orden de compra / venta del mercado HitBTC falla

Creado en 12 oct. 2017  ·  3Comentarios  ·  Fuente: ccxt/ccxt

Hola,

aquí está mi código:

import ccxt
hitbtc = ccxt.hitbtc({
    "apiKey": "key",
    "secret": "secret",
    "verbose": True,
})
print(hitbtc.create_market_sell_order('BTC/USD', 0.01))

ccxt falla ...

PS Key & nonce está bien, puedo extraer datos de saldo, por ejemplo.

Comentario más útil

@ Fcl69 ok, pero, por favor, ten en cuenta que hay un poco más:

  1. HitBTC tiene un parámetro de orden timeInForce , que es una configuración que controla la ejecución de la orden (cómo HitBTC debe tratar y completar la orden):
GTC (Good-Til-Canceled): the order will stay open or partially closed until filled or canceled by user
IOC (Immediate-Or-Cancel): the order will either fill immediately or will be canceled automatically
FOK (Fill-Or-Kill): the order will either be filled entirely or will expire
DAY (Day): the order will either be filled in 24 hours or will expire
GTD (Good Till Date): the order will expire on specific date
  1. El tipo de ejecución predeterminado para órdenes limitadas en HitBTC y ccxt es GTC.

  2. Para órdenes de mercado, HitBTC solo permite IOC o FOK. El valor predeterminado en HitBTC y ccxt es FOK.
    Si necesita la ejecución de IOC, debe pasar eso como un parámetro adicional con su orden, así:

hitbtc.create_market_sell_order('BTC/USD', 0.01) # default
hitbtc.create_market_sell_order('BTC/USD', 0.01, { 'timeInForce': 'FOK' }) # default
hitbtc.create_market_buy_order('BTC/USD', 0.01, { 'timeInForce': 'IOC' })

hitbtc.create_limit_sell_order('BTC/USD', 0.01) # default
hitbtc.create_limit_sell_order('BTC/USD', 0.01, { 'timeInForce': 'GTC' }) # default
hitbtc.create_limit_buy_order('BTC/USD', 0.01, { 'timeInForce': 'IOC' })

Háganos saber si tiene alguna pregunta o dificultad. ¡Gracias!

Todos 3 comentarios

¡Hola, @ Fcl69!
He subido una versión ligeramente editada ... ¿puedes intentarlo de nuevo e informar? Debería funcionar ahora.
¡Salud!

¡Funcionó! ¡Gracias!

@ Fcl69 ok, pero, por favor, ten en cuenta que hay un poco más:

  1. HitBTC tiene un parámetro de orden timeInForce , que es una configuración que controla la ejecución de la orden (cómo HitBTC debe tratar y completar la orden):
GTC (Good-Til-Canceled): the order will stay open or partially closed until filled or canceled by user
IOC (Immediate-Or-Cancel): the order will either fill immediately or will be canceled automatically
FOK (Fill-Or-Kill): the order will either be filled entirely or will expire
DAY (Day): the order will either be filled in 24 hours or will expire
GTD (Good Till Date): the order will expire on specific date
  1. El tipo de ejecución predeterminado para órdenes limitadas en HitBTC y ccxt es GTC.

  2. Para órdenes de mercado, HitBTC solo permite IOC o FOK. El valor predeterminado en HitBTC y ccxt es FOK.
    Si necesita la ejecución de IOC, debe pasar eso como un parámetro adicional con su orden, así:

hitbtc.create_market_sell_order('BTC/USD', 0.01) # default
hitbtc.create_market_sell_order('BTC/USD', 0.01, { 'timeInForce': 'FOK' }) # default
hitbtc.create_market_buy_order('BTC/USD', 0.01, { 'timeInForce': 'IOC' })

hitbtc.create_limit_sell_order('BTC/USD', 0.01) # default
hitbtc.create_limit_sell_order('BTC/USD', 0.01, { 'timeInForce': 'GTC' }) # default
hitbtc.create_limit_buy_order('BTC/USD', 0.01, { 'timeInForce': 'IOC' })

Háganos saber si tiene alguna pregunta o dificultad. ¡Gracias!

¿Fue útil esta página
0 / 5 - 0 calificaciones