Struct Quantity
Provides methods and properties for accessing quantity data
Assembly: tt-net-api.dll
Syntax
Fields
Empty
Represents an empty quantity
Declaration
public static readonly Quantity Empty
Field Value
Invalid
Represents an invalid quantity
Declaration
public static readonly Quantity Invalid
Field Value
Properties
InstrumentDetails
Returns the Instrument details associated with this quantity
Declaration
public InstrumentDetails InstrumentDetails { get; }
Property Value
InvalidFlowValue
Declaration
public static int InvalidFlowValue { get; }
Property Value
InvalidValue
Declaration
public static decimal InvalidValue { get; }
Property Value
IsValid
Indicates whether this quantity 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 Quantity Add(int tick)
Parameters
Type |
Name |
Description |
int |
tick |
|
Returns
Add(Quantity)
Declaration
public Quantity Add(Quantity p1)
Parameters
Returns
CompareTo(decimal)
Declaration
public int CompareTo(decimal quantity)
Parameters
Type |
Name |
Description |
decimal |
quantity |
|
Returns
CompareTo(Quantity)
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(Quantity other)
Parameters
Type |
Name |
Description |
Quantity |
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 Quantity Divide(int tick)
Parameters
Type |
Name |
Description |
int |
tick |
|
Returns
Divide(Quantity)
Declaration
public Quantity Divide(Quantity p1)
Parameters
Returns
Equals(decimal)
Declaration
public bool Equals(decimal qty)
Parameters
Returns
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
|
Returns
Overrides
Equals(Quantity)
Declaration
public bool Equals(Quantity obj)
Parameters
Returns
FromDecimal(Instrument, decimal, Rounding)
Creates a Quantity object from a decimal value
Declaration
public static Quantity FromDecimal(Instrument instrument, decimal qty, Rounding rnd = Rounding.None)
Parameters
Returns
FromFlow(Instrument, int, Rounding)
Creates a Quantity object from a flow value with or without rounding.
Declaration
public Quantity FromFlow(Instrument instr, int flow, Rounding rnd = Rounding.None)
Parameters
Returns
FromString(Instrument, string, Rounding)
Creates a Quantity object from a string value with or without rounding.
Declaration
public static Quantity FromString(Instrument instr, string sQty, Rounding rnd = Rounding.None)
Parameters
Returns
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
IsEmpty(Quantity)
Indicates whether a quantity is empty
Declaration
public static bool IsEmpty(Quantity qty)
Parameters
Type |
Name |
Description |
Quantity |
qty |
The quantity to test
|
Returns
Multiply(int)
Declaration
public Quantity Multiply(int tick)
Parameters
Type |
Name |
Description |
int |
tick |
|
Returns
Multiply(Quantity)
Multiplication operators.
Declaration
public Quantity Multiply(Quantity p1)
Parameters
Returns
Offset(int, Rounding)
Return the current quantity which is offset for a given amount.
Declaration
public Quantity Offset(int offset, Rounding rnd)
Parameters
Returns
Subtract(int)
Declaration
public Quantity Subtract(int tick)
Parameters
Type |
Name |
Description |
int |
tick |
|
Returns
Subtract(Quantity)
Declaration
public Quantity Subtract(Quantity p1)
Parameters
Returns
ToDecimal()
Express the quantity as a decimal.
Declaration
public decimal ToDecimal()
Returns
ToFlow()
Returns it as an integer value representing the contract quantity
Declaration
Returns
ToString()
Express the price as a string.
Declaration
public override string ToString()
Returns
Overrides
Operators
operator +(int, Quantity)
Declaration
public static Quantity operator +(int tick, Quantity price)
Parameters
Returns
operator +(Quantity, int)
Declaration
public static Quantity operator +(Quantity price, int tick)
Parameters
Returns
operator +(Quantity, Quantity)
Declaration
public static Quantity operator +(Quantity left, Quantity right)
Parameters
Returns
operator --(Quantity)
Declaration
public static Quantity operator --(Quantity price)
Parameters
Returns
operator /(int, Quantity)
Declaration
public static Quantity operator /(int tick, Quantity price)
Parameters
Returns
operator /(Quantity, int)
Declaration
public static Quantity operator /(Quantity price, int tick)
Parameters
Returns
operator /(Quantity, Quantity)
Declaration
public static Quantity operator /(Quantity left, Quantity right)
Parameters
Returns
operator ==(decimal, Quantity)
Declaration
public static bool operator ==(decimal left, Quantity right)
Parameters
Returns
operator ==(Quantity, decimal)
Declaration
public static bool operator ==(Quantity left, decimal right)
Parameters
Returns
operator ==(Quantity, Quantity)
Declaration
public static bool operator ==(Quantity left, Quantity right)
Parameters
Returns
operator >(decimal, Quantity)
Declaration
public static bool operator >(decimal left, Quantity right)
Parameters
Returns
operator >(Quantity, decimal)
Declaration
public static bool operator >(Quantity left, decimal right)
Parameters
Returns
operator >(Quantity, Quantity)
Declaration
public static bool operator >(Quantity left, Quantity right)
Parameters
Returns
operator >=(decimal, Quantity)
Declaration
public static bool operator >=(decimal left, Quantity right)
Parameters
Returns
operator >=(Quantity, decimal)
Declaration
public static bool operator >=(Quantity left, decimal right)
Parameters
Returns
operator >=(Quantity, Quantity)
Declaration
public static bool operator >=(Quantity left, Quantity right)
Parameters
Returns
implicit operator decimal(Quantity)
Declaration
public static implicit operator decimal(Quantity obj)
Parameters
Returns
operator ++(Quantity)
Declaration
public static Quantity operator ++(Quantity price)
Parameters
Returns
operator !=(decimal, Quantity)
Declaration
public static bool operator !=(decimal left, Quantity right)
Parameters
Returns
operator !=(Quantity, decimal)
Declaration
public static bool operator !=(Quantity left, decimal right)
Parameters
Returns
operator !=(Quantity, Quantity)
Declaration
public static bool operator !=(Quantity left, Quantity right)
Parameters
Returns
operator <(decimal, Quantity)
Declaration
public static bool operator <(decimal left, Quantity right)
Parameters
Returns
operator <(Quantity, decimal)
Declaration
public static bool operator <(Quantity left, decimal right)
Parameters
Returns
operator <(Quantity, Quantity)
Declaration
public static bool operator <(Quantity left, Quantity right)
Parameters
Returns
operator <=(decimal, Quantity)
Declaration
public static bool operator <=(decimal left, Quantity right)
Parameters
Returns
operator <=(Quantity, decimal)
Declaration
public static bool operator <=(Quantity left, decimal right)
Parameters
Returns
operator <=(Quantity, Quantity)
Declaration
public static bool operator <=(Quantity left, Quantity right)
Parameters
Returns
operator *(int, Quantity)
Declaration
public static Quantity operator *(int tick, Quantity price)
Parameters
Returns
operator *(Quantity, int)
Declaration
public static Quantity operator *(Quantity price, int tick)
Parameters
Returns
operator *(Quantity, Quantity)
Declaration
public static Quantity operator *(Quantity left, Quantity right)
Parameters
Returns
operator -(int, Quantity)
Declaration
public static Quantity operator -(int tick, Quantity price)
Parameters
Returns
operator -(Quantity, int)
Declaration
public static Quantity operator -(Quantity price, int tick)
Parameters
Returns
operator -(Quantity, Quantity)
Declaration
public static Quantity operator -(Quantity left, Quantity right)
Parameters
Returns