edu.cuny.cat.market.quoting
Class DoubleSidedQuotingPolicy

java.lang.Object
  extended by edu.cuny.cat.market.AuctioneerPolicy
      extended by edu.cuny.cat.market.quoting.QuotingPolicy
          extended by edu.cuny.cat.market.quoting.DoubleSidedQuotingPolicy
All Implemented Interfaces:
AuctionEventListener, edu.cuny.config.param.Parameterizable, edu.cuny.obj.Resetable
Direct Known Subclasses:
SpreadBasedQuotingPolicy

public class DoubleSidedQuotingPolicy
extends QuotingPolicy

A quoting policy that sets the market quotes based on the boundary matched and unmatched ask and bid in the auction's shout engine. It is named so because it uses both the competitive side and the opposite side to determine a market quote.

Version:
$Revision: 1.4 $
Author:
Jinzhong Niu

Field Summary
 
Fields inherited from class edu.cuny.cat.market.AuctioneerPolicy
auctioneer
 
Constructor Summary
DoubleSidedQuotingPolicy()
           
 
Method Summary
 double askQuote(ShoutEngine shoutEngine)
          gets the ask quote as the minimum of the lowest unmatched ask and the lowest matched bid.
 double bidQuote(ShoutEngine shoutEngine)
          gets the bid quote as the maximum of the highest matched ask and the highest unmatched bid.
 
Methods inherited from class edu.cuny.cat.market.quoting.QuotingPolicy
midQuote
 
Methods inherited from class edu.cuny.cat.market.AuctioneerPolicy
eventOccurred, getAuctioneer, initialize, reset, setAuctioneer, setup, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleSidedQuotingPolicy

public DoubleSidedQuotingPolicy()
Method Detail

askQuote

public double askQuote(ShoutEngine shoutEngine)
gets the ask quote as the minimum of the lowest unmatched ask and the lowest matched bid. If a bid beats it, the bid will be matched with some ask. With QuoteBeatingAcceptingPolicy, an ask beating it will be accepted.

Specified by:
askQuote in class QuotingPolicy
Parameters:
shoutEngine - the shout engine processing shouts
Returns:
ask quote

bidQuote

public double bidQuote(ShoutEngine shoutEngine)
gets the bid quote as the maximum of the highest matched ask and the highest unmatched bid. If an ask beats it, the ask will be matched with some bid. With QuoteBeatingAcceptingPolicy, a bid beating it will be accepted.

Specified by:
bidQuote in class QuotingPolicy
Parameters:
shoutEngine - the shout engine processing shouts
Returns:
bid quote