Class: OneupmanshipAgent

OneupmanshipAgent(optionsopt)

OneupmanshipAgent is a robotic version of that annoying market participant who starts at extremely high or low price, and always bid $1 more, or ask $1 less than any competition

Constructor

new OneupmanshipAgent(optionsopt)

create OneupmanshipAgent
Parameters:
Name Type Attributes Description
options Object <optional>
Passed to Trader and Agent constructors
Source:

Classes

OneupmanshipAgent

Methods

askPrice(marginalCost, market) → {number|undefined}

Calculate price this agent is willing to accept. The returned price is either this.maxPrice (no asks), or market.currentAskPrice()-1, or undefined. Undefined (no bid) is returned if the propsed price is less than the marginalCost parameter this.integer is ignored
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.
Source:
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 this.minPrice (no bidding), or market.currentBidPrice()+1, or undefined. Undefined (no bid) is returned if the propsed price would exceed the marginalValue parameter this.integer is ignored
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.
Source:
Returns:
agent's buy price or undefined
Type
number | undefined