-2

Trying to get my Buy Limit order to work and even when I pass things manually through it, I cannot seem to get it to work.

Using this wrapper: https://github.com/ericsomdahl/python-bittrex/blob/master/bittrex/bittrex.py

A Sell Limit order works, but not the Buy Limit.

from bittrex import Bittrex
api = Bittrex('0c7a0faxxxxxx4ac5aa', 'fce8a555xxx3xxac10')

# getting BTCBalance
trade = 'BTC'
pumpcurrency = raw_input('which currency would you like to pump?')
market = '{0}-{1}'.format(trade, pumpcurrency)

BTCbalance = api.get_balance(trade)['result']['Available']
print "Your balance is {0} {1}.".format(BTCbalance, trade)

# Getting the BTC price for your pumpable currency
cryptosummary = api.getmarketsummary(market)
currencyprice = cryptosummary['result'][0]['Last']
print 'The price for {0} is {1:.8f} {2}.'.format(pumpcurrency, currencyprice, trade)

# Amount of coins to buy
amount = (BTCbalance*.99)/currencyprice

# How big of a profit you want to make
multiplier = 1+ float(raw_input("How much profit would you like to make? (input percentage as integer)"))/100
print ("Selling at "+str(multiplier) +"x profit")

# Buying the pump currency for BTC
api.buy_limit('BTC-ARK', float(.1), .00000011)
print ('Buying ' +str(amount)+" "+ pumpcurrency + ' at ' + str(currencyprice) + " each.")

# Multiplying the price by the multiplier
#sellprice = round(currencyprice*multiplier, 8)

# Selling pumped for profit
#print 'Selling {0} {1} for {2:.8f} {3}.'.format(amount, pumpcurrency, sellprice, trade)
api.sell_limit('BTC-MYST', .1, .1)
user3666197
  • 1
  • 6
  • 50
  • 92
  • 1
    Please do a better job of indicating what the problem is. Were there error messages? – Difster Jul 27 '17 at 22:18
  • **Would you mind to read about how to ask the MCVE-based questions** ? StackOverflow encourages users to present a **M**inimum ( efficiency ) + **C**omplete ( self-contained -- Yes -- with data ) + **V**erifiable ( ready for re-runs ) + **E**xamples ( a full example, with all details+data, to allow for re-testing ) of code, that you struggle to make work. **The best next step is to learn about this Community practice+ revise & complete your MCVE above**. Anyway, welcome in this great Community of Knowledge & become our active, contributing member. – user3666197 Jul 28 '17 at 11:22
  • @Difster the problem is located in the actual API call I think, I dont get any run time or compilation errors but I cannot get the buy error to function. I use all correct parameters . Furthermore, the sell function works no problem so I am really stuck here. – Rango dango Jul 28 '17 at 16:54

1 Answers1

0

I think I've got your answer There is a minimal 50K satoshis value for buy order on Bittrex.

https://support.bittrex.com/hc/en-us/articles/115000240791-Error-Codes-Troubleshooting-common-error-codes

Consequently, if you test your code with single coin as I did, it won't be fulfilled.

I suggest you to print your api.buy_limit in order to check whether you got the 'DUST_TRADE_DISALLOWED_MIN_VALUE_50K_SAT' error message.

Benjamin
  • 1
  • 1