com.dukascopy.api
Interface IReportPosition


public interface IReportPosition

Provides information about report position


Nested Class Summary
static class IReportPosition.PositionType
          Indicates type of Position
 
Method Summary
 double getAmount()
          Returns amount of the position.
 double getClosePrice()
          Returns price at which position was closed or 0 if order or position part wasn't closed.
 long getCloseTime()
          Returns time when server closed the position
 Money getCommission()
          Returns commission expressed in account's currency
 double getCurrentPrice()
           
 Money getGrossProfitLoss()
          Returns Gross Profit/Loss (+ #getSwaps() expressed in position's instrument second currency (Instrument.getSecondaryCurrency())
 Instrument getInstrument()
           
 double getOpenPrice()
          Returns price at which position was filled
 long getOpenTime()
          Returns last time when server filled the position
 java.lang.String getPositionId()
           
 IReportPosition.PositionType getPositionType()
           
 Money getProfitLoss()
           
 Money getSwaps()
           
 boolean isClosed()
           
 boolean isLong()
           
 

Method Detail

getPositionType

IReportPosition.PositionType getPositionType()
Returns:
IReportPosition.PositionType

getPositionId

java.lang.String getPositionId()
Returns:
position's id

isLong

boolean isLong()
Returns:
true if position is LONG, false otherwise

getInstrument

Instrument getInstrument()
Returns:
position's Instrument

getAmount

double getAmount()
Returns amount of the position. For open positions (isClosed == false) returns amount requested. For filled positions will return filled amount (full or partial)

Returns:
amount of the position

getOpenPrice

double getOpenPrice()
Returns price at which position was filled

Returns:
open price for positions

getCurrentPrice

double getCurrentPrice()
Returns:
current volatile price for position's instrument.

getClosePrice

double getClosePrice()
Returns price at which position was closed or 0 if order or position part wasn't closed.

Returns:
close price for closed orders, return 0 for any other type of order

getProfitLoss

Money getProfitLoss()
Returns:
Profit/Loss expressed in position's instrument second currency (Instrument.getSecondaryCurrency())

getSwaps

Money getSwaps()
Returns:
Swap points

getGrossProfitLoss

Money getGrossProfitLoss()
Returns Gross Profit/Loss (+ #getSwaps() expressed in position's instrument second currency (Instrument.getSecondaryCurrency())

Returns:
Gross Profit/Loss

getCommission

Money getCommission()
Returns commission expressed in account's currency

Returns:

getOpenTime

long getOpenTime()
Returns last time when server filled the position

Returns:
last time when server filled the position

getCloseTime

long getCloseTime()
Returns time when server closed the position

Returns:
time when position was closed

isClosed

boolean isClosed()
Returns:
true when (getClosePrice() > 0 and getCloseTime() > 0), false otherwise