edu.cuny.cat.trader.strategy
Class GDStrategy

java.lang.Object
  extended by java.util.Observable
      extended by edu.cuny.cat.trader.strategy.AbstractStrategy
          extended by edu.cuny.cat.trader.strategy.FixedQuantityStrategyImpl
              extended by edu.cuny.cat.trader.strategy.GDStrategy
All Implemented Interfaces:
AuctionEventListener, FixedQuantityStrategy, Strategy, edu.cuny.config.param.Parameterizable, edu.cuny.obj.Prototypeable, edu.cuny.obj.Resetable, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
GDLStrategy

public class GDStrategy
extends FixedQuantityStrategyImpl
implements java.io.Serializable, edu.cuny.obj.Prototypeable

An implementation of the Gjerstad Dickhaut strategy. Agents using this strategy calculate the probability of any bid being accepted and bid to maximize expected profit. See

"Price Formation in Double Auctions" S. Gjerstad, J. Dickhaut and R. Palmer

Note that you must configure a logger of type HistoricalDataReport in order to use this strategy.

Because the auction framework in JCAT differs from the one used in the above paper and the one used in JASA, several alterations have been made:

Parameters

base .maxprice
double >= 0 (200 by default)
(max price in auction)
base .history
(the parameter base for HistoricalReport used by this strategy)

Default Base

gd_strategy

Version:
$Revision: 1.30 $
Author:
Jinzhong Niu
See Also:
HistoricalReport, Serialized Form

Field Summary
static double DEFAULT_MAX_PRICE
           
protected  HistoricalReport historicalReport
           
protected  double max
           
protected  double maxPoint
           
protected  double maxPrice
           
protected  double maxProb
           
static int MIN_INTERPOLATION_POINTS
          the minimum number of points to interpolate between two prices unless the two prices are too close to do so
static java.lang.String P_DEF_BASE
           
static java.lang.String P_HISTORY
           
static java.lang.String P_MAXPRICE
           
 
Fields inherited from class edu.cuny.cat.trader.strategy.FixedQuantityStrategyImpl
quantity
 
Fields inherited from class edu.cuny.cat.trader.strategy.AbstractStrategy
agent, currentShout, MIN_PRICE_DIFFERENCE
 
Constructor Summary
GDStrategy()
           
 
Method Summary
 double calculateProbability(double price)
           
 void eventOccurred(AuctionEvent event)
           
 HistoricalReport getHistoricalReport()
           
protected  void getMax(double a1, double p1, double a2, double p2)
           
 boolean modifyShout(Shout.MutableShout shout)
          Modify the price and quantity of the given shout according to this strategy.
 java.lang.Object protoClone()
          TODO: need update to correctly clone all the configuration.
 boolean requiresAuctionHistory()
           
 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.trader.strategy.FixedQuantityStrategyImpl
determineQuantity, getQuantity, setQuantity
 
Methods inherited from class edu.cuny.cat.trader.strategy.AbstractStrategy
getAgent, initialize, modifyShout, reset, setAgent
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.cuny.obj.Resetable
reset
 
Methods inherited from interface edu.cuny.cat.trader.strategy.Strategy
modifyShout, setAgent
 

Field Detail

P_DEF_BASE

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

P_MAXPRICE

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

P_HISTORY

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

DEFAULT_MAX_PRICE

public static double DEFAULT_MAX_PRICE

MIN_INTERPOLATION_POINTS

public static int MIN_INTERPOLATION_POINTS
the minimum number of points to interpolate between two prices unless the two prices are too close to do so

See Also:
AbstractStrategy.MIN_PRICE_DIFFERENCE

maxPrice

protected double maxPrice

maxPoint

protected double maxPoint

max

protected double max

maxProb

protected double maxProb

historicalReport

protected HistoricalReport historicalReport
Constructor Detail

GDStrategy

public GDStrategy()
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 FixedQuantityStrategyImpl

getHistoricalReport

public HistoricalReport getHistoricalReport()

protoClone

public java.lang.Object protoClone()
TODO: need update to correctly clone all the configuration.

Specified by:
protoClone in interface edu.cuny.obj.Prototypeable
Overrides:
protoClone in class AbstractStrategy

eventOccurred

public void eventOccurred(AuctionEvent event)
Specified by:
eventOccurred in interface AuctionEventListener
Overrides:
eventOccurred in class AbstractStrategy

requiresAuctionHistory

public boolean requiresAuctionHistory()
Specified by:
requiresAuctionHistory in interface Strategy
Overrides:
requiresAuctionHistory in class AbstractStrategy

modifyShout

public boolean modifyShout(Shout.MutableShout shout)
Description copied from class: AbstractStrategy
Modify the price and quantity of the given shout according to this strategy.

Overrides:
modifyShout in class FixedQuantityStrategyImpl
Returns:
false if no shout is to be placed at this time

calculateProbability

public double calculateProbability(double price)

getMax

protected void getMax(double a1,
                      double p1,
                      double a2,
                      double p2)

toString

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