TT CORE SDK

Searching for Instruments

Searching for Instruments

The SearchInstruments() function provides the ability for you to find instruments using custom search criteria. The following code snippet demonstrates this approach:



ttsdk::Instrument::ResponseCode respCode;
std::string markets = “CME”;
std::string query = “CL”;
ttsdk::InstrumentSearchResultsPtr instRes = SearchInstruments(
          query.c_str(), markets.c_str(), respCode);
for (size_t i = 0; i < instRes->GetNumResults(); i++)
{
         InstrumentResultPtr instPtr = instRes->GetResult(i);
         std::cout << “alias = “ << instPtr->GetAlias() << std::endl;
}