Steps for fetching a full algo definition
To fetch the full definition of a single algo, you:
Instantiating the AlgoLookup class
The AlgoLookup class provides the following constructor.
When instantiating the AlgoLookup class, you must pass the name of the algo. For ADL, it is the name that you gave the algo. For TT Order Types, the names are as follows (including capitalization and spaces).
So, for example:
Synchronous fetch
Once an AlgoLookup object has been created, you can simply call the Get() method to perform a synchronous lookup of the algo definition as shown below. Note that although this is normally fairly quick, your execution thread will be blocked until this action is complete.
Asynchronous fetch
If you prefer not to be blocked, you can register a callback function to be called once the fetching has been completed as shown below.
After the GetAsync() method of the InstrumentLookup instance is called, TT .NET SDK performs a lookup for the algo definition based on the inputs that it was given. Whether the algo is found or not, the specified event handler method is called. The following code snippet illustrates the structure of this event handler.
Cleaning up
When you shut down your application, you should detach all event handlers and call the Dispose() method for each instance of the AlgoLookup class as follows:
About the Algo class
The Algo class provides the full definition of a given algo. Its members include:
The AlgoParameters class provides all of the details about a parameter. Its members include:
If the FieldLocation is equal to “OrderProfile”, then the parameter is set on the OrderProfile instance directly via the property indicated by its Name. If the FieldLocation is equal to “UserParameters”, then the parameter is set as part of the UserParameters property of the OrderProfile instance.