|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Transaction
The Transaction object contains all information related to transactions occurring on OANDA's servers.
A transaction can be fully described by the a combination of its type and its completion code. For example, a type of CloseTradeB is specifically a Stop Loss if the completion code is 102 where is it is a Take profit of the completion code is 103. The following table is a complete list of transactions.
# | Description | Transaction Type | Completion Code |
---|---|---|---|
1 | Fund Deposit | AddFunds | 109 |
2 | API Fee | APIFee | 109 |
3 | API License Fee | APILic | 109 |
4 | Buy Order | BuyEntry | 100 |
5 | Buy Market | BuyMarket | 100 |
6 | Buy Market Filled | BuyMarket | 105 |
7 | Change Margin | ChangeMargin | 100 |
8 | Change Order | ChangeOrder | 100 |
9 | Change Trade | ChangeTrade | 100 |
10 | Order Cancelled | CloseOrder | 100 |
11 | Order Expired | CloseOrder | 101 |
12 | Order Filled | CloseOrder | 105 |
13 | Order Cancelled (NSF) | CloseOrder | 108 |
14 | Order Cancelled (BV) | CloseOrder | 118 |
15 | Order Cancelled (BV:SL) | CloseOrder | 714 |
16 | Order Cancelled (BV:TP) | CloseOrder | 715 |
17 | Close Position | ClosePositionB | 100 |
18 | Close Position | ClosePositionS | 100 |
19 | Close Trade | CloseTradeB | 100 |
20 | Stop Loss | CloseTradeB | 102 |
21 | Take Profit | CloseTradeB | 103 |
22 | Margin Call | CloseTradeB | 104 |
23 | Close Trade | CloseTradeS | 100 |
24 | Stop Loss | CloseTradeS | 102 |
25 | Take Profit | CloseTradeS | 103 |
26 | Margin Call | CloseTradeS | 104 |
27 | Fund Credit | CrFunds | 109 |
28 | Fund Withdrawal | DelFunds | 109 |
29 | Wire Fee | Fee | 109 |
30 | Interest | Interest | 107 |
31 | P&L Reset | ResetPL | 100 |
32 | Sell Order | SellEntry | 100 |
33 | Sell Market | SellMarket | 100 |
34 | Sell Market Filled | SellMarket | 105 |
35 | Buy Box | BuyBox | 400 |
36 | Sell Box | SellBox | 400 |
37 | Box Payout | BoxPayout | 402 |
38 | Box Close | BoxClose | 403 |
39 | RevBoxPayout | RevBoxPayout | 404 |
40 | Box Cancel | BoxCancel | 406 |
41 | Balance Correction | CSCorrection | -110 |
42 | Interest Correction | CSCorrection | -111 |
43 | P/L Correction | CSCorrection | -113 |
44 | Trade Cancel | CSCorrection | -117 |
45 | Trade Correction | BuyMarket | 114 |
46 | Trade Correction | SellMarket | 114 |
47 | Buy Market (Cancelled) | BuyMarket | -100 |
48 | Sell Market (Cancelled) | SellMarket | -100 |
49 | Close Trade (Cancelled) | CloseTradeB | -100 |
50 | Change Trade (Cancelled) | ChangeTrade | -100 |
51 | Close Position (Cancelled) | ClosePositionB | -100 |
52 | Close Position (Cancelled) | ClosePositionS | -100 |
53 | Close Trade (Cancelled) | CloseTradeS | -100 |
54 | Stop Loss (Cancelled) | CloseTradeB | -102 |
55 | Stop Loss (Cancelled) | CloseTradeS | -102 |
56 | Take Profit (Cancelled) | CloseTradeS | -103 |
57 | Take Profit (Cancelled) | CloseTradeB | -103 |
58 | Buy Market Filled (Cancelled) | BuyMarket | -105 |
59 | Sell Market Filled (Cancelled) | SellMarket | -105 |
63 | Buy Market (NT) | BuyMarket | 119 |
64 | Sell Market (NT) | SellMarket | 119 |
NT means new trade.
BV means bounds violation.
Field Summary | |
---|---|
static int |
FX_CSBALACECORRECTION
|
static int |
FX_CSCLOSEWITHOUTPENALTY
|
static int |
FX_CSINTERESTCORRECTION
|
static int |
FX_CSINTERESTTODAYCORRECTION
|
static int |
FX_CSPLCORRECTION
|
static int |
FX_CSTRADECANCEL
|
static int |
FX_CSTRADECORRECTION
|
static int |
FX_DELFUNDS
|
static int |
FX_DURATION
|
static int |
FX_INTDEFERRED
|
static int |
FX_INTEREST
|
static int |
FX_MARGIN
|
static int |
FX_NSF
|
static int |
FX_ORDERCANCELBOUNDSVIOLATION
|
static int |
FX_ROLLOVER
|
static int |
FX_SL
|
static int |
FX_TP
|
static int |
FX_USER
|
static int |
FX_XFR_ORDER
|
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a exact copy of this Transaction. |
boolean |
equals(java.lang.Object other)
|
double |
getAmount()
Returns the transaction amount in terms of home currency |
double |
getBalance()
Returns the account balance at the time of the transaction |
int |
getCompletionCode()
Returns the completion code. |
long |
getDiaspora()
|
double |
getInterest()
Returns the interest paid or earned. |
double |
getMargin()
Returns the margin used by this transaction. |
long |
getOrderLink()
Returns the transaction number of the limit order that resulted in this transaction (i.e the MarketOrder). |
FXPair |
getPair()
Returns the currency pair |
double |
getPL()
Returns the P&L of the transaction. |
double |
getPrice()
Returns the execution price for this transaction |
double |
getStopLoss()
Returns the stop loss value associated with this transaction. |
double |
getTakeProfit()
Returns the take profit value associated with this transaction. |
long |
getTimestamp()
Return the unix timestamp for when this transaction occured |
double |
getTrailingStopLoss()
Returns the trailing stop value in PIPs |
long |
getTransactionLink()
Returns the transaction number of the transaction that is related to this transaction. |
long |
getTransactionNumber()
Returns the transaction number. |
java.lang.String |
getType()
Returns the transaction type. |
long |
getUnits()
Returns the number of units. |
boolean |
isBuy()
Tests if this transaction is a buy |
boolean |
isSell()
Tests if this transaction is a sell |
java.lang.String |
toString()
|
Field Detail |
---|
static final int FX_USER
static final int FX_DURATION
static final int FX_SL
static final int FX_TP
static final int FX_MARGIN
static final int FX_XFR_ORDER
static final int FX_ROLLOVER
static final int FX_INTEREST
static final int FX_NSF
static final int FX_DELFUNDS
static final int FX_CSBALACECORRECTION
static final int FX_CSINTERESTCORRECTION
static final int FX_CSINTERESTTODAYCORRECTION
static final int FX_CSPLCORRECTION
static final int FX_CSTRADECORRECTION
static final int FX_CSCLOSEWITHOUTPENALTY
static final int FX_INTDEFERRED
static final int FX_CSTRADECANCEL
static final int FX_ORDERCANCELBOUNDSVIOLATION
Method Detail |
---|
java.lang.Object clone()
boolean equals(java.lang.Object other)
equals
in class java.lang.Object
double getAmount()
double getBalance()
int getCompletionCode()
long getDiaspora()
double getInterest()
double getMargin()
FXPair getPair()
FXPair
double getPrice()
double getStopLoss()
double getTakeProfit()
long getTimestamp()
long getTransactionLink()
long getTransactionNumber()
java.lang.String getType()
The following is a list of the transaction types:
AddFunds APIFee APILic BoxCancel BoxClose BoxPayout BuyBox BuyEntry BuyMarket ChangeMargin ChangeOrder ChangeTrade CloseOrder ClosePositionB ClosePositionS CloseTradeB CloseTradeS CrFunds CSCorrection DelFunds Fee Interest ResetPL RevBoxPayout SellBox SellEntry SellMarket
Transaction
,
getCompletionCode()
long getUnits()
boolean isBuy()
boolean isSell()
double getTrailingStopLoss()
java.lang.String toString()
toString
in class java.lang.Object
double getPL()
long getOrderLink()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |