uk.ac.liv.auction.agent
Class MomentumStrategy

java.lang.Object
  extended byuk.ac.liv.auction.agent.AbstractStrategy
      extended byuk.ac.liv.auction.agent.FixedQuantityStrategyImpl
          extended byuk.ac.liv.auction.agent.AdaptiveStrategyImpl
              extended byuk.ac.liv.auction.agent.MomentumStrategy
All Implemented Interfaces:
AdaptiveStrategy, AuctionEventListener, java.lang.Cloneable, FixedQuantityStrategy, Parameterizable, Prototypeable, Resetable, java.io.Serializable, Strategy
Direct Known Subclasses:
PriestVanTolStrategy, SimpleMomentumStrategy, ZIPStrategy

public abstract class MomentumStrategy
extends AdaptiveStrategyImpl
implements java.io.Serializable

Version:
$Revision: 1.13 $
Author:
Steve Phelps
See Also:
Serialized Form

Field Summary
protected  double currentPrice
           
protected  cern.jet.random.AbstractContinousDistribution initialMarginDistribution
           
protected  Shout lastShout
           
protected  boolean lastShoutAccepted
           
protected  MimicryLearner learner
           
static java.lang.String P_LEARNER
           
static java.lang.String P_SCALING
           
protected  cern.jet.random.AbstractContinousDistribution perterbationDistribution
           
protected  double scaling
          A parameter used to scale the randomly drawn price adjustment perturbation values.
protected  double trAskPrice
           
protected  double trBidPrice
           
protected  double trPrice
           
 
Fields inherited from class uk.ac.liv.auction.agent.AbstractStrategy
agent, auction, currentShout
 
Constructor Summary
MomentumStrategy()
           
MomentumStrategy(AbstractTradingAgent agent)
           
 
Method Summary
protected abstract  void adjustMargin()
           
protected  void adjustMargin(double targetMargin)
           
protected  void agentPolled(AgentPolledEvent event)
           
protected  double calculatePrice(double margin)
           
 void endOfRound(Auction auction)
           
 void eventOccurred(AuctionEvent event)
           
 double getCurrentPrice()
           
 Shout getLastShout()
           
 Learner getLearner()
           
 double getScaling()
           
 double getTrAskPrice()
           
 double getTrBidPrice()
           
 double getTrPrice()
           
 void initialise()
           
 boolean isLastShoutAccepted()
           
 boolean modifyShout(Shout.MutableShout shout)
          Modify the price and quantity of the given shout according to this strategy.
protected  double perterb(double price)
           
 void setLearner(Learner learner)
           
 void setMargin(double margin)
           
 void setup(ec.util.ParameterDatabase parameters, ec.util.Parameter base)
          Initialise this object from a parameter database.
protected  void shoutPlaced(ShoutPlacedEvent event)
           
protected  double targetMargin(double targetPrice)
           
protected  void transactionExecuted(TransactionExecutedEvent event)
           
 
Methods inherited from class uk.ac.liv.auction.agent.FixedQuantityStrategyImpl
determineQuantity, getQuantity, setQuantity
 
Methods inherited from class uk.ac.liv.auction.agent.AbstractStrategy
getAgent, modifyShout, protoClone, reset, setAgent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.ac.liv.auction.agent.Strategy
determineQuantity, modifyShout, setAgent
 
Methods inherited from interface uk.ac.liv.util.Prototypeable
protoClone
 
Methods inherited from interface uk.ac.liv.util.Resetable
reset
 

Field Detail

learner

protected MimicryLearner learner

currentPrice

protected double currentPrice

lastShout

protected Shout lastShout

scaling

protected double scaling
A parameter used to scale the randomly drawn price adjustment perturbation values.


lastShoutAccepted

protected boolean lastShoutAccepted

trPrice

protected double trPrice

trBidPrice

protected double trBidPrice

trAskPrice

protected double trAskPrice

initialMarginDistribution

protected cern.jet.random.AbstractContinousDistribution initialMarginDistribution

perterbationDistribution

protected cern.jet.random.AbstractContinousDistribution perterbationDistribution

P_SCALING

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

P_LEARNER

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

MomentumStrategy

public MomentumStrategy(AbstractTradingAgent agent)

MomentumStrategy

public MomentumStrategy()
Method Detail

setup

public void setup(ec.util.ParameterDatabase parameters,
                  ec.util.Parameter base)
Description copied from interface: Parameterizable
Initialise this object from a parameter database.

Specified by:
setup in interface Parameterizable
Overrides:
setup in class FixedQuantityStrategyImpl

initialise

public void initialise()
Overrides:
initialise 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

eventOccurred

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

agentPolled

protected void agentPolled(AgentPolledEvent event)

shoutPlaced

protected void shoutPlaced(ShoutPlacedEvent event)

transactionExecuted

protected void transactionExecuted(TransactionExecutedEvent event)

endOfRound

public void endOfRound(Auction auction)
Overrides:
endOfRound in class AdaptiveStrategyImpl

setLearner

public void setLearner(Learner learner)
Specified by:
setLearner in interface AdaptiveStrategy

getLearner

public Learner getLearner()
Specified by:
getLearner in interface AdaptiveStrategy

setMargin

public void setMargin(double margin)

getCurrentPrice

public double getCurrentPrice()

getLastShout

public Shout getLastShout()

isLastShoutAccepted

public boolean isLastShoutAccepted()

getScaling

public double getScaling()

getTrAskPrice

public double getTrAskPrice()

getTrBidPrice

public double getTrBidPrice()

getTrPrice

public double getTrPrice()

calculatePrice

protected double calculatePrice(double margin)

targetMargin

protected double targetMargin(double targetPrice)

adjustMargin

protected void adjustMargin(double targetMargin)

perterb

protected double perterb(double price)

adjustMargin

protected abstract void adjustMargin()