Quote

class abce.quote.Quote[source]

Bases: object

Quotes as opposed to trades are uncommitted offers. They can be made even if they agent can not fullfill them. With accept_quote() and accept_quote_partial(), the receiver of a quote can transform them into a trade.

accept_quote(quote)[source]

makes a commited buy or sell out of the counterparties quote. For example, if you receive a buy quote you can accept it and a sell offer is send to the offering party.

Args::
quote: buy or sell quote that is accepted
accept_quote_partial(quote, quantity)[source]

makes a commited buy or sell out of the counterparties quote

Args::
quote: buy or sell quote that is accepted quantity: the quantity that is offered/requested it should be less than propsed in the quote, but this is not enforced.
get_quotes(good, descending=False)[source]

self.get_quotes() returns all new quotes and removes them. The order is randomized.

Args:
good:
the good which should be retrieved
descending(bool,default=False):
False for descending True for ascending by price
Returns:
list of quotes ordered by price

Example:

quotes = self.get_quotes()
get_quotes_all(descending=False)[source]

self.get_quotes_all() returns a dictionary with all now new quotes ordered by the good type and removes them. The order is randomized.

Args:
descending(bool,default=False):
False for descending True for ascending by price
Returns:
dictionary of list of quotes ordered by price. The dictionary itself is ordered by price.

Example:

quotes = self.get_quotes()
quote_buy(receiver_group, receiver_id, good=None, quantity=None, price=None)[source]

quotes a price to buy quantity of ‘good’ a receiver. Use None, if you do not want to specify a value.

price (money) per unit offers a deal without checking or committing resources

Args:
receiver_group:
agent group name of the agent
receiver_id:
the agent’s id number
‘good’:
name of the good
quantity:
maximum units disposed to buy at this price
price:
price per unit
quote_sell(receiver_group, receiver_id, good=None, quantity=None, price=None)[source]

quotes a price to sell quantity of ‘good’ to a receiver. Use None, if you do not want to specify a value.

price (money) per unit offers a deal without checking or committing resources

Args:
receiver_group:
agent group name of the agent
receiver_id:
the agent’s id number
‘good’:
name of the good
quantity:
maximum units disposed to sell at this price
price:
price per unit
abce.quote.Quotation(sender_group, sender_id, receiver_group, receiver_id, good, quantity, price, buysell, id)[source]