Package com.jquestrade
Class Position
java.lang.Object
com.jquestrade.Position
Represents a position in your Questrade account.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the average price paid for all executions constituting the position.double
Return The realized profit/loss on this position.int
Returns the portion of the position that was closed today.double
Returns the current market value of the position (quantity x price).double
Returns the current price of the position symbol.double
Returns the profit-and-loss on this position for today.double
Return the total unrealized profit/loss on this position.int
Returns the position quantity remaining open.Returns the symbol of the position.int
Returns the internal symbol identifier.double
Returns the total cost of the position.boolean
Returns whether or not real-time quote was used to compute the profit-and-losses.boolean
Whether or not the symbol is currently undergoing a reorg.
-
Constructor Details
-
Position
public Position()
-
-
Method Details
-
getSymbol
Returns the symbol of the position.- Returns:
- The symbol.
-
getSymbolId
public int getSymbolId()Returns the internal symbol identifier.- Returns:
- The internal symbol identifier.
-
getOpenQuantity
public int getOpenQuantity()Returns the position quantity remaining open.- Returns:
- The position quantity that is remaining open.
-
getClosedQuantity
public int getClosedQuantity()Returns the portion of the position that was closed today.- Returns:
- The portion of the position that was closed today.
-
getCurrentMarketValue
public double getCurrentMarketValue()Returns the current market value of the position (quantity x price).- Returns:
- The current market value of the position.
-
getCurrentPrice
public double getCurrentPrice()Returns the current price of the position symbol.- Returns:
- The current price of the position symbol.
-
getAverageEntryPrice
public double getAverageEntryPrice()Returns the average price paid for all executions constituting the position.- Returns:
- The average price for this position.
-
getDayPnl
public double getDayPnl()Returns the profit-and-loss on this position for today.- Returns:
- the profit-and-loss for today.
-
getClosedPnl
public double getClosedPnl()Return The realized profit/loss on this position.- Returns:
- The realized profit/loss on this position.
-
getOpenPnl
public double getOpenPnl()Return the total unrealized profit/loss on this position.- Returns:
- The total unrealized profit/loss on this position.
-
getTotalCost
public double getTotalCost()Returns the total cost of the position.- Returns:
- The total cost of the position.
-
isRealTime
public boolean isRealTime()Returns whether or not real-time quote was used to compute the profit-and-losses.- Returns:
- Whether real-time quote was used to compute the profit-and-losses.
-
isUnderReorg
public boolean isUnderReorg()Whether or not the symbol is currently undergoing a reorg.- Returns:
- Whether the symbol is currently undergoing a reorg.
-