¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

E-MINI reqTickByTick data parameters


fran
 

Hi everyone, I am having trouble getting the E-MINI ticker tick-by-tick data (specifically E-mini S&P 500; ESdec15'23(50) CME). I am trying to run this line of code:

  • m_pClient->reqTickByTickData(20004, ContractSamples::EMINI(), "BidAsk", 0, false);

Where the contract is described like this in another file:

Contract ContractSamples::EMINI(){
??? Contract contract;
?? ?contract.symbol = "ES";
?? ?contract.secType = "FUT";
?? ?contract.exchange = "CME";
?? ?contract.currency = "USD";
??? contract.localSymbol = "ESZ2";
?? ?contract.lastTradeDateOrContractMonth = "202315";
?? ?return contract;
}

I keep getting an error related to a non-existing ticker.

I would appreciate any help/insight to solve this.


 

¿ªÔÆÌåÓý

localSymbol should be ¡°ESZ3¡±. What you¡¯ve got, ¡°ESZ2¡±, is for December 2022.

?

?

From: [email protected] <[email protected]> On Behalf Of fran
Sent: Monday, November 20, 2023 8:51 PM
To: [email protected]
Subject: [TWS API] E-MINI reqTickByTick data parameters

?

Hi everyone, I am having trouble getting the E-MINI ticker tick-by-tick data (specifically E-mini S&P 500; ESdec15'23(50) CME). I am trying to run this line of code:

  • m_pClient->reqTickByTickData(20004, ContractSamples::EMINI(), "BidAsk", 0, false);


Where the contract is described like this in another file:

Contract ContractSamples::EMINI(){
??? Contract contract;
?? ?contract.symbol = "ES";
?? ?contract.secType = "FUT";
?? ?contract.exchange = "CME";
?? ?contract.currency = "USD";
??? contract.localSymbol = "ESZ2";
?? ?contract.lastTradeDateOrContractMonth = "202315";
?? ?return contract;
}

I keep getting an error related to a non-existing ticker.

I would appreciate any help/insight to solve this.


fran
 

Hi Richard, thank you for your answer. I tried your suggestion but I keep getting "Error. Id: 20004, Code: 200, Msg: No security definition has been found for the request".


fran
 

If you don't mind sharing, could you share an example of how would you configure the field parameters for an E-MINI data stream (tick-by-tick) in C++? I have tried several combinations but I keep getting the same error. I subscribed to the data feed a couple of days ago. Thanks in advance.


 

You may try this code snippet. Just remove localSymbol.

Contract ContractSamples::EMINI(){
Contract contract;
contract.symbol = "ES";
contract.secType = "FUT";
contract.exchange = "CME";
contract.currency = "USD";
contract.lastTradeDateOrContractMonth = "202315";
return contract;
}


 

When you specify localSymbol you don't have to provide lastTradeDateOrContractMonth as well. But if you do, they have to match. You set lastTradeDateOrContractMonth to "202315", which is not even a real date in the first place.

I suggest you leave that field alone (that's what I do) or you'd have to provide the correct date of "20231215"

´³¨¹°ù²µ±ð²Ô


On Mon, Nov 20, 2023 at 08:48 PM, fran wrote:

Hi Richard, thank you for your answer. I tried your suggestion but I keep getting "Error. Id: 20004, Code: 200, Msg: No security definition has been found for the request".


 

Fran,

Try my way removing localSymbol. It works for me though I am using C#.


fran
 

Thank you ´³¨¹°ù²µ±ð²Ô and Robby for your quick response. I followed your instructions and it worked.?


fran
 

Thank you Richard as well.


 

¿ªÔÆÌåÓý

Oops, sorry I didn¡¯t notice also that you have

?

contract.lastTradeDateOrContractMonth = "202315";

?

This should be ¡°202312¡±, or ¡°20231215¡±.

?