2017-07-27 102 views
-2

試圖讓我的購買限制爲了工作,甚至當我通過它手動傳遞東西時,我似乎無法讓它工作。A [買入限價],Bittrex API不工作,[賣出限額]爲

使用這種包裝:https://github.com/ericsomdahl/python-bittrex/blob/master/bittrex/bittrex.py

一個限價賣出秩序的作品,而不是購買限制

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) 
+1

請更好地指出問題所在。有錯誤消息嗎? – Difster

+0

**您是否介意瞭解如何詢問基於MCVE的問題**? StackOverflow鼓勵用戶提供** M **最小(效率)+ ** C **完全(自包含 - 是 - 帶數據)+ ** V **可驗證(準備重新運行)+ * * E ** xamples(一個完整的例子,包含所有細節+數據,以允許重新測試)代碼,您努力工作。 **最好的下一步是瞭解這個社區練習+修改並完成上面的MCVE **。無論如何,歡迎在這個偉大的知識社區成爲我們的積極參與成員。 – user3666197

+0

@Difster該問題位於實際的API調用中,我認爲,我沒有得到任何運行時或編譯錯誤,但無法獲取購買錯誤的功能。我使用所有正確的參數。此外,賣功能沒有問題,所以我真的被困在這裏。 –

回答