public class MarketOrderPolicy extends java.lang.Object implements OrderPolicy
Modifier and Type | Field and Description |
---|---|
protected boolean |
bestLimit |
static long |
DEFAULT_PRICE |
static int |
DEFAULT_QUANTITY |
protected long |
lastPrice |
protected int |
quantity |
Constructor and Description |
---|
MarketOrderPolicy()
Constructeur par defaut
|
MarketOrderPolicy(long defaultPrice,
int quantity,
boolean bestLimit)
Constructeur detaille
|
Modifier and Type | Method and Description |
---|---|
Order |
build(Signal.Direction direction,
OrderBook ob,
Agent a,
int orderId)
Construit un ordre Quantite constante Echanger a la meilleur limite si
bestLimit==true Echanger a tout prix si bestLimit==false
|
public static final long DEFAULT_PRICE
public static final int DEFAULT_QUANTITY
protected long lastPrice
protected int quantity
protected boolean bestLimit
public MarketOrderPolicy()
public MarketOrderPolicy(long defaultPrice, int quantity, boolean bestLimit)
defaultPrice
- prix par defautquantity
- quantite echangeebestLimit
- true=best limit order. false=market orderpublic Order build(Signal.Direction direction, OrderBook ob, Agent a, int orderId)
build
in interface OrderPolicy
direction
- direction de l'ordreob
- carnet d'ordre dans laquelle l'ordre doit etre envoyea
- emmetteur de l'ordreorderId
- identifiant de l'ordre pour l'agent