Classes
Methods
askPrice(marginalCost, market) → {number|undefined}
Calculate price this agent is willing to accept.
The returned price is either the max price, the midpoint of the bid/ask, or undefined.
Undefined (no ask) is returned if the propsed price is less than the marginalCost parameter
this.integer==true causes midpoint prices to be rounded up to the next integer before comparison with marginalValue
Parameters:
Name | Type | Description |
---|---|---|
marginalCost |
number | the marginal cost of producing the next unit. sets the minimum price for allowable bidding |
market |
Object | The market for which a bid is being prepared. An object with currentBidPrice() and currentAskPrice() methods. |
Returns:
agent's buy price or undefined
- Type
- number | undefined
bidPrice(marginalValue, market) → {number|undefined}
Calculate price this agent is willing to pay.
The returned price is either the min price, the midpoint of the bid/ask, or undefined.
Undefined (no bid) is returned if the propsed price would exceed the marginalValue parameter
this.integer==true causes midpoint prices to be rounded up to the next integer before comparison with marginalValue
Parameters:
Name | Type | Description |
---|---|---|
marginalValue |
number | the marginal value of redeeming the next unit. sets the maximum price for allowable bidding |
market |
Object | The market for which a bid is being prepared. An object with currentBidPrice() and currentAskPrice() methods. |
Returns:
agent's buy price or undefined
- Type
- number | undefined