The JAVA SDK is deprecated

  • The OANDA v1 REST API will cease to function for your account as early as May 2018.
  • Please migrate your applications to use the v20 REST API. A Java wrapper is available in the sample code section.

Position Endpoints

com.oanda.fxtrade.api

Interface Position

public interface Position

A Position represents an aggregation of several open market orders.

getPair

Gets the pair of this position’s open market orders.

FXPair getPair()

getUnrealizedPL

Calculate the current profit of this position, based on the number of units and average price. The aggregate profit of this position’s open market orders (reported in quote currency)

Parameters

currPrice: An FXTick representing the current rate of this market’s pair

double getUnrealizedPL(FXTick currPrice)

Find more information about Position here