Bitcoin Forum
April 27, 2024, 04:30:28 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Using BTC-e API to place orders  (Read 685 times)
Lykegenes (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
February 22, 2014, 08:06:22 PM
 #1

Hi!

I'm trying to figure out exactly how the BTCe API works. What i want to do is to make sure my trade is executed right away.

Let's say i have 1000$ and i want to buy all the BTC i can. There is 1 BTC for sale @ 500$, and 5 BTC @ 501$. Which one of these scenarios is what will happen?
1) Can i just tell the API to buy 1 BTC @ 1000$, or 0.1@10000? (and in reality, it will buy 1@500, and the rest @501, or whatever price is the lowest?)
2) Or do i have to make two orders? (one @500, one @501)? What if someone sells @500.5? What if someone buys these coins @500 before i place my order?


Basically, i just don't want to have to handle partially filled orders. Option 1 is the easiest, but i want to be sure it can work this way  Wink

Thanks!
"Bitcoin: mining our own business since 2009" -- Pieter Wuille
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714192228
Hero Member
*
Offline Offline

Posts: 1714192228

View Profile Personal Message (Offline)

Ignore
1714192228
Reply with quote  #2

1714192228
Report to moderator
1714192228
Hero Member
*
Offline Offline

Posts: 1714192228

View Profile Personal Message (Offline)

Ignore
1714192228
Reply with quote  #2

1714192228
Report to moderator
immerzl
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
February 28, 2014, 09:07:25 PM
 #2

You will always buy the "cheapest" sales first. So in your example, if you give an order to buy 6 BTC @ 510$, you will get 1 BTC @ 500$ and 5 BTC @ 501. So you will pay 3005$ in total for 6 BTC.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!