An in-depth look at the Price class
TT .NET SDK Price class provides users with the ability to compare and manipulate prices in a variety of formats. It exposes:
TT .NET SDK Price class provides users with the ability to compare and manipulate prices in a variety of formats.
TT .NET SDK Price class provides users with the ability to compare and manipulate prices in a variety of formats. It exposes:
The Price class overloads common arithmetic operators that allow you to perform arithmetic on prices in a variety of formats. For example, assume that the variable inst represents a valid instance for the Eurex FGBL-Jun20 futures contract. You could use the overloaded ++ operator to increase the price by one tick. The result of this code snippet would be: […]
The Price class overloads common comparison operators that allow you to compare prices with one another in a variety of formats. For example, assume that the variable inst represents a valid InstrumentDetails instance for the Eurex FGBL-Mar20 futures contract. You could use the overloaded == operator to indicate whether two prices are equal: In this example, the price on the left-hand-side […]
After you get a Price object that is both valid and tradable, you can use the following methods to extract the price in different formats. Desired format Price class method Points ToDecimal() Ticks ToTicks() TT Display ToString() Full price (in contract currency) ToPrimaryCurrency() Full price (in trader’s currency) ToNativeCurrency() Full price (in specific currency) ToCurrency() For example, […]
The Price class has no defined constructors; instead, it provides a series of static methods that return an instance of a Price class: These methods take a price in ticks (int), points (double), or TT Display (string) format. Additionally, these methods require information from the InstrumentDetails object associated with a contract, which you can specify directly or indirectly through the following […]