|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSwarmObjectImpl
Book
This is the book. The book works on the basis of two arrayList containing sell order in increasing order or buy order in decreasing order. The orders are arrays which have in the first position the price, in the second the number of agent who places the order and in the third the quantity. If an order obtains an immediate matching, it is not filed
Field Summary | |
java.util.ArrayList |
buyOrderStorehouse
|
int |
count
The number of share negotiated |
double |
currentMeanPrice
The addition of prices*quantity to calculate the mean price. |
double |
executedPrice
The price of the last contract closing. |
ListIndex |
indexAgentListIndex
The index used for send message to agents. |
double[] |
localHistory
The vector containing the local price history. |
int |
localHistoryLength
The length of the local price history. |
double |
meanPrice
The mean price of yesterday. |
double[] |
meanPriceHistory
The vector containing the history of mean prices. |
int |
meanPriceHistoryLength
The length of the mean price history. |
int |
orderNumber
The number of orders received from agents. |
double |
previousClosingPrice
The closing price of yesterday. |
int |
printing
If 1 many objects print data on the terminal window. |
java.util.ArrayList |
sellOrderStorehouse
|
int |
sharesInBuySide
The number of shares in buy side of book. |
int |
sharesInBuySideBeforeOpening
The number of shares in buy side of book before opening. |
int |
sharesInSellSide
The number of shares in sell side of book. |
int |
sharesInSellSideBeforeOpening
The number of shares in sell side of book before opening. |
Constructor Summary | |
Book(Zone aZone)
Constructor for a new book. |
Method Summary | |
double |
extract(java.util.ArrayList nameList,
int indexOrder,
int positionDatum)
To extract data from the orders received from agents. |
int |
fillStorehouseDecreasingP(double newPrice)
To fill buyOrderStorehouse in descreasing order. |
int |
fillStorehouseIncreasingP(double newPrice)
To fill sellOrderStorehouse in increasing order |
double |
getBuyFirstLastSpread()
To get the spread between the first and the last price in the buy side. |
int |
getBuySellQuantitySpread()
To get the spread between quantities in sell and buy side. |
double |
getLaggedMeanPrice(int lag)
to get the lagged Mean Price. |
int |
getLocal(double[] vect)
This is the getLocal method, that counts for the difference between the buying and selling orders sent by the agents. |
int |
getLocalHistory()
to get the local History. |
double |
getMeanPrice()
To get the mean price of yesterday. |
double |
getPreviousClosingPrice()
To get the closing price of yesterday. |
double |
getPrice()
To get the last executed price. |
double |
getSellFirstLastSpread()
To get the spread between the first and the last price in the sell side. |
int |
getSharesInBuySide()
To get the number of shares filled in the buy side of book. |
int |
getSharesInBuySideBeforeOpening()
To get the number of shares in buy side before opening. |
int |
getSharesInSellSide()
To get the number of shares filled in the sell side of book. |
int |
getSharesInSellSideBeforeOpening()
To get the number of shares in sell side before opening. |
double |
getSpread()
To get the spread between first bid and first ask price. |
private void |
message(double n,
double p,
double q)
To inform the agent of executed price. |
void |
setAgentListIndex(ListIndex i)
To know the adress of memory of the agent. |
void |
setClean()
At the beginning of each day to clean the book. |
void |
setLocal(double[] vect,
double p)
This is the SetLocal method, used to shift the rows of the localHistory vector. |
void |
setMeanPrice()
At the end of each day to calculate the mean price. |
void |
setOrderBeforeOpeningFromAgent(double[] orderFromAgent)
Receiving an order before opening from an agent. |
void |
setOrderFromAgent(double[] orderFromAgent)
Receiving an order when the market is open. |
void |
setPrinting(int p)
To set the value of option printing. |
double[] |
standardizedOrder(double[] orderFromAgent)
To standardize the order. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public ListIndex indexAgentListIndex
public int printing
public int orderNumber
public int count
public int sharesInBuySide
public int sharesInSellSide
public int sharesInBuySideBeforeOpening
public int sharesInSellSideBeforeOpening
public double executedPrice
public double meanPrice
public double previousClosingPrice
public double currentMeanPrice
public java.util.ArrayList buyOrderStorehouse
public java.util.ArrayList sellOrderStorehouse
public int meanPriceHistoryLength
public int localHistoryLength
public double[] meanPriceHistory
public double[] localHistory
Constructor Detail |
public Book(Zone aZone)
Method Detail |
private void message(double n, double p, double q)
BasicSumAgent
public double[] standardizedOrder(double[] orderFromAgent)
public double extract(java.util.ArrayList nameList, int indexOrder, int positionDatum)
public int fillStorehouseIncreasingP(double newPrice)
public int fillStorehouseDecreasingP(double newPrice)
public void setLocal(double[] vect, double p)
public int getLocal(double[] vect)
public void setAgentListIndex(ListIndex i)
public void setPrinting(int p)
public void setMeanPrice()
public void setClean()
public void setOrderBeforeOpeningFromAgent(double[] orderFromAgent)
public void setOrderFromAgent(double[] orderFromAgent)
public double getPrice()
public double getMeanPrice()
public double getLaggedMeanPrice(int lag)
public int getLocalHistory()
public int getSharesInSellSide()
public int getSharesInBuySide()
public double getPreviousClosingPrice()
public double getSellFirstLastSpread()
public double getBuyFirstLastSpread()
public double getSpread()
public int getBuySellQuantitySpread()
public int getSharesInSellSideBeforeOpening()
public int getSharesInBuySideBeforeOpening()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |