Page History
A MFClient object contains a single MFTradingSession and multiple MFMarketDataSession instances, the latter referred to by Venue ID, which is the numeric value used for identifying MarketFactory feeds.The MFTradingSession is the interface for placing orders. The terminology used representing trading events is based on FIX 5.0 terminology. The MFTradingHandler provides callbacks for each message type representing trading events , and MFMarketDataHandler for callbacks for each message type relating to market data events.
Factory method newTcpTradingSession, creates a MFTradingSession instance. newTcpTradingSession
is passed the user-defined trading handler, which implements the MFTradingHandler interface. The handler interface is described in the next section.
This method takes MarketFactory login credentials (username and password), and MarketFactory server address (hostname and port). The boolean option autoRelogon is used to indicate if the MFClient instance should automatically re-logon when a disconnection of the MFClient from the MarketFactory server occurs.
Once created, call run() to start the event loop, which dispatches incoming events from Market- Factory MarketFactory to the functions defined in the user-provided trading and market data handlers. Only one thread should ever call this method.
Calling run() triggers the onStart() method on any registered handlers.
To stop dispatching events, send a logout, wait for a logout response, and then call .stop() This stops the event loop and closes open sockets. Calling .stop() triggers the onStop() method on all registered handlers. This may be called from an external thread or internally from a handler.