|
||||||||||
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
The arrayList which contains the buy orders. |
java.util.ArrayList |
buyOrderWithAuctionPriceStorehouse
The arrayList which contains the buy orders with auction price. |
java.util.ArrayList |
closingContractLog
The arrayList to log the closing contracts. |
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. |
int |
instantNumber
The total number of instant. |
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 |
nOfBuyOrderWithAuctionPrice
The number of buy order with auction price. |
int |
nOfBuySharesWithAuctionPrice
The number ofshares with auction price in buy side. |
int |
nOfSellOrderWithAuctionPrice
The number of sell order with auction price. |
int |
nOfSellSharesWithAuctionPrice
The number ofshares with auction price in sell side. |
int |
numberOfInstant
The number of actual instant. |
double |
openingPrice
The opening price. |
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. |
double |
referencePrice
The reference price of each days. |
java.util.ArrayList |
sellOrderStorehouse
The arrayList which contains the sell orders. |
java.util.ArrayList |
sellOrderWithAuctionPriceStorehouse
The arrayList which contains the sell orders with auction price. |
int |
sharesInBuySide
The number of shares in buy side of book. |
int |
sharesInBuySideInOpeningOrClosingAuctions
The number of shares in buy side of book in opening or closing Auctions. |
int |
sharesInSellSide
The number of shares in sell side of book. |
int |
sharesInSellSideInOpeningOrClosingAuctions
The number of shares in sell side of book in opening or closing Auctions. |
java.util.ArrayList |
tableForTheoreticalPrice
The arrayList as a table to evaluete the teoric price. |
double |
theoreticalPrice
The theoretical price. |
Constructor Summary | |
Book(Zone aZone)
Constructor for a new book. |
Method Summary | |
private double |
extract(java.util.ArrayList nameList,
int indexOrder,
int positionDatum)
To extract data from the orders received from agents. |
private int |
fillStorehouseDecreasingP(double newPrice)
To fill buyOrderStorehouse in descreasing order. |
private 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 |
getSharesInBuySideInOpeningOrClosingAuctions()
To get the number of shares in buy side in opening or closing Auctions. |
int |
getSharesInSellSide()
To get the number of shares filled in the sell side of book. |
int |
getSharesInSellSideInOpeningOrClosingAuctions()
To get the number of shares in sell side in opening or closing Auctions. |
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 |
opening()
To conclude contracts (if opening price > 0) or to fill the order with auction price. |
void |
recreateTableForTheoreticalPrice()
|
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 |
setInstantNumber(int n)
To set the value of total number of instant |
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 |
setNumberOfInstant()
To set the value of actual instant |
void |
setOpeningPrice()
To set the opening price. |
void |
setOrderFromAgent(double[] orderFromAgent)
Receiving an order when the market is open. |
void |
setOrderInOpeningOrClosingAuctionsFromAgent(double[] orderFromAgent)
Receiving an order in opening or closing Auctions from an agent. |
void |
setPrinting(int p)
To set the value of option printing. |
void |
setRefencePrice()
At the end of each day to calculate the reference price. |
private double[] |
setRows(double[] order)
To set rows in tableForTheoreticalPrice. |
private void |
setTableForTheoreticalPrice(double[] order)
To set the prices in decreasing order for evaluete the theoretical price. |
void |
setTheoreticalPrice()
To set the theoretical price. |
private 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 instantNumber
public int numberOfInstant
public int orderNumber
public int count
public int sharesInBuySide
public int sharesInSellSide
public int sharesInBuySideInOpeningOrClosingAuctions
public int sharesInSellSideInOpeningOrClosingAuctions
public double executedPrice
public double meanPrice
public double previousClosingPrice
public double currentMeanPrice
public java.util.ArrayList buyOrderStorehouse
public java.util.ArrayList sellOrderStorehouse
public java.util.ArrayList closingContractLog
public java.util.ArrayList tableForTheoreticalPrice
public java.util.ArrayList buyOrderWithAuctionPriceStorehouse
public java.util.ArrayList sellOrderWithAuctionPriceStorehouse
public double referencePrice
public double theoreticalPrice
public double openingPrice
public int nOfBuyOrderWithAuctionPrice
public int nOfSellOrderWithAuctionPrice
public int nOfBuySharesWithAuctionPrice
public int nOfSellSharesWithAuctionPrice
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
private double[] standardizedOrder(double[] orderFromAgent)
private double extract(java.util.ArrayList nameList, int indexOrder, int positionDatum)
private int fillStorehouseIncreasingP(double newPrice)
private int fillStorehouseDecreasingP(double newPrice)
public void setLocal(double[] vect, double p)
public int getLocal(double[] vect)
public void setPrinting(int p)
public void setInstantNumber(int n)
public void setAgentListIndex(ListIndex i)
public void setNumberOfInstant()
public void setMeanPrice()
public void setRefencePrice()
public void setClean()
private double[] setRows(double[] order)
private void setTableForTheoreticalPrice(double[] order)
public void setTheoreticalPrice()
public void setOpeningPrice()
public void opening()
public void recreateTableForTheoreticalPrice()
public void setOrderInOpeningOrClosingAuctionsFromAgent(double[] orderFromAgent)
public void setOrderFromAgent(double[] orderFromAgent)
public double getPrice()
public double getMeanPrice()
public int getSharesInSellSide()
public int getSharesInBuySide()
public double getPreviousClosingPrice()
public double getSellFirstLastSpread()
public double getBuyFirstLastSpread()
public double getSpread()
public int getBuySellQuantitySpread()
public int getSharesInSellSideInOpeningOrClosingAuctions()
public int getSharesInBuySideInOpeningOrClosingAuctions()
public double getLaggedMeanPrice(int lag)
public int getLocalHistory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |