net.sourceforge.jasa.agent.strategy
Class KaplanStrategy

java.lang.Object
  extended by AbstractStrategy
      extended by net.sourceforge.jasa.agent.strategy.AbstractTradingStrategy
          extended by net.sourceforge.jasa.agent.strategy.FixedQuantityStrategyImpl
              extended by net.sourceforge.jasa.agent.strategy.FixedDirectionStrategy
                  extended by net.sourceforge.jasa.agent.strategy.KaplanStrategy
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, FixedQuantityStrategy, TradingStrategy, MarketEventListener

public class KaplanStrategy
extends FixedDirectionStrategy
implements java.io.Serializable

An implementation of Todd Kaplan's sniping strategy. Agents using this strategy wait until the last minute before attempting to "steal the bid". See

"Behaviour of trading automata in a computerized double market market" J. Rust, J. Miller and R. Palmer in "The Double Auction Market: Institutions, Theories and Evidence" 1992, Addison-Wesley

Note that you must configure a report of type DailyStatsMarketDataLogger in order to use this strategy.

Parameters

base.s
double >= 0
(the spread factor)
base.t
double >= 0
(the time factor)

See Also:
DailyStatsReport
 

Field Summary
protected  DailyStatsReport dailyStatsReport
           
static java.lang.String P_DEF_BASE
           
static java.lang.String P_S
           
static java.lang.String P_T
           
protected  MarketQuote quote
           
protected  double s
          The spread factor.
protected  int t
          The time factor.
 
Fields inherited from class net.sourceforge.jasa.agent.strategy.AbstractTradingStrategy
auction, tradeDirectionPolicy
 
Constructor Summary
KaplanStrategy()
           
 
Method Summary
protected  void error(DataUnavailableException e)
           
 void eventOccurred(SimEvent event)
           
 DailyStatsReport getDailyStatsReport()
           
 double getS()
           
 double getT()
           
 boolean juicyOffer()
           
 boolean modifyShout(Order shout)
           
 void onMarketOpen(MarketOpenEvent event)
           
 void onRoundClosed(Market auction)
           
 java.lang.Object protoClone()
           
 void setDailyStatsReport(DailyStatsReport dailyStatsReport)
           
 void setS(double s)
           
 void setT(int t)
           
 boolean smallSpread()
           
 void subscribeToEvents(EventScheduler scheduler)
           
 boolean timeRunningOut()
           
 java.lang.String toString()
           
 
Methods inherited from class net.sourceforge.jasa.agent.strategy.FixedDirectionStrategy
isBuy, isSell, setBuy
 
Methods inherited from class net.sourceforge.jasa.agent.strategy.FixedQuantityStrategyImpl
determineQuantity, getQuantity, setQuantity
 
Methods inherited from class net.sourceforge.jasa.agent.strategy.AbstractTradingStrategy
clone, getAgent, getTradeDirectionPolicy, initialise, isBuy, modifyOrder, reset, setAgent, setTradeDirectionPolicy
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.jasa.agent.TradingStrategy
initialise, isBuy, modifyOrder, setAgent
 

Field Detail

t

protected int t
The time factor. Kaplan will bid if the remaining time in the current period is less than t.


s

protected double s
The spread factor.


quote

protected MarketQuote quote

dailyStatsReport

protected DailyStatsReport dailyStatsReport

P_DEF_BASE

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

P_T

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

P_S

public static final java.lang.String P_S
See Also:
Constant Field Values
Constructor Detail

KaplanStrategy

public KaplanStrategy()
Method Detail

protoClone

public java.lang.Object protoClone()
Overrides:
protoClone in class AbstractTradingStrategy

subscribeToEvents

public void subscribeToEvents(EventScheduler scheduler)
Specified by:
subscribeToEvents in interface TradingStrategy

eventOccurred

public void eventOccurred(SimEvent event)

onMarketOpen

public void onMarketOpen(MarketOpenEvent event)

modifyShout

public boolean modifyShout(Order shout)
Overrides:
modifyShout in class FixedDirectionStrategy

onRoundClosed

public void onRoundClosed(Market auction)

juicyOffer

public boolean juicyOffer()

smallSpread

public boolean smallSpread()

timeRunningOut

public boolean timeRunningOut()

getS

public double getS()

setS

public void setS(double s)

getT

public double getT()

setT

public void setT(int t)

toString

public java.lang.String toString()

error

protected void error(DataUnavailableException e)

getDailyStatsReport

public DailyStatsReport getDailyStatsReport()

setDailyStatsReport

public void setDailyStatsReport(DailyStatsReport dailyStatsReport)