Troubleshooting
Prices
I'm receiving the following error when restarting my price subscription applications: "Unable to log into TT - forcing TTAPI shutdown. Details: You are attempting to connect with an app key that is already in use. [Session limit exceeded for App Key]"
A given app key can only be used by one application at a time. Because they are being rejected for "Session limit exceeded for App Key", they are most likely already connected to TT using that app key with a different application. You must shut down the other application instance if you want to start this one or create an additional app key to use for the second instance of the application.
I am not receiving any prices.
The application can code for possible errors because the PriceSubscription FieldsUpdatedEventArgs will indicate the error.
Check the TT.NET SDK log file for information about the reason if the application is not handling the error. In the example below, the request for NGTN3-NGTQ3 was rejected because the application exceeded the number of price subscriptions allowed by the usage plan associated with the app key.
Example
2023-02-22 17:42:08.6556321 | 0000010 | PrcSub | INFO | PS396_NGTN3-NGTQ3_7960339047406426882 , with type : TradeData on dispatcherId: 10 starting....
2023-02-22 17:42:08.6559271 | 0000020 | EdgSck | INFO | EDGE OUT: {"PriceSubscriptionRequest": {"request_id":"468e78a7","action":1,"instrument_id":7960339047406426882,"maximum_depth":0,"include_detailed_depth":false,"field_id":[0],"unconflated_time_sales_data":false,"instrument_mod_revision":1085803346,"include_implieds":true,"pnl_only":false}}
2023-02-22 17:42:08.6608185 | 0000032 | EdgeSv | INFO | EDGE IN: {"PriceSubscriptionResponse":{"request_id":"468e78a7","instrument_id":7960339047406426882,"status":25}}
2023-02-22 17:42:08.6921155 | 0000010 | PrcSub | WARN | PS396_NGTN3-NGTQ3_7960339047406426882 failed. Status:SubscriptionLimitExceeded Exceeded price subscription limit. Consider a higher usage plan.
If there is not a detailed message regarding the failure, please refer to the “status” in the PriceSubscriptionResponse message. Note that not all of the status responses will occur in response to a price subscription request. The most likely are marked with a P in the table below.
| Error | Error Code | Description | Most Likely Cause |
|---|---|---|---|
| NotSet | -1 | ||
| Unknown | 0 | ||
| Ok | 1 | Successful Request | P |
| Duplicate | 2 | Request was a duplicate of the previous action. | |
| NoConnectivity | 3 | Indicates there is no price server connected to the exchange. If this is scheduled downtime for the price server and/or exchange, the price subscription will start working when connectivity is reestablished. | P |
| InvalidId | 4 | The instrument requested is invalid. | P |
| NoEntitlement | 5 | The user is not allowed to make this type of subscription. Please check the Market Data entitlements in TT Setup and ensure the appropriate settings on the SDK tabs. | P |
| TransportFail | 6 | The transport layer in the server failed to deliver one or more messages and will attempt to resend/recover those messages | |
| SubscriptionNotFound | 7 | The subscription was not found | |
| UnknownFail | 8 | Failure due to an internal error | |
| MiddlewareContextFail | 9 | The transport layer in the server is in a bad state and the server will attempt to recover from that bad state. | |
| SessionLimitExceeded | 10 | The number of sessions allowed for the user for making a given subscription type has been exceeded. Either increase the number of sessions allocated in TT Setup or update the application to account for the number configured. | P |
| Terminated | 11 | Subscription was forcefully terminated by an external entity | |
| PositionDownloadFail | 12 | Unable to download Positions for an Account | |
| NeedsMarketdataAgreement | 13 | The user needs to accept the market data agreement and retry the request. | P |
| PricesInactiveInstrument | 14 | Instrument is inactive | P |
| PricesDeletedInstrument | 15 | Instrument was deleted | P |
| PricesNottradableInstrument | 16 | Instrument is non-tradeable | P |
| Closed | 17 | Subscription was closed | |
| FeatureNotEnabled | 18 | Requested feature is not enabled | |
| PricesCollision | 19 | Subscription has a conflict and is colliding with another subscription | |
| PricesPartyMismatch | 20 | Party ID provided in the price subscription request does not match what the user is configured for in TT Setup for this environment | |
| NotReady | 21 | The backend component is not ready to perform the requested action at this time. Repeating this request later might succeed | P |
| NoProxySession | 22 | Unable to locate the Proxy Session to forward the request to | |
| PricesConflictingUpdate | 23 | The instrument underlying this existing subscription has changed in a way that invalidates this subscription | |
| Restart | 24 | Restarting a subscription due to unrecoverable loss | P |
| SubscriptionLimitExceeded | 25 | The number of price subscriptions allowed for an application session was exceeded | P |
| TransportDisruption | 26 | The transport layer disruption to deliver one or more messages: the server will attempt to resend/recover those messages | |
| ObdlTimeout | 27 | Indicates order book download failure due to request timeouts | |
| ObdlError | 28 | Indicates order book download failure due to request timeouts |
Instruments
My instrument lookup is not working.
Check the SDK log file and search for the instrument that you are looking up. There will be an API request log message to download the instrument from TT’s Product Data Server.
Example:
API request: instruments?alias=ES+Mar24&slim=false&request_id=NTSDK-BEAST2--47f0365f-69f0-41f9-8038-dd87fe415b76
Following this request log message will be an API response message logged. A successful message will contain the instrument information.
2024-01-09 18:37:37.1830152 | 0000014 | RstRtr | INFO | API response: (OK) {"result":{"status":{"stat":"StatusOk","tid":"d04b58c6-6751-4d74-ab47-e58d99d1098d","cid":"[unknown]"},"time":{"con":21,"parse":250,"q":6720,"qc":1,"crypto":2,"total":7029},"pd":{"t":20240109183737}},"instruments":[{"n":"ESH4","a":"ES Mar24","i":17067654481963988130,"p":16832263018975006242,"m":7,"e":20240315,"sk":"00A0CY00ESZ","pdo":1,"pt":34,"rev":1129725637,"eph":false,"state":4,"stateAttrib":0,"s":"ES","d":"17077","iv":16825756299018438765,"pv":9530786272363431796,"st":20211217,"l":20240315,"tv":12.5,"ts":25.0,"v":0.5,"f":0.01,"mv":1,"xv":3000,"qm":50.0,"um":51,"md":10,"df":0,"ma":1,"tn":25,"td":1,"te":4,"msi":"64","del":false,"ric":"ESH24","ps":"ES","se":2,"ptop":"CME_2","pdt":0,"lckStr":"","term":"Mar24","excid":"310","pc":151,"smas":[{"iid":17067654481963988130,"smi":2003,"sma":"ES Mar24","spc":"ES","sst":34}],"exp":20240315235959,"fs":"0.01","pfi":1831858306092390752,"uui":0,"uts":20221113180634,"ups":6,"un":"7ES20240301","its":20211205180815,"data":"{\"cdd\":\"2024030000000\"}","at":200,"bbc":"ESH4 Index","bec":"CME","ofc":"BBG013ZHH8T9","isShared":false,"cdd":2024030000000},{"n":"ESH4","a":"ES Mar24","i":14053607635604335211,"p":12222029473659513531,"m":183,"e":20240315,"sk":"00A0CY00ESZ","pdo":1,"pt":34,"rev":1141777026,"eph":false,"state":4,"stateAttrib":0,"s":"ES","d":"17077","iv":16825756299018438765,"pv":16666212535080812909,"st":20211217,"l":20240315,"tv":12.5,"ts":25.0,"v":0.5,"f":0.01,"mv":1,"xv":3000,"qm":50.0,"um":51,"md":10,"df":0,"ma":1,"tn":25,"td":1,"te":4,"msi":"64","del":false,"ps":"ES","se":354,"ptop":"CME_Delayed","pdt":0,"lckStr":"","term":"Mar24","excid":"310","pc":151,"exp":20240315235959,"fs":"0.01","pfi":13655746497637646299,"uui":0,"uts":20230211024413,"ups":6,"un":"7ES20240301_17077","its":20230211024413,"data":"{\"cdd\":\"2024030000000\"}","at":200,"isShared":false,"cdd":2024030000000},{"n":"ESH4","a":"ES Mar24","i":11817632873603300071,"p":11019202764322522576,"m":24,"e":20240331,"sk":"290054","ud":true,"pdo":1,"pt":34,"rev":1175295710,"eph":false,"state":4,"stateAttrib":0,"s":"ES","d":"290054","iv":9825108768738738854,"pv":6491095118410969087,"l":20240328,"tv":21.84,"ts":0.01,"v":2184.0,"si":true,"df":0,"pd":2,"tn":1,"td":100,"te":4,"del":false,"ric":"YMSH4","ps":"ES","se":40,"ptop":"ASX","pdt":0,"lckStr":"","term":"Mar24","pc":8,"smas":[{"iid":11817632873603300071,"smi":2003,"sma":"SLL Mar24","spc":"SLL","sst":34}],"cfi":"FCICSO","exp":20240328235959,"pfi":13473777708720919707,"uui":0,"uts":20231006121459,"ups":5,"un":"24ES20240328","its":20230929064505,"at":200,"bbc":"SLLH4 Comdty","bec":"SFE","ofc":"BBG01JLD4Y60","isShared":false}],"instrumentsCount":3,"deletedInstruments":[],"deletedInstrumentsCount":0}
If the response is empty, the server was unable to find the requested information. API response: (OK) {"result":{"status":{"stat":"StatusOk","tid":"13348b5b-836d-492e-937b-910c80b3b280","cid":"[unknown]"},"time":{"con":8,"parse":39,"q":4972,"qc":1,"crypto":1,"total":5065},"pd":{"t":20240321142904}},"instruments":[],"instrumentsCount":0,"deletedInstruments":[],"deletedInstrumentsCount":0}
At this point, check the instrument in TTW and confirm the proper product and alias are being used for the SDK lookup. An unsuccessful request will have the error information logged.
Application
My application is not starting up when running in server mode.
If the application is not properly starting, it is possible that the dependencies are not available on the server machine. The log message below is an example of a missing dependency.
Example
2024-06-19 07:43:44.6418622 | 0000015 | TTAPI | EXCEP | Error in starting TTAPI: Could not load file or assembly 'core-wrapper.dll' or one of its dependencies. The specified module could not be found. 'Could not load file or assembly 'core-wrapper.dll' or one of its dependencies. The specified module could not be found.'
Stack Trace:
at tt_net_sdk.CoreService..ctor(PositionManager posMgr)
at tt_net_sdk.TTAPI.
Please ensure all required DLLS are in the path for the executable.
My application is not starting.
If the SDK is indicating an assembly could not be loaded, the system does not have the appropriate files installed.
2024-10-09 13:06:06.4463348 | 0000013 | TTAPI | EXCEP | Error in starting TTAPI: Could not load file or assembly 'TimeZoneConverter, Version=6.1.0.0, Culture=neutral, PublicKeyToken=e20ab7d0d9479841' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 'Could not load file or assembly 'TimeZoneConverter, Version=6.1.0.0, Culture=neutral, PublicKeyToken=e20ab7d0d9479841' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'
That error is indicating that you do not have the correct version of TimeZoneConverter in the application path. Ensure that you have all of the proper dependent dlls in the path. Visual Studio does this if you are using the NuGet package manager.
My application is experiencing latency.
Please check the SDK log file as there will be log message indicating if the application is unable to keep up with the flow of price updates.
TT .NET SDK will log:
PS1_
CORE SDK will log:
thread_queue backed up: X
The bigger the X and Y, the worse it is. The application should be improved to handle price updates in a more timely manner.
My application is not getting order acknowledgments.
TTSetup changes to users, accounts and connections are not immediately reflected in the DRO when running server side (with .NET SDK and CORE SDK) If an account or connection was changed in TTSetup during the week, users need to wait to route orders on that account/connection until the DRO is redeployed which happens at global down time (Saturdays).