com.oanda.fxtrade.api
Interface Position


public interface Position

A Position represents an aggregation of several open market orders

Author:
Chris MacGregor

Method Summary
 FXPair getPair()
          Gets the pair of this position's open market orders.
 double getPrice()
          Gets the average price of open market orders, weighted by size.
 long getUnits()
          Gets the number of units in all open market orders
 double getUnrealizedPL(FXTick currPrice)
          Calculate the current profit of this position, based on the number of units and average price
 java.lang.String toString()
          Overridden Object.toString method
 

Method Detail

getPrice

double getPrice()
Gets the average price of open market orders, weighted by size.

Returns:
Average price

getUnits

long getUnits()
Gets the number of units in all open market orders

Returns:
Number of units

getPair

FXPair getPair()
Gets the pair of this position's open market orders.

Returns:
The pair of this position

getUnrealizedPL

double getUnrealizedPL(FXTick currPrice)
Calculate the current profit of this position, based on the number of units and average price

Parameters:
currPrice - An FXTick representing the current rate of this market's pair
Returns:
The aggregate profit of this position's open market orders (reported in quote currency)

toString

java.lang.String toString()
Overridden Object.toString method

Overrides:
toString in class java.lang.Object


Copyright © 2005 OANDA Corporation. All Rights Reserved.