public interface Instrument
Modifier and Type | Method and Description |
---|---|
double |
calcCommission(int qty)
Calculates the commission to trade the given quantity of shares/contracts.
|
double |
calcPnL(double rawMove,
int qty)
Calculates the profit or loss for the given quantity and the raw price movement.
|
java.lang.String |
format(double value)
Formats the given value as a string.
|
java.lang.String |
format(float value)
Formats the given value as a string.
|
float |
getAskPrice()
Gets the current ask price for this instrument.
|
int |
getAskSize()
Gets the current ask size for this instrument.
|
float |
getBidPrice()
Gets the current bid price for this instrument.
|
int |
getBidSize()
Gets the current bid size for this instrument.
|
Enums.Service |
getBroker()
Gets the broker service (order fulfillment).
|
float |
getBuyPrice()
Gets the current price to buy this instrument.
|
float |
getChange()
Gets the change since the previous close for this instrument.
|
Enums.Service |
getDataSource()
Gets the data source for this instrument.
|
int |
getDefaultQuantity()
Gets the default order quantity for this instrument.
|
long |
getEndOfDay(long time,
boolean rth)
Gets the end of the day (in millis since 1970) for the given day.
|
long |
getEndOfMonth(long time,
boolean rth)
Gets the end of the month (in millis since 1970) for the given time.
|
long |
getEndOfWeek(long time,
boolean rth)
Gets the end of the week (in millis since 1970) for the given time.
|
java.lang.String |
getExchangeSymbol()
Gets the exchange symbol for this instrument.
|
float |
getHigh()
Gets the daily high price.
|
float |
getLastPrice()
Gets the last traded price for this instrument.
|
int |
getLastSize()
Gets the last traded size for this instrument.
|
long |
getLastTimestamp()
Gets the time of the last trade (in millis since 1970).
|
float |
getLow()
Gets the daily low price.
|
float |
getMidpoint()
Gets the midpoint between the bid and ask price rounded to the minimum tick of the instrument.
|
float |
getOpen()
Gets the daily open price.
|
double |
getPointSize()
Gets the size of a 'point'.
|
float |
getPreviousClose()
Gets the closing price for the previous day.
|
float |
getSellPrice()
Gets the current price to sell this instrument.
|
float |
getSpread()
Gets the difference between the bid and ask price for this instrument.
|
long |
getStartOfDay(long time,
boolean rth)
Gets the start of the day (in millis since 1970) for the given day.
|
long |
getStartOfMonth(long time,
boolean rth)
Gets the start of the month (in millis since 1970) for the given time.
|
long |
getStartOfWeek(long time,
boolean rth)
Gets the start of the week (in millis since 1970) for the given time.
|
java.lang.String |
getSymbol()
Gets the symbol for this instrument.
|
double |
getTickSize()
Gets the minimum tick size.
|
java.util.TimeZone |
getTimeZone()
Gets the time zone for the trading hours of this instrument.
|
Enums.InstrumentType |
getType()
Gets the type of this instrument.
|
java.lang.String |
getUnderlying()
Gets the underlying symbol for this instrument.
|
double |
round(double value)
Rounds the given value to the minimum tick size.
|
float |
round(float value)
Rounds the given value to the minimum tick size.
|
java.lang.String getUnderlying()
java.lang.String getSymbol()
java.lang.String getExchangeSymbol()
Enums.InstrumentType getType()
Enums.Service getBroker()
Enums.Service getDataSource()
float round(float value)
value
- value to rounddouble round(double value)
value
- value to roundjava.lang.String format(float value)
value
- value to formatjava.lang.String format(double value)
value
- value to formatint getDefaultQuantity()
double getPointSize()
double getTickSize()
double calcPnL(double rawMove, int qty)
rawMove
- raw price movementqty
- number of traded units (negative for short)double calcCommission(int qty)
qty
- quantity (ie shares, contracts, dollars etc)float getLastPrice()
float getBidPrice()
float getAskPrice()
float getMidpoint()
float getBuyPrice()
float getSellPrice()
float getChange()
int getLastSize()
int getAskSize()
int getBidSize()
float getSpread()
float getHigh()
float getLow()
float getOpen()
float getPreviousClose()
long getLastTimestamp()
long getStartOfDay(long time, boolean rth)
time
- - specifies the day in millisrth
- - Specifies if regular or extended trading hours should be used.long getEndOfDay(long time, boolean rth)
time
- - specifies the day in millisrth
- - Specifies if regular or extended trading hours should be used.long getStartOfWeek(long time, boolean rth)
time
- - specifies the day in millisrth
- - Specifies if regular or extended trading hours should be used.long getEndOfWeek(long time, boolean rth)
time
- - specifies the day in millisrth
- - Specifies if regular or extended trading hours should be used.long getStartOfMonth(long time, boolean rth)
time
- - specifies the day in millisrth
- - Specifies if regular or extended trading hours should be used.long getEndOfMonth(long time, boolean rth)
time
- - specifies the day in millisrth
- - Specifies if regular or extended trading hours should be used.java.util.TimeZone getTimeZone()