OnixS C++ CME iLink 3 Binary Order Entry Handler  1.8.0
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*/) ONIXS_ILINK3_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;
// Set application-level fields:
order->setSide(SideReq::Buy);
order->setSenderId("SomeSenderId"),
order->setClOrdId("SomeOrderID");
order->setTimeInForce(TimeInForce::Day);
order->setOrderQty(1000);
order->setPrice(PRICE9(10));
session.send(order);
// Continues the message exchange..
// Done with messaging.
session.disconnect();