<p>The exact problem you're facing regards the number of acceptable decimal digits in the <code>rate</code> field.</p>

<p>You're trying to submit an order on the <code>BTC/USD</code> pair, which happens to have a max decimal allotment of 3. Meaning, you can submit an order for example 800.123, but NOT 800.1234 Not all pairs are the same. <code>LTC/USD</code> can have 6 digits, most BTC based pairs can accept 5 digits.</p>

<p>To get a list of exact information regarding the individual pairs, use this public endpoint for a JSON object that gives you all the values:  <a href="https://btc-e.com/api/3/info" rel="nofollow">https://btc-e.com/api/3/info</a></p>

<p>As far as I know, all pairs' <code>amount</code> fields can have a max of 8 decimals. You are rounding both the amount and rate to 4 digits. Fix the rate field and it should work.</p>

<p>Please keep in mind when I say "decimal places" I mean actual number of digits after the period in a number. Not the numerical type <code>decimal</code> that you are using. Using a <code>double</code> or <code>float</code> will work as well, provided they are rounded properly.</p>

CC BY-SA 3.0
2014-01-31T16:31:51.640Z
2014-01-31T16:31:51.640Z
ACVentures
<p>The problem seems to be in the Price. This worked:</p>

<p>APIMain.Trade(BtcePair.BtcUsd, TradeType.Buy, decimal.Floor(myBidP),decimal.Round(myBidQ,4));</p>

<p>Can somebody confirm that the price must be rounded to the nearest integer?</p>

<p>Bonne chance trading everybody......</p>

CC BY-SA 3.0
2014-01-31T17:08:53.773Z
Price and quantity are automatically rounded by BTC-e. I believe they round to the nearest number (e.g. 0.5 up 0.4999 down), still I would strongly recommend rounding down yourself to avoid missing trades due to insufficient funds.
Mark
CC BY-SA 3.0
2013-12-14T13:04:15.790Z
2013-12-14T13:04:15.790Z
user10776
<p>I get the following message when trying to send a buy/sell order through btc-e api using a variable:
<code>"you incorrectly entered one of the fields"</code>. </p>

<p>This is the line of code I use for sending an order:</p>

<pre><code>APIMain.Trade(BtcePair.BtcUsd, TradeType.Sell, Math.Round(myAskP, 4), Math.Round(myAskQ, 4));
</code></pre>

<p>Sending an order via api does work when I enter it like this:</p>

<pre><code>APIMain.Trade(BtcePair.BtcUsd, TradeType.Sell, 800m, 0.5m);
</code></pre>

<p>How do I force a decimal variable to be formatted like the line above?
Anybody experienced similar problems?</p>

CC BY-SA 3.0
2013-12-14T04:03:58.057Z
might be helpful if you could mention the particular programming language you are using I'm guessing maybe Java?
Mark S.
<api>
sending an order through BTC-e API incorrect field error
user10776
# sending an order through BTC-e API incorrect field error

(Asked by: username_0 on 2013-12-13)

I get the following message when trying to send a buy/sell order through btc-e api using a variable:
"you incorrectly entered one of the fields". 
This is the line of code I use for sending an order:
APIMain.Trade(BtcePair.BtcUsd, TradeType.Sell, Math.Round(myAskP, 4), Math.Round(myAskQ, 4));

Sending an order via api does work when I enter it like this:
APIMain.Trade(BtcePair.BtcUsd, TradeType.Sell, 800m, 0.5m);

How do I force a decimal variable to be formatted like the line above?
Anybody experienced similar problems?

**Tags:** api

> **Comments:**
> **username_1**: might be helpful if you could mention the particular programming language you are using I'm guessing maybe Java?  

---

## 2 answers

### Answer by username_2 on 2014-01-31. Score: 2

The exact problem you're facing regards the number of acceptable decimal digits in the `rate` field.

You're trying to submit an order on the `BTC/USD` pair, which happens to have a max decimal allotment of 3. Meaning, you can submit an order for example 800.123, but NOT 800.1234 Not all pairs are the same. `LTC/USD` can have 6 digits, most BTC based pairs can accept 5 digits.

To get a list of exact information regarding the individual pairs, use this public endpoint for a JSON object that gives you all the values: <https://btc-e.com/api/3/info>

As far as I know, all pairs' `amount` fields can have a max of 8 decimals. You are rounding both the amount and rate to 4 digits. Fix the rate field and it should work.

Please keep in mind when I say "decimal places" I mean actual number of digits after the period in a number. Not the numerical type `decimal` that you are using. Using a `double` or `float` will work as well, provided they are rounded properly.


---

### Answer by username_0 on 2013-12-14. Score: 1

The problem seems to be in the Price. This worked:

APIMain.Trade(BtcePair.BtcUsd, TradeType.Buy, decimal.Floor(myBidP),decimal.Round(myBidQ,4));

Can somebody confirm that the price must be rounded to the nearest integer?

Bonne chance trading everybody......

> **Comments:**
> **username_3**: Price and quantity are automatically rounded by BTC-e. I believe they round to the nearest number (e.g. 0.5 up 0.4999 down), still I would strongly recommend rounding down yourself to avoid missing trades due to insufficient funds.  

---

