Struct Price
Provides methods and properties for accessing price data.
Assembly: tt-net-api.dll
Syntax
public struct Price : IEquatable<Price>, IEquatable<decimal>, IComparable<Price>, IComparable<decimal>
Fields
Empty
Represents an empty price
Declaration
public static readonly Price Empty
Field Value
Invalid
Represents an invalid price
Declaration
public static readonly Price Invalid
Field Value
Properties
InstrumentDetails
Returns the instrument details associated with this price
Declaration
public InstrumentDetails InstrumentDetails { get; }
Property Value
InvalidTickValue
Declaration
public static int InvalidTickValue { get; }
Property Value
InvalidValue
Declaration
public static decimal InvalidValue { get; }
Property Value
IsTradable
Indicates whether this price is tradable for the associated Instrument
Declaration
public bool IsTradable { get; }
Property Value
IsValid
Indicates whether this price is valid for the associated instrument
Declaration
public bool IsValid { get; }
Property Value
Value
Returns the value of this field as a decimal value
Declaration
public decimal Value { get; }
Property Value
Methods
Add(int)
Declaration
public Price Add(int tick)
Parameters
Type |
Name |
Description |
int |
tick |
|
Returns
Add(Price)
Declaration
public Price Add(Price p1)
Parameters
Type |
Name |
Description |
Price |
p1 |
|
Returns
AdjustPriceToTick(decimal, decimal, Rounding)
Declaration
public static decimal AdjustPriceToTick(decimal priceInPoints, decimal tickSize, Rounding round)
Parameters
Returns
CompareTo(decimal)
Declaration
public int CompareTo(decimal price)
Parameters
Type |
Name |
Description |
decimal |
price |
|
Returns
CompareTo(Price)
Compares the current instance with another object of the same type and returns an integer
that indicates whether the current instance precedes, follows, or occurs in the same position
in the sort order as the other object.
Declaration
public int CompareTo(Price other)
Parameters
Type |
Name |
Description |
Price |
other |
An object to compare with this instance.
|
Returns
Type |
Description |
int |
A value that indicates the relative order of the objects being compared. The return value has
these meanings: Value Meaning Less than zero This instance precedes other
in the sort order. Zero This instance occurs in the same position in the sort order as
other . Greater than zero This instance follows other
in the sort order.
|
Divide(int)
Declaration
public Price Divide(int tick)
Parameters
Type |
Name |
Description |
int |
tick |
|
Returns
Divide(Price)
Declaration
public Price Divide(Price p1)
Parameters
Type |
Name |
Description |
Price |
p1 |
|
Returns
Equals(decimal)
Declaration
public bool Equals(decimal price)
Parameters
Type |
Name |
Description |
decimal |
price |
|
Returns
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
|
Returns
Overrides
Equals(Price)
Declaration
public bool Equals(Price obj)
Parameters
Type |
Name |
Description |
Price |
obj |
|
Returns
FromDecimal(Instrument, decimal, Rounding)
Creates a Price object from a decimal value with or without rounding
Declaration
public static Price FromDecimal(Instrument instr, decimal dPrice, Rounding rnd = Rounding.None)
Parameters
Returns
FromString(Instrument, string, Rounding)
Creates a Price object from a string value with or without rounding.
Declaration
public static Price FromString(Instrument instr, string sPrice, Rounding rnd = Rounding.None)
Parameters
Returns
FromTick(Instrument, int, Rounding)
Creates a Price object from a tick value with or without rounding
Declaration
public static Price FromTick(Instrument instr, int ticks, Rounding rnd = Rounding.None)
Parameters
Returns
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
GetTickPrice(int)
Rounds and then increments the price.
Declaration
public Price GetTickPrice(int offset)
Parameters
Type |
Name |
Description |
int |
offset |
|
Returns
IsEmpty(Price)
Indicates whether a price is empty
Declaration
public static bool IsEmpty(Price price)
Parameters
Type |
Name |
Description |
Price |
price |
The price to test
|
Returns
Multiply(int)
Declaration
public Price Multiply(int tick)
Parameters
Type |
Name |
Description |
int |
tick |
|
Returns
Multiply(Price)
Multiplication operators.
Declaration
public Price Multiply(Price p1)
Parameters
Type |
Name |
Description |
Price |
p1 |
|
Returns
Offset(int, Rounding)
Return the current price which is offset for a given amount of ticks.
Declaration
public Price Offset(int offset, Rounding round)
Parameters
Returns
Round(Rounding)
Rounds the current price.
Declaration
public Price Round(Rounding round)
Parameters
Returns
Subtract(int)
Declaration
public Price Subtract(int tick)
Parameters
Type |
Name |
Description |
int |
tick |
|
Returns
Subtract(Price)
Declaration
public Price Subtract(Price p1)
Parameters
Type |
Name |
Description |
Price |
p1 |
|
Returns
ToCurrency(CurrencyCode)
Returns the price in the given currency.
Declaration
public Price ToCurrency(CurrencyCode toCurrency)
Parameters
Returns
ToDecimal()
Express the price as a decimal (in points).
Declaration
public decimal ToDecimal()
Returns
Express the price as a decimal formatted string.
Declaration
public string ToDecimalFormattedString()
Returns
ToNativeCurrency()
Returns the price in the Instrument's native currency
Declaration
public Price ToNativeCurrency()
Returns
ToPrimaryCurrency()
Returns the price in the system's primary currency
Declaration
public Price ToPrimaryCurrency()
Returns
ToString()
Express the price as a string.
Declaration
public override string ToString()
Returns
Overrides
ToTicks()
Express the price as a tick.
Declaration
Returns
Operators
operator +(int, Price)
Declaration
public static Price operator +(int tick, Price price)
Parameters
Type |
Name |
Description |
int |
tick |
|
Price |
price |
|
Returns
operator +(Price, int)
Declaration
public static Price operator +(Price price, int tick)
Parameters
Type |
Name |
Description |
Price |
price |
|
int |
tick |
|
Returns
operator +(Price, Price)
Declaration
public static Price operator +(Price left, Price right)
Parameters
Returns
operator --(Price)
Declaration
public static Price operator --(Price price)
Parameters
Type |
Name |
Description |
Price |
price |
|
Returns
operator /(int, Price)
Declaration
public static Price operator /(int tick, Price price)
Parameters
Type |
Name |
Description |
int |
tick |
|
Price |
price |
|
Returns
operator /(Price, int)
Declaration
public static Price operator /(Price price, int tick)
Parameters
Type |
Name |
Description |
Price |
price |
|
int |
tick |
|
Returns
operator /(Price, Price)
Declaration
public static Price operator /(Price left, Price right)
Parameters
Returns
operator ==(decimal, Price)
Declaration
public static bool operator ==(decimal left, Price right)
Parameters
Returns
operator ==(Price, decimal)
Declaration
public static bool operator ==(Price left, decimal right)
Parameters
Returns
operator ==(Price, Price)
Declaration
public static bool operator ==(Price left, Price right)
Parameters
Returns
operator >(decimal, Price)
Declaration
public static bool operator >(decimal left, Price right)
Parameters
Returns
operator >(Price, decimal)
Declaration
public static bool operator >(Price left, decimal right)
Parameters
Returns
operator >(Price, Price)
Declaration
public static bool operator >(Price left, Price right)
Parameters
Returns
operator >=(decimal, Price)
Declaration
public static bool operator >=(decimal left, Price right)
Parameters
Returns
operator >=(Price, decimal)
Declaration
public static bool operator >=(Price left, decimal right)
Parameters
Returns
operator >=(Price, Price)
Declaration
public static bool operator >=(Price left, Price right)
Parameters
Returns
implicit operator decimal(Price)
Declaration
public static implicit operator decimal(Price obj)
Parameters
Type |
Name |
Description |
Price |
obj |
|
Returns
operator ++(Price)
Declaration
public static Price operator ++(Price price)
Parameters
Type |
Name |
Description |
Price |
price |
|
Returns
operator !=(decimal, Price)
Declaration
public static bool operator !=(decimal left, Price right)
Parameters
Returns
operator !=(Price, decimal)
Declaration
public static bool operator !=(Price left, decimal right)
Parameters
Returns
operator !=(Price, Price)
Declaration
public static bool operator !=(Price left, Price right)
Parameters
Returns
operator <(decimal, Price)
Declaration
public static bool operator <(decimal left, Price right)
Parameters
Returns
operator <(Price, decimal)
Declaration
public static bool operator <(Price left, decimal right)
Parameters
Returns
operator <(Price, Price)
Declaration
public static bool operator <(Price left, Price right)
Parameters
Returns
operator <=(decimal, Price)
Declaration
public static bool operator <=(decimal left, Price right)
Parameters
Returns
operator <=(Price, decimal)
Declaration
public static bool operator <=(Price left, decimal right)
Parameters
Returns
operator <=(Price, Price)
Declaration
public static bool operator <=(Price left, Price right)
Parameters
Returns
operator *(int, Price)
Declaration
public static Price operator *(int tick, Price price)
Parameters
Type |
Name |
Description |
int |
tick |
|
Price |
price |
|
Returns
operator *(Price, int)
Declaration
public static Price operator *(Price price, int tick)
Parameters
Type |
Name |
Description |
Price |
price |
|
int |
tick |
|
Returns
operator *(Price, Price)
Declaration
public static Price operator *(Price left, Price right)
Parameters
Returns
operator -(int, Price)
Declaration
public static Price operator -(int tick, Price price)
Parameters
Type |
Name |
Description |
int |
tick |
|
Price |
price |
|
Returns
operator -(Price, int)
Declaration
public static Price operator -(Price price, int tick)
Parameters
Type |
Name |
Description |
Price |
price |
|
int |
tick |
|
Returns
operator -(Price, Price)
Declaration
public static Price operator -(Price left, Price right)
Parameters
Returns
Implements