Class: Bitex::Ask

Inherits:
OrderBase show all
Defined in:
lib/bitex/order.rb

Overview

An Ask is an order to sell a given specie.

See Also:

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from OrderBase

active, all, #cancel!, find

Instance Attribute Details

#created_atTime

Returns Time when this Ask was created.

Returns:

  • (Time)

    Time when this Ask was created.



# File 'lib/bitex/order.rb', line 164

#idInteger

Returns This Ask’s unique ID.

Returns:

  • (Integer)

    This Ask’s unique ID.



# File 'lib/bitex/order.rb', line 161

#issuerString

Returns The issuer of this order, helps you tell apart orders created from the web UI and the API.

Returns:

  • (String)

    The issuer of this order, helps you tell apart orders created from the web UI and the API.



# File 'lib/bitex/order.rb', line 200

#priceBigDecimal

Returns Minimum price to charge per unit.

Returns:

  • (BigDecimal)

    Minimum price to charge per unit.



# File 'lib/bitex/order.rb', line 178

#produced_amountBigDecimal

Returns Amount of USD produced from this sale.

Returns:

  • (BigDecimal)

    Amount of USD produced from this sale



198
199
200
# File 'lib/bitex/order.rb', line 198

def produced_amount
  @produced_amount
end

#quantityBigDecimal

Returns Quantity of specie to sell in this Ask.

Returns:

  • (BigDecimal)

    Quantity of specie to sell in this Ask.



172
173
174
# File 'lib/bitex/order.rb', line 172

def quantity
  @quantity
end

#reasonObject

The cancellation reason of this Ask.

  • :not_cancelled Has not been cancelled.

  • :not_enough_funds Not enough funds to place this order.

  • :user_cancelled Cancelled per user’s request

  • :system_cancelled Bitex cancelled this order, for a good reason.



# File 'lib/bitex/order.rb', line 189

#remaining_quantityBigDecimal

Returns Quantity of specie left to sell in this Ask.

Returns:

  • (BigDecimal)

    Quantity of specie left to sell in this Ask.



176
177
178
# File 'lib/bitex/order.rb', line 176

def remaining_quantity
  @remaining_quantity
end

#specieSymbol

Returns :btc or :ltc.

Returns:

  • (Symbol)

    :btc or :ltc



# File 'lib/bitex/order.rb', line 167

#statusObject

The status of this Ask in its lifecycle.

  • :received queued to check if you have enough funds.

  • :executing available in our ourderbook waiting to be matched.

  • :cancelling To be cancelled as soon as our trading engine unlocks it.

  • :cancelled no further executed. May have some Remaining Quantity.

  • :completed Fully executed, Remaining Quantity should be 0.



# File 'lib/bitex/order.rb', line 181

Class Method Details

.create!(specie, quantity, price, wait = false) ⇒ Object

Create a new Ask for selling a Quantity of specie charging no less than Price per each.

Parameters:

  • specie (Symbol)

    :btc or :ltc, whatever you’re selling.

  • quantity (BigDecimal)

    Quantity to sell.

  • price (BigDecimal)

    Minimum price to charge when selling.

  • wait (Boolean) (defaults to: false)

    Block the process and wait until this ask moves out of the :received state, defaults to false.

See Also:



217
218
219
# File 'lib/bitex/order.rb', line 217

def self.create!(specie, quantity, price, wait=false)
  super
end