Programming Guide

Introduction

Onix Solutions Eurex ETI Handler is a Java library that provides access to the Eurex ETI service. The Eurex Enhanced Trading Interface is a system that provides the necessary functionality to effectively trade and post markets with Eurex trading systems and provides users with the basic information suitable for formulating trading decisions. The Eurex ETI API allows third parties to develop their own applications that use the Eurex system.

Below are the key features of the Eurex ETI Handler:

  • Full access to the Eurex ETI functionality
  • Easy-to-use API

It's highly recommended to read the "Eurex Enhanced Trading Interface - Manual Simulation" document before reading this guide to get familiar with the core aspects of Eurex ETI service. It's also highly recommended to review the source code of the sample project, which comes as part of the library's distributive package alongside reading this guide.

Supported Eurex T7 Release

OnixS Eurex T7 ETI Trading Handler supports Enhanced Trading Interface Derivatives Message Reference Release 13.0.

Typical Usage

The typical way of using the handler follows.

Here is a small example of how to get started with the Handler:

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
final HandlerSettings settings = new HandlerSettings();
settings.getConnectionSettings().setRemoteAddress("localhost", 10000);
  
final Handler handler = new Handler();
handler.init(settings);
  
handler.setErrorListener(this);
handler.setWarningListener(this);
  
final LogonRequest logonRequest = new LogonRequest();
// setting logon request fields
handler.connect(logonRequest);
  
final UserLoginRequest userLoginRequest = new UserLoginRequest();
// setting user login request fields
handler.send(userLoginRequest);
  
final NewOrderSingleRequest newOrderSingleRequest = new NewOrderSingleRequest();
// setting order fields
handler.send(newOrderSingleRequest);
  
final UserLogoutRequest userLogoutRequest = new UserLogoutRequest();
// setting user logout request fields
handler.send(userLogoutRequest);
  
handler.disconnect();
handler.shutdown();

Settings

Settings can be configured programmatically (via API) or via a properties file.

Programmatic Configuration

Any available option can be set via API.

46
47
final HandlerSettings settings = new HandlerSettings();
settings.getConnectionSettings().setRemoteAddress("localhost", 10000);

Properties File Configuration

Settings can be loaded from the properties file:

33
34
final HandlerSettings settings = new HandlerSettings();
settings.init("site/handler.properties");

The sample properties file follows. Not all available options are mentioned.

1
2
3
4
Host = 193.29.89.65
Port = 19508
PartyIdSessionId = 1111
GatewayPassword = password

Property List

The configuration parameter (key) is case-sensitive. The list of available parameters follows.

Property Name Type Default Value Description
Host String Sets the remote host to connect to.
Port int Sets the remote port to connect to.
LicenseFile String "OnixS.lic" Sets the license file.
LicenseDirectory String "." Sets the license directory.
LicenseContent String Sets the license file content explicitly.
ReconnectionSettings.Mode enum LIMITED Sets the reconnection mode: 
* NEVER - no reconnection; 
* ALWAYS - reconnect infinitely; 
* LIMITED - limited number of reconnects.
ReconnectionSettings.Number int 3 Sets the number of reconnects. 
Effective only if ReconnectionSettings.Mode = LIMITED.
ReconnectionSettings.Interval int 30 Sets the interval between reconnects in seconds. 
Effective only if ReconnectionSettings.Mode = LIMITED.
HeartbeatInterval int 30000 Sets the heartbeat interval in milliseconds. 
Allowed values are from 100 till 60000.
PartyIdSessionId int Sets the session id (PartyIdSessionId).
GatewayPassword String Sets the password.
LocalAddress.Host String Sets the local host to use for connection.
LocalAddress.Port int Sets the local port to use for connection.

Initialization

The handler is initialized with the settings.

50
51
52
// Handler initialization
handler = new Handler();
handler.init(settings);

Connection Establishment

For connection establishment, do the following.

79
80
81
LogonRequest logonRequest = new LogonRequest();
// fill `logonRequest` with credentials
handler.connect(logonRequest);

User Logon

To do user logon create the corresponding message object, set the field values and send it.

97
98
99
100
final UserLoginRequest userLoginRequest = new UserLoginRequest();
userLoginRequest.setUsername(111);
userLoginRequest.setPassword("password");
handler.send(userLoginRequest);

Sending Messages

To send application level message create the message object, set the field values and send it.

106
107
108
final NewOrderSingleRequest newOrderSingleRequest = new NewOrderSingleRequest();
// setting order fields
handler.send(newOrderSingleRequest);

User Logout

To do user logout create the corresponding message object, set the fields values and send it.

114
115
116
final UserLogoutRequest userLogoutRequest = new UserLogoutRequest();
userLogoutRequest.setUsername(111);
handler.send(userLogoutRequest);

Connection Termination

For connection termination, do the following.

87
handler.disconnect();

Shutdown

90
91
// Handler shutdown
handler.shutdown();

Message Thread Safety

Message Receiving

For each message type the Handler has a static object that is used for deserialization and calling a user code callback. This means that you can't use reference to the message from the callback and need to create your own copy if you want to process the message later in a separate thread.

Message Sending

The Handler uses message objects passed to send method even after the user returns control from this method. There is a queue to which the Handler adds these objects and until they are serialized to bytes and sent over the network the user should not make any changes to these objects.

Error and Warning Listeners

Error Listener

The handler uses exceptions to report errors that occurred while performing a certain action. For example, the handler will raise a regular exception to report the inability to find an actual license for the product. However, the handler processes data asynchronously; therefore, the handler is not able to report any further errors since the data processing is started. For this reason, the handler exposes

biz.onixs.eurex.eti.handler.core.event.ErrorListener

interface and

biz.onixs.eurex.eti.handler.core.Handler.setErrorListener(ErrorListener)

method to be able to subscribe to error events.

55
handler.setErrorListener(new MyErrorListener());

Once instance of error listener is assigned to the handler, it will invoke

biz.onixs.eurex.eti.handler.core.event.ErrorListener.onError(ErrorCode, String)

method each time error occurs.

27
28
29
30
31
32
33
public class MyErrorListener implements ErrorListener {
    private static final Logger LOG = LoggerFactory.getLogger(MyErrorListener.class);
  
    public void onError(ErrorCode errorCode, String description) {
        LOG.error("onError(): errorCode={}, description={}", errorCode, description);
    }
}

Warning Listener

Miscellaneous non-critical issues may occur while the handler is being executed. The handler will process such issues by itself; thus, no special steps are required for such cases. However, sometimes it's reasonable to be notified about such events. For this reason, the handler exposes

biz.onixs.eurex.eti.handler.core.event.WarningListener

interface and

biz.onixs.eurex.eti.handler.core.Handler.setWarningListener(WarningListener)

method to be able to subscribe to warning events.

58
handler.setWarningListener(new MyWarningListener());

When an instance of warning listener is assigned to the handler, it will invoke

biz.onixs.eurex.eti.handler.core.event.WarningListener.onWarning(String)

method each time a warning occurs.

26
27
28
29
30
31
32
public class MyWarningListener implements WarningListener {
    private static final Logger LOG = LoggerFactory.getLogger(MyWarningListener.class);
  
    public void onWarning(String description) {
        LOG.warn("onWarning(): description={}", description);
    }
}

Incoming Message Event Listeners

Once the handler is started, it listens to messages from the Eurex ETI message flow, processes it, and invokes client code for further processing.

The handler processes messages asynchronously and uses the concept of events and event listeners to notify client code about a particular occasion, like the reception of a message.

Administrative Message Events

To be notified about administrative message events the following interface

biz.onixs.eurex.eti.handler.core.event.AdminListener

must be implemented and registered via the handler method

biz.onixs.eurex.eti.handler.core.Handler.setAdminListener(AdminListener)
61
handler.setAdminListener(new MyAdminListener());

The sample interface implementation demonstrates available message events to receive.

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
public class MyAdminListener implements AdminListener {
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.Reject} message received.
     * @param message message
     */
    public void onReject(Reject message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.RetransmitMEMessageResponse} message received.
     * @param message message
     */
    public void onRetransmitMEMessageResponse(RetransmitMEMessageResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.RetransmitResponse} message received.
     * @param message message
     */
    public void onRetransmitResponse(RetransmitResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.SubscribeResponse} message received.
     * @param message message
     */
    public void onSubscribeResponse(SubscribeResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.UnsubscribeResponse} message received.
     * @param message message
     */
    public void onUnsubscribeResponse(UnsubscribeResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.UserLoginResponse} message received.
     * @param message message
     */
    public void onUserLoginResponse(UserLoginResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.UserLogoutResponse} message received.
     * @param message message
     */
    public void onUserLogoutResponse(UserLogoutResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.InquireSessionListResponse} message received.
     * @param message message
     */
    public void onInquireSessionListResponse(InquireSessionListResponse message) {
    }
  
    /**
     * Notifies about the outgoing message.
     * @param message message
     */
    public void onOutboundMessage(Message message) {
    }
  
    /**
     * Notifies about the inbound message.
     * @param message message
     */
    public void onInboundMessage(Message message) {
    }
}

Order Handling Message Events

To be notified about order handling message events the following interface

biz.onixs.eurex.eti.handler.core.event.OrderHandlingListener

must be implemented and registered via the handler method

biz.onixs.eurex.eti.handler.core.Handler.setOrderHandlingListener(OrderHandlingListener)
67
handler.setOrderHandlingListener(new MyOrderHandlingListener());

The sample interface implementation demonstrates available message events to receive.

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
class MyOrderHandlingListener implements OrderHandlingListener {
    /**
     * * Notifies about {@link biz.onixs.eurex.eti.handler.message.DeleteAllOrderNRResponse} message received.
     * @param message message
     */
    public void onDeleteAllOrderNRResponse(DeleteAllOrderNRResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.DeleteAllOrderBroadcast} message received.
     * @param message message
     */
    public void onDeleteAllOrderBroadcast(DeleteAllOrderBroadcast message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.DeleteAllOrderResponse} message received.
     * @param message message
     */
    public void onDeleteAllOrderResponse(DeleteAllOrderResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.DeleteOrderBroadcast} message received.
     * @param message message
     */
    public void onDeleteOrderBroadcast(DeleteOrderBroadcast message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.DeleteOrderNRResponse} message received.
     * @param message message
     */
    public void onDeleteOrderNRResponse(DeleteOrderNRResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.DeleteOrderResponse} message received.
     * @param message message
     */
    public void onDeleteOrderResponse(DeleteOrderResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.ModifyOrderNRResponse} message received.
     * @param message message
     */
    public void onModifyOrderNRResponse(ModifyOrderNRResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.ModifyOrderResponse} message received.
     * @param message message
     */
    public void onModifyOrderResponse(ModifyOrderResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.NewOrderNRResponse} message received.
     * @param message message
     */
    public void onNewOrderNRResponse(NewOrderNRResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.NewOrderResponse} message received.
     * @param message message
     */
    public void onNewOrderResponse(NewOrderResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.MassOrderAck} message received.
     * @param message message
     */
    @Override
    public void onMassOrderAck(MassOrderAck message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.OrderExecNotification} message received.
     * @param message message
     */
    public void onOrderExecNotification(OrderExecNotification message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.OrderExecReportBroadcast} message received.
     * @param message message
     */
    public void onOrderExecReportBroadcast(OrderExecReportBroadcast message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.OrderExecResponse} message received.
     * @param message message
     */
    public void onOrderExecResponse(OrderExecResponse message) {
    }
}

Quote Handling Message Events

To be notified about quote handling message events the following interface

biz.onixs.eurex.eti.handler.core.event.QuoteHandlingListener

must be implemented and registered via the handler method

biz.onixs.eurex.eti.handler.core.Handler.setQuoteHandlingListener(QuoteHandlingListener)
70
handler.setQuoteHandlingListener(new MyQuoteHandlingListener());

The sample interface implementation demonstrates available message events to receive.

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
public class MyQuoteHandlingListener implements QuoteHandlingListener {
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.DeleteAllOrderQuoteEventBroadcast} message received.
     * @param message message
     */
    public void onDeleteAllOrderQuoteEventBroadcast(DeleteAllOrderQuoteEventBroadcast message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.DeleteAllQuoteBroadcast} message received.
     * @param message message
     */
    public void onDeleteAllQuoteBroadcast(DeleteAllQuoteBroadcast message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.DeleteAllQuoteResponse} message received.
     * @param message message
     */
    public void onDeleteAllQuoteResponse(DeleteAllQuoteResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.InquireMMParameterRequest} message received.
     * @param message message
     */
    public void onInquireMMParameterRequest(InquireMMParameterRequest message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.InquireMMParameterResponse} message received.
     * @param message message
     */
    public void onInquireMMParameterResponse(InquireMMParameterResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.MMParameterDefinitionResponse} message received.
     * @param message message
     */
    public void onMMParameterDefinitionResponse(MMParameterDefinitionResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.MassQuoteResponse} message received.
     * @param message message
     */
    public void onMassQuoteResponse(MassQuoteResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.QuoteActivationNotification} message received.
     * @param message message
     */
    public void onQuoteActivationNotification(QuoteActivationNotification message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.QuoteActivationResponse} message received.
     * @param message message
     */
    public void onQuoteActivationResponse(QuoteActivationResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.QuoteExecutionReport} message received.
     * @param message message
     */
    public void onQuoteExecutionReport(QuoteExecutionReport message) {
    }
}

Quote and Cross Request Message Events

To be notified about quote and cross request message events the following interface

biz.onixs.eurex.eti.handler.core.event.QuoteAndCrossRequestListener

must be implemented and registered via the handler method

biz.onixs.eurex.eti.handler.core.Handler.setQuoteAndCrossRequestListener(QuoteAndCrossRequestListener)
73
handler.setQuoteAndCrossRequestListener(new MyQuoteAndCrossRequestListener());

The sample interface implementation demonstrates available message events to receive.

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
public class MyQuoteAndCrossRequestListener implements QuoteAndCrossRequestListener {
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.CrossRequestResponse} message received.
     * @param message message
     */
    public void onCrossRequestResponse(CrossRequestResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.RFQResponse} message received.
     * @param message message
     */
    public void onRFQResponse(RFQResponse message) {
    }
}

Strategy Creation Message Events

To be notified about strategy creation message events the following interface

biz.onixs.eurex.eti.handler.core.event.StrategyCreationListener

must be implemented and registered via the handler method

biz.onixs.eurex.eti.handler.core.Handler.setStrategyCreationListener(StrategyCreationListener)
64
handler.setStrategyCreationListener(new MyStrategyCreationListener());

The sample interface implementation demonstrates available message events to receive.

25
26
27
28
29
30
31
32
public class MyStrategyCreationListener implements StrategyCreationListener {
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.AddComplexInstrumentResponse} message received.
     * @param message message
     */
    public void onAddComplexInstrumentResponse(AddComplexInstrumentResponse message) {
    }
}

Other Message Events

To be notified about other message events the following interface

biz.onixs.eurex.eti.handler.core.event.OtherListener

must be implemented and registered via the handler method

biz.onixs.eurex.eti.handler.core.Handler.setOtherListener(OtherListener)
76
handler.setOtherListener(new MyOtherListener());

The sample interface implementation demonstrates available message events to receive.

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
public class MyOtherListener implements OtherListener {
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.BroadcastErrorNotification} message received.
     * @param message message
     */
    public void onBroadcastErrorNotification(BroadcastErrorNotification message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.NewsBroadcast} message received.
     * @param message message
     */
    public void onNewsBroadcast(NewsBroadcast message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.RiskNotificationBroadcast} message received.
     * @param message message
     */
    public void onRiskNotificationBroadcast(RiskNotificationBroadcast message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.LegalNotificationBroadcast} message received.
     * @param message message
     */
    public void onLegalNotificationBroadcast(LegalNotificationBroadcast message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.ServiceAvailabilityBroadcast} message received.
     * @param message message
     */
    public void onServiceAvailabilityBroadcast(ServiceAvailabilityBroadcast message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.TMTradingSessionStatusBroadcast} message received.
     * @param message message
     */
    public void onTMTradingSessionStatusBroadcast(TMTradingSessionStatusBroadcast message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.TradeBroadcast} message received.
     * @param message message
     */
    public void onTradeBroadcast(TradeBroadcast message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.TradingSessionStatusBroadcast} message received.
     * @param message message
     */
    public void onTradingSessionStatusBroadcast(TradingSessionStatusBroadcast message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.PartyEntitlementsUpdateReport} message received.
     * @param message message
     */
    public void onPartyEntitlementsUpdateReport(PartyEntitlementsUpdateReport message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.InquireMarginBasedRiskLimitResponse} message received.
     * @param message message
     */
    public void onInquireMarginBasedRiskLimitResponse(InquireMarginBasedRiskLimitResponse message) {
    }
  
    /**
     * Notifies about {@link biz.onixs.eurex.eti.handler.message.UpdateRemainingRiskAllowanceBaseResponse} message received.
     * @param message message
     */
    public void onUpdateRemainingRiskAllowanceBaseResponse(UpdateRemainingRiskAllowanceBaseResponse message) {
    }
}