1

I started writing code for the Bitfinex api yesterday and I've been struggling quite a lot with this. I am using jndok's python implementation.

I added my pyblic and secret keys and wrote this line of code at the end with python 2.7 on Windows 8:

rep = place_order(0.001, 589.0, 'sell', 'limit', exchange='bitfinex')

And I thought that would do it but the reply I get 'Key amount should be a decimal string' and the order is not placed. I also tried to print the reply code I get from the server and it is 400.

How can this be resolved?

3

You are submitting a float value. Float values are not totaly accurate:

>>> 0.9 
0.90000000000000002

Thats why the specification requires a Decimal datatype:

>>> from decimal import Decimal
>>> Decimal("0.001") 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.