Method: MtGox::Client#addorder!

Defined in:
lib/mtgox/client.rb

#addorder!(type, amount, price) ⇒ String

Create a new order

Examples:

# Sell one bitcoin for $123
MtGox.addorder! :sell, 1.0, 123.0

Parameters:

  • type (String)

    the type of order to create, either "buy" or "sell"

  • amount (Numberic)

    the number of bitcoins to buy/sell

  • price (Numeric)

    the bid/ask price in USD

Returns:

  • (String)

    order ID for the order, can be inspected using order_result

Requires Authentication:

  • true



207
208
209
# File 'lib/mtgox/client.rb', line 207

def addorder!(type, amount, price)
  post('/api/1/BTCUSD/order/add', {type: order_type(type), amount_int: intify(amount,:btc), price_int: intify(price, :usd)})
end