OnixS C++ CME iLink 3 Binary Order Entry Handler  1.18.9
API Documentation
Exchanging Messages

Sending Messages

To send a message to a counterparty, use the OnixS::CME::iLink3::Session::send method. The Handler sets all session-level fields automatically (e.g., SeqNum, SendingTimeEpoch).

Note
The session should be fully established before sending application-level messages.

Receiving Messages

To receive messages, override corresponding methods of the OnixS::CME::iLink3::SessionListener class and pass the instance of the descendant class to the OnixS::CME::iLink3::Session's constructor.

Example

using namespace OnixS::CME::iLink3;
class MyListener : public SessionListener
{
public:
void onExecutionReportNew(const ExecutionReportNew522& msg, Session* /*sn*/) override
{
std::clog << msg << std::endl;
}
};
const int MarketSegmentId = 54;
const std::string CounterpartyHost = "Localhost";
const int CounterpartyPort = 64124;
SessionSettings settings;
settings.licenseStore("../../license")
.sessionId("SessionId")
.secretKey("secretKey")
.accessKey("accessKey")
.firmId("firmId");
MyListener listener;
Session session(settings, MarketSegmentId, &listener);
session.connect(CounterpartyHost, CounterpartyPort);
typedef MessageHolder<NewOrderSingle514> NewOrderSingle;
NewOrderSingle order;
order->setSide(SideReq::Buy)
.setSenderId("SomeSenderId")
.setClOrdId("SomeOrderID")
.setTimeInForce(TimeInForce::Day)
.setOrderQty(1000)
.setPrice(PRICE9(10));
session.send(order);
// ...
session.disconnect();