|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessenger.FXTradingMessenger
public class FXTradingMessenger
Contains methods to execute trades using the server.
Field Summary | |
---|---|
static char |
BUY
Integer used to specify the buy side of a trade. |
static int |
DEFAULT_PORT_1
|
static int |
DEFAULT_PORT_2
|
static java.lang.String |
DEFAULT_SESSION_ID_1
|
static java.lang.String |
DEFAULT_SESSION_ID_2
|
protected quickfix.Initiator |
initiator
|
static char |
SELL
Integer used to specify the sell side of a trade. |
protected quickfix.SessionID |
sessionID
|
Constructor Summary | |
---|---|
FXTradingMessenger(FXTradingListener listener)
Constructor which configures the messager for connecting to the server. |
|
FXTradingMessenger(FXTradingListener listener,
java.lang.String serverID,
int portNumber)
Constructor which configures the messager specifying session ID and port number. |
Method Summary | |
---|---|
protected void |
checkCurrencyPair(java.lang.String currencyPair)
|
protected static void |
checkForNull(java.lang.Object o)
|
void |
connect()
Start accepting connections. |
void |
disconnect()
Stops all sessions, optionally waiting for logout completion. |
void |
executeTrade(java.lang.String username,
java.lang.String clientOrderID,
java.lang.String currencyPair,
double amount,
char type,
double price)
Executes message to the server to execute a trade. |
protected void |
initialiseFields(messenger.FXConnectionApplication fixApp,
java.lang.String targetCompID,
int portNumber)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char BUY
public static final char SELL
public static final java.lang.String DEFAULT_SESSION_ID_1
public static final java.lang.String DEFAULT_SESSION_ID_2
public static final int DEFAULT_PORT_1
public static final int DEFAULT_PORT_2
protected quickfix.Initiator initiator
protected quickfix.SessionID sessionID
Constructor Detail |
---|
public FXTradingMessenger(FXTradingListener listener)
listener
- Listener for callbacks.public FXTradingMessenger(FXTradingListener listener, java.lang.String serverID, int portNumber)
listener
- for callbackssessionID
- session IDportNumber
- port numberMethod Detail |
---|
public void executeTrade(java.lang.String username, java.lang.String clientOrderID, java.lang.String currencyPair, double amount, char type, double price)
clientOrderID
- Client order ID (must be unique to client)currencyPair
- Should be in string format. e.g. GBP/USDamount
- Should be in double format. Specify the amount that user would
like to trade.type
- Should be string format. Specify the type of order you would
like. E.g BUYprice
- The price of the trade.public void connect()
public void disconnect()
protected void initialiseFields(messenger.FXConnectionApplication fixApp, java.lang.String targetCompID, int portNumber)
protected static void checkForNull(java.lang.Object o)
protected void checkCurrencyPair(java.lang.String currencyPair)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |