net.sourceforge.jasa.agent.strategy
Class FixedTradeDirectionPolicy

java.lang.Object
  extended by net.sourceforge.jasa.agent.strategy.FixedTradeDirectionPolicy
All Implemented Interfaces:
TradeDirectionPolicy

public class FixedTradeDirectionPolicy
extends java.lang.Object
implements TradeDirectionPolicy

A trade direction policy which specifies a configurable fixed position to take in the market.

 

Field Summary
protected  boolean isBuy
           
 
Constructor Summary
FixedTradeDirectionPolicy()
           
 
Method Summary
 boolean isBuy()
           
 boolean isBuy(Market market, TradingAgent agent)
          Decide whether to go long long (buy) or short (sell).
 void setBuy(boolean isBuy)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isBuy

protected boolean isBuy
Constructor Detail

FixedTradeDirectionPolicy

public FixedTradeDirectionPolicy()
Method Detail

isBuy

public boolean isBuy(Market market,
                     TradingAgent agent)
Description copied from interface: TradeDirectionPolicy
Decide whether to go long long (buy) or short (sell).

Specified by:
isBuy in interface TradeDirectionPolicy
Parameters:
market - The market in which to make a trading decision
Returns:
true for a long position or false for a short position

isBuy

public boolean isBuy()

setBuy

public void setBuy(boolean isBuy)