net.sourceforge.jasa.agent.strategy
Class MarkupStrategyDecorator

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.MarkupStrategyDecorator
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, FixedQuantityStrategy, TradingStrategy, MarketEventListener

public class MarkupStrategyDecorator
extends FixedDirectionStrategy
implements java.io.Serializable

This strategy decorates a component strategy by bidding a fixed proportional markup over the price specified by the underlying component strategy.

 

Field Summary
protected  double markup
          The proportional markup on the sub strategy.
static java.lang.String P_MARKUP
           
static java.lang.String P_SUBSTRATEGY
           
protected  TradingStrategy subStrategy
          The component strategy to decorate.
 
Fields inherited from class net.sourceforge.jasa.agent.strategy.AbstractTradingStrategy
auction, tradeDirectionPolicy
 
Constructor Summary
MarkupStrategyDecorator()
           
 
Method Summary
 void eventOccurred(MarketEvent event)
           
 boolean modifyShout(Order shout)
           
 void onRoundClosed(Market auction)
           
 java.lang.Object protoClone()
           
 void setAgent(AbstractTradingAgent agent)
           
 void subscribeToEvents(EventScheduler scheduler)
           
 
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, setTradeDirectionPolicy
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.jasa.agent.TradingStrategy
initialise, isBuy, modifyOrder
 

Field Detail

subStrategy

protected TradingStrategy subStrategy
The component strategy to decorate.


markup

protected double markup
The proportional markup on the sub strategy.


P_SUBSTRATEGY

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

P_MARKUP

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

MarkupStrategyDecorator

public MarkupStrategyDecorator()
Method Detail

modifyShout

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

onRoundClosed

public void onRoundClosed(Market auction)

subscribeToEvents

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

eventOccurred

public void eventOccurred(MarketEvent event)

setAgent

public void setAgent(AbstractTradingAgent agent)
Specified by:
setAgent in interface TradingStrategy
Overrides:
setAgent in class AbstractTradingStrategy

protoClone

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