edu.cuny.cat.trader.strategy
Class GDStrategy
java.lang.Object
  
java.util.Observable
      
edu.cuny.cat.trader.strategy.AbstractStrategy
          
edu.cuny.cat.trader.strategy.FixedQuantityStrategyImpl
              
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:
 
 - Shouts in JCAT are persistent and do not expire until the end of a
 trading day, nor can it be withdrawn. In certain scenarios, a GD may generate
 a price which is less competitive than that of its existing shout and gets
 rejected in a market requiring shout improvement. If no any other shouts or
 transactions are made in the market, this GD trader may fail to sweeten its
 offer although it still has a huge profit margin, which lowers the efficiency
 of the market. To avoid this situation, the price of the stand shout will be
 used to replace the latest calculated price. Shouting at the same price
 repeatedly will graduately lower the probability that GD expects the shout to
 be matched and eventually lead to crossing shouts and transactions.
 
 - The original implementation of GD, from JASA, interpolates between two
 prices by 1 price unit, which may be too big. A smaller interpolation
 distance, down to 
AbstractStrategy.MIN_PRICE_DIFFERENCE is
 automatically used when the two end points are close. 
 - JASA clears the record of matched shouts after each trading round. It is
 unclear why JASA does it. Doing this in JCAT lowers the efficiency of market
 as expected.
 
 
 
 
 
 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
 
 
- Version:
 
  - $Revision: 1.30 $
 
- Author:
 
  - Jinzhong Niu
 
- See Also:
 HistoricalReport, 
Serialized Form
 
 
 
 
 
 
 
| 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 | 
 
 
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
GDStrategy
public GDStrategy()
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