edu.cuny.cat.market.quoting
Class SpreadBasedQuotingPolicy

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
              extended by edu.cuny.cat.market.quoting.SpreadBasedQuotingPolicy
All Implemented Interfaces:
AuctionEventListener, edu.cuny.config.param.Parameterizable, edu.cuny.obj.Resetable

public class SpreadBasedQuotingPolicy
extends DoubleSidedQuotingPolicy

A quoting policy extending DoubleSidedQuotingPolicy that adjusts ask and bid quotes when the ask quote falls below the bid quote. When that happens, the ask quote is set to be a point above their average and the bid quote below the average. The spread between the quotes is configurable.

This quoting policy is useful when LazyMaxVolumeShoutEngine is used.

Parameters

base .spread
double > 0 (10 by default)
(the spread to be maintained between the ask quote and the bid quote when the former falls below the latter.)

Default Base

spread_based_quoting

Version:
$Revision: 1.7 $
Author:
Jinzhong Niu

Field Summary
static double DEFAULT_SPREAD
           
static java.lang.String P_DEF_BASE
           
static java.lang.String P_SPREAD
           
protected  double spread
           
 
Fields inherited from class edu.cuny.cat.market.AuctioneerPolicy
auctioneer
 
Constructor Summary
SpreadBasedQuotingPolicy()
           
 
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.
 void setup(edu.cuny.config.param.ParameterDatabase parameters, edu.cuny.config.param.Parameter base)
           
 java.lang.String toString()
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

P_SPREAD

public static final java.lang.String P_SPREAD
See Also:
Constant Field Values

P_DEF_BASE

public static final java.lang.String P_DEF_BASE
See Also:
Constant Field Values

DEFAULT_SPREAD

public static final double DEFAULT_SPREAD
See Also:
Constant Field Values

spread

protected double spread
Constructor Detail

SpreadBasedQuotingPolicy

public SpreadBasedQuotingPolicy()
Method Detail

setup

public void setup(edu.cuny.config.param.ParameterDatabase parameters,
                  edu.cuny.config.param.Parameter base)
Specified by:
setup in interface edu.cuny.config.param.Parameterizable
Overrides:
setup in class AuctioneerPolicy

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.

Overrides:
askQuote in class DoubleSidedQuotingPolicy
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.

Overrides:
bidQuote in class DoubleSidedQuotingPolicy
Parameters:
shoutEngine - the shout engine processing shouts
Returns:
bid quote

toString

public java.lang.String toString()
Overrides:
toString in class AuctioneerPolicy