Struct Price
Provides methods and properties for accessing price data.
Implements
IEquatable<Decimal>
IComparable<Decimal>
Inherited Members
Object.Equals(Object, Object)
Object.GetType()
Object.ReferenceEquals(Object, Object)
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(Int32)
Declaration
public Price Add(int tick)
Parameters
Type |
Name |
Description |
Int32 |
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
Type |
Name |
Description |
Decimal |
priceInPoints |
|
Decimal |
tickSize |
|
Rounding |
round |
|
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 |
Int32 |
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(Int32)
Declaration
public Price Divide(int tick)
Parameters
Type |
Name |
Description |
Int32 |
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
System.ValueType.Equals(System.Object)
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
Type |
Name |
Description |
Instrument |
instr |
Instrument
|
Decimal |
dPrice |
Price
|
Rounding |
rnd |
Rounding type
|
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
Type |
Name |
Description |
Instrument |
instr |
Instrument
|
String |
sPrice |
Price
|
Rounding |
rnd |
Rounding type
|
Returns
FromTick(Instrument, Int32, 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
Type |
Name |
Description |
Instrument |
instr |
Instrument
|
Int32 |
ticks |
Price
|
Rounding |
rnd |
Rounding type
|
Returns
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
System.ValueType.GetHashCode()
GetTickPrice(Int32)
Rounds and then increments the price.
Declaration
public Price GetTickPrice(int offset)
Parameters
Type |
Name |
Description |
Int32 |
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(Int32)
Declaration
public Price Multiply(int tick)
Parameters
Type |
Name |
Description |
Int32 |
tick |
|
Returns
Multiply(Price)
Multiplication operators.
Declaration
public Price Multiply(Price p1)
Parameters
Type |
Name |
Description |
Price |
p1 |
|
Returns
Offset(Int32, Rounding)
Return the current price which is offset for a given amount of ticks.
Declaration
public Price Offset(int offset, Rounding round)
Parameters
Type |
Name |
Description |
Int32 |
offset |
|
Rounding |
round |
|
Returns
Round(Rounding)
Rounds the current price.
Declaration
public Price Round(Rounding round)
Parameters
Returns
Subtract(Int32)
Declaration
public Price Subtract(int tick)
Parameters
Type |
Name |
Description |
Int32 |
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
System.ValueType.ToString()
ToTicks()
Express the price as a tick.
Declaration
Returns
Operators
Addition(Int32, Price)
Declaration
public static Price operator +(int tick, Price price)
Parameters
Type |
Name |
Description |
Int32 |
tick |
|
Price |
price |
|
Returns
Addition(Price, Int32)
Declaration
public static Price operator +(Price price, int tick)
Parameters
Type |
Name |
Description |
Price |
price |
|
Int32 |
tick |
|
Returns
Addition(Price, Price)
Declaration
public static Price operator +(Price left, Price right)
Parameters
Returns
Decrement(Price)
Declaration
public static Price operator --(Price price)
Parameters
Type |
Name |
Description |
Price |
price |
|
Returns
Division(Int32, Price)
Declaration
public static Price operator /(int tick, Price price)
Parameters
Type |
Name |
Description |
Int32 |
tick |
|
Price |
price |
|
Returns
Division(Price, Int32)
Declaration
public static Price operator /(Price price, int tick)
Parameters
Type |
Name |
Description |
Price |
price |
|
Int32 |
tick |
|
Returns
Division(Price, Price)
Declaration
public static Price operator /(Price left, Price right)
Parameters
Returns
Equality(Decimal, Price)
Declaration
public static bool operator ==(decimal left, Price right)
Parameters
Type |
Name |
Description |
Decimal |
left |
|
Price |
right |
|
Returns
Equality(Price, Decimal)
Declaration
public static bool operator ==(Price left, decimal right)
Parameters
Type |
Name |
Description |
Price |
left |
|
Decimal |
right |
|
Returns
Equality(Price, Price)
Declaration
public static bool operator ==(Price left, Price right)
Parameters
Returns
GreaterThan(Decimal, Price)
Declaration
public static bool operator>(decimal left, Price right)
Parameters
Type |
Name |
Description |
Decimal |
left |
|
Price |
right |
|
Returns
GreaterThan(Price, Decimal)
Declaration
public static bool operator>(Price left, decimal right)
Parameters
Type |
Name |
Description |
Price |
left |
|
Decimal |
right |
|
Returns
GreaterThan(Price, Price)
Declaration
public static bool operator>(Price left, Price right)
Parameters
Returns
GreaterThanOrEqual(Decimal, Price)
Declaration
public static bool operator >=(decimal left, Price right)
Parameters
Type |
Name |
Description |
Decimal |
left |
|
Price |
right |
|
Returns
GreaterThanOrEqual(Price, Decimal)
Declaration
public static bool operator >=(Price left, decimal right)
Parameters
Type |
Name |
Description |
Price |
left |
|
Decimal |
right |
|
Returns
GreaterThanOrEqual(Price, Price)
Declaration
public static bool operator >=(Price left, Price right)
Parameters
Returns
Implicit(Price to Decimal)
Declaration
public static implicit operator decimal (Price obj)
Parameters
Type |
Name |
Description |
Price |
obj |
|
Returns
Increment(Price)
Declaration
public static Price operator ++(Price price)
Parameters
Type |
Name |
Description |
Price |
price |
|
Returns
Inequality(Decimal, Price)
Declaration
public static bool operator !=(decimal left, Price right)
Parameters
Type |
Name |
Description |
Decimal |
left |
|
Price |
right |
|
Returns
Inequality(Price, Decimal)
Declaration
public static bool operator !=(Price left, decimal right)
Parameters
Type |
Name |
Description |
Price |
left |
|
Decimal |
right |
|
Returns
Inequality(Price, Price)
Declaration
public static bool operator !=(Price left, Price right)
Parameters
Returns
LessThan(Decimal, Price)
Declaration
public static bool operator <(decimal left, Price right)
Parameters
Type |
Name |
Description |
Decimal |
left |
|
Price |
right |
|
Returns
LessThan(Price, Decimal)
Declaration
public static bool operator <(Price left, decimal right)
Parameters
Type |
Name |
Description |
Price |
left |
|
Decimal |
right |
|
Returns
LessThan(Price, Price)
Declaration
public static bool operator <(Price left, Price right)
Parameters
Returns
LessThanOrEqual(Decimal, Price)
Declaration
public static bool operator <=(decimal left, Price right)
Parameters
Type |
Name |
Description |
Decimal |
left |
|
Price |
right |
|
Returns
LessThanOrEqual(Price, Decimal)
Declaration
public static bool operator <=(Price left, decimal right)
Parameters
Type |
Name |
Description |
Price |
left |
|
Decimal |
right |
|
Returns
LessThanOrEqual(Price, Price)
Declaration
public static bool operator <=(Price left, Price right)
Parameters
Returns
Multiply(Int32, Price)
Declaration
public static Price operator *(int tick, Price price)
Parameters
Type |
Name |
Description |
Int32 |
tick |
|
Price |
price |
|
Returns
Multiply(Price, Int32)
Declaration
public static Price operator *(Price price, int tick)
Parameters
Type |
Name |
Description |
Price |
price |
|
Int32 |
tick |
|
Returns
Multiply(Price, Price)
Declaration
public static Price operator *(Price left, Price right)
Parameters
Returns
Subtraction(Int32, Price)
Declaration
public static Price operator -(int tick, Price price)
Parameters
Type |
Name |
Description |
Int32 |
tick |
|
Price |
price |
|
Returns
Subtraction(Price, Int32)
Declaration
public static Price operator -(Price price, int tick)
Parameters
Type |
Name |
Description |
Price |
price |
|
Int32 |
tick |
|
Returns
Subtraction(Price, Price)
Declaration
public static Price operator -(Price left, Price right)
Parameters
Returns
Implements
System.IEquatable<T>
System.IEquatable<T>
System.IComparable<T>
System.IComparable<T>