OnixS C++ ICE Binary Order Entry Handler 1.0.0
API Documentation
Loading...
Searching...
No Matches
Exchanging Messages

Sending Messages

To send a message to a counterparty, use the OnixS::ICE::BOE::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::ICE::BOE::SessionListener class and pass the instance of the descendant class to the OnixS::ICE::BOE::Session's constructor.

Example

using namespace OnixS::ICE::BOE;
class MyListener : public SessionListener
{
public:
void onExecutionReport_New(const ExecutionReport_New msg, Session* /*sn*/) override
{
std::clog << msg << std::endl;
}
};
settings.licenseStore("../../license")
.userId("SessionId")
.rawData("rawData")
.ipSessionToken("ipSessionToken");
Session session(SessionType::BUS, settings, &listener);
session.connect(host, port);
typedef MessageHolder<NewOrderRequest> NewOrderSingle;
NewOrderSingle order;
order->side(SideEnum::Buy)
.clOrdId(123)
.timeInForce(TimeInForceEnum::Day)
.orderQty(1000)
.price(999);
session.send(order);
// ...
session.disconnect();