public class MFMarketMaker
extends java.lang.Object
| Constructor and Description |
|---|
MFMarketMaker(MFString _username,
MFString _password,
MFString _hostname1,
int _port1)
A new client still needs to be connected (see connect()).
|
MFMarketMaker(MFString _username,
MFString _password,
MFString _hostname1,
int _port1,
MFString _hostname2,
int _port2)
A new client still needs to be connected (see connect()).
|
| Modifier and Type | Method and Description |
|---|---|
APIResult |
acceptOrder(NewOrder order)
Note: if NewOrder.orderID/execID is not provided by the venue, you must generate one.
|
APIResult |
acceptOrder(NewOrder order,
MFFloat amount)
This method is for sending partial fills.
|
APIResult |
cancelQuote(QuoteRequest request,
MFString quoteID) |
APIResult |
cancelQuoteForSymbol(QuoteRequest request) |
APIResult |
cancelQuotes(QuoteRequest quoteRequest) |
APIResult |
close()
Close the connection.
|
APIResult |
connect()
Connect to the first available server with user credentials.
|
APIFeed |
getFeedByID(int id)
After a successful connection is established, you may access the server's
list of _feeds, markets.
|
APIFeed |
getFeedByName(java.lang.CharSequence name)
After a successful connection is established, you may access the server's
list of _feeds, markets.
|
APIFeed[] |
getFeeds()
After a successful connection is established, you may access the server's
list of _feeds, markets.
|
MFString |
getHostname() |
java.util.List<PingTime> |
getLastPingTimes()
Gets the list of most recently stored PingTime objects from oldest to most recent - if any.
|
APIMarket |
getMarketByID(APIFeed feed,
int marketID)
After a successful connection is established, you may access the server's
list of _feeds, markets.
|
APIMarket |
getMarketByName(APIFeed feed,
java.lang.CharSequence name)
After a successful connection is established, you may access the server's
list of _feeds, markets.
|
int |
getPort() |
int |
getSequenceID(int feedID)
Get the last received sequenceID.
|
MFString |
getSignature() |
boolean |
isConnected() |
boolean |
isRunning() |
boolean |
isStopRequested() |
APIResult |
join()
Block until the client has exited the dispatch loop.
|
static MFMarketMaker |
open(java.lang.String user,
java.lang.String pass,
java.lang.String host,
int port)
A convenience method which creates a new client object, attempts to
connect to Whisperer, and cleans up and throws an exception if we could
not connect.
|
static MFMarketMaker |
open(java.lang.String user,
java.lang.String pass,
java.lang.String _hostname1,
int _port1,
java.lang.String _hostname2,
int _port2)
A convenience method which creates a new client object, attempts to
connect to Whisperer, and cleans up and throws an exception if we could
not connect.
|
APIResult |
processEvents(MFMarketMakerHandler _handler)
Process all pending events in the reactor, and return as soon as
reads/writes have been flushed.
|
APIResult |
rejectOrder(NewOrder order,
MFString text)
Note: if NewOrder.orderID/execID is not provided by the venue, you must generate one.
|
APIResult |
rejectQuoteRequest(QuoteRequest clientQuoteRequest,
QuoteRequestRejectReason reason,
MFString text) |
APIResult |
replay(int feedID,
int fromSequenceID,
int toSequenceID)
Request replay of order flow events in the range [fromSequenceID, toSequenceID=-1].
|
APIResult |
run(MFMarketMakerHandler handler)
Run a loop that will continuously dispatch incoming messages to a
_handler implementation.
|
void |
setDebug(boolean debug)
Deprecated.
MF devs only - set the mode using a JVM arg -
Options.MF_DEV_LOG_DEBUG_MESSAGES_JVM_ARG |
void |
setStickySubscriptions(boolean sticky)
Enable/Disable sticky subscriptions.
|
void |
setStickySubscriptions(boolean sticky,
boolean clearSubscriptionsOnStop) |
void |
setUseHeartbeat(boolean use) |
APIResult |
stop()
Request to stop the event dispatch loop.
|
APIResult |
submitQuotes(QuoteRequest request,
MFQuote[] quotes)
Note: If QuoteRequest does not arrive with a valid amount, you must fill one in.
|
APIResult |
subscribeOF(int feedID)
Subscribe to trading for a specific feed.
|
protected APIResult |
subscribeOF(int feedID,
MFString clSubID)
Subscribe to trading for a specific feed.
|
APIResult |
subscribePricing(int feedID,
MFString clSubID) |
APIResult |
subscribeTrading(int feedID,
MFString clSubID) |
APIResult |
unsubscribeAll()
Unsubscribe all market data and trading subscriptions.
|
APIResult |
unsubscribeOF(int feedID)
Unsubscribe to trading for a specific feed.
|
APIResult |
unsubscribeOF(int feedID,
MFString clSubID)
Unsubscribe to trading for a specific feed.
|
APIResult |
unsubscribePricing(int feedID,
MFString clSubID) |
APIResult |
unsubscribeTrading(int feedID,
MFString clSubID) |
public MFMarketMaker(MFString _username, MFString _password, MFString _hostname1, int _port1)
_username - -- username_password - -- password_hostname1 - -- primary host_port1 - -- primary portpublic MFMarketMaker(MFString _username, MFString _password, MFString _hostname1, int _port1, MFString _hostname2, int _port2)
_username - -- username_password - -- password_hostname1 - -- primary host_port1 - -- primary port_hostname2 - -- secondary host_port2 - -- secondary portpublic APIResult run(MFMarketMakerHandler handler)
handler - to be runpublic static MFMarketMaker open(java.lang.String user, java.lang.String pass, java.lang.String host, int port) throws java.io.IOException
user - -- usernamepass - -- passwordhost - -- primary hostport - -- primary portjava.io.IOException - when connection failspublic static MFMarketMaker open(java.lang.String user, java.lang.String pass, java.lang.String _hostname1, int _port1, java.lang.String _hostname2, int _port2) throws java.io.IOException
user - -- usernamepass - -- password_hostname1 - -- primary host_port1 - -- primary port_hostname2 - -- secondary host_port2 - -- secondary portjava.io.IOException - when connection failsprotected APIResult subscribeOF(int feedID, MFString clSubID)
feedID - the feed idclSubID - the client subscription idpublic APIResult unsubscribeOF(int feedID, MFString clSubID)
feedID - the feed idclSubID - the client subscription idpublic APIResult subscribeOF(int feedID)
feedID - the feed idpublic APIResult unsubscribeOF(int feedID)
feedID - the feed idpublic APIResult unsubscribeAll()
public APIResult rejectQuoteRequest(QuoteRequest clientQuoteRequest, QuoteRequestRejectReason reason, MFString text)
public APIResult cancelQuotes(QuoteRequest quoteRequest)
public APIResult cancelQuote(QuoteRequest request, MFString quoteID)
public APIResult cancelQuoteForSymbol(QuoteRequest request)
public APIResult submitQuotes(QuoteRequest request, MFQuote[] quotes)
request - -- the quote requestquotes - -- 0 or more quotes to be submittedpublic APIResult rejectOrder(NewOrder order, MFString text)
order - -- the order being rejectedtext - -- whypublic APIResult acceptOrder(NewOrder order)
order - -- the accepted orderpublic APIResult acceptOrder(NewOrder order, MFFloat amount)
order - -- order that is acceptedamount - -- the amountpublic void setUseHeartbeat(boolean use)
public void setDebug(boolean debug)
Options.MF_DEV_LOG_DEBUG_MESSAGES_JVM_ARGdebug - debug mode true or false.public java.util.List<PingTime> getLastPingTimes()
Refer to PingHandler.getLastPingTimes()
public void setStickySubscriptions(boolean sticky)
sticky - - sticky subscription. or otpublic void setStickySubscriptions(boolean sticky,
boolean clearSubscriptionsOnStop)
public boolean isConnected()
public APIResult connect()
public APIResult close()
public boolean isRunning()
public APIResult stop()
public boolean isStopRequested()
public APIResult join()
public APIResult processEvents(MFMarketMakerHandler _handler)
_handler - -- the handler to be runpublic MFString getSignature()
public int getSequenceID(int feedID)
feedID - the feed idpublic APIFeed[] getFeeds()
public APIFeed getFeedByName(java.lang.CharSequence name)
name - -- the feed namepublic APIFeed getFeedByID(int id)
id - -- the feed idpublic APIMarket getMarketByName(APIFeed feed, java.lang.CharSequence name)
feed - -- the feedname - -- the market namepublic APIMarket getMarketByID(APIFeed feed, int marketID)
feed - -- feed idmarketID - -- market idpublic MFString getHostname()
public int getPort()
public APIResult replay(int feedID, int fromSequenceID, int toSequenceID)
feedID - -- the feed idfromSequenceID - -- starting sequence idtoSequenceID - -- end sequence id