Struct Quantity
Provides methods and properties for accessing quantity data
Inherited Members
Object.Equals(Object, Object)
Object.GetType()
Object.ReferenceEquals(Object, Object)
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(Int32)
Declaration
public Quantity Add(int tick)
Parameters
Type |
Name |
Description |
Int32 |
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 |
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 Quantity Divide(int tick)
Parameters
Type |
Name |
Description |
Int32 |
tick |
|
Returns
Divide(Quantity)
Declaration
public Quantity Divide(Quantity p1)
Parameters
Returns
Equals(Decimal)
Declaration
public bool Equals(decimal qty)
Parameters
Type |
Name |
Description |
Decimal |
qty |
|
Returns
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
Overrides
System.ValueType.Equals(System.Object)
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, Int32, 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
Type |
Name |
Description |
Instrument |
instr |
Instrument
|
String |
sQty |
Quantity
|
Rounding |
rnd |
Rounding type
|
Returns
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
System.ValueType.GetHashCode()
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(Int32)
Declaration
public Quantity Multiply(int tick)
Parameters
Type |
Name |
Description |
Int32 |
tick |
|
Returns
Multiply(Quantity)
Multiplication operators.
Declaration
public Quantity Multiply(Quantity p1)
Parameters
Returns
Offset(Int32, Rounding)
Return the current quantity which is offset for a given amount.
Declaration
public Quantity Offset(int offset, Rounding rnd)
Parameters
Type |
Name |
Description |
Int32 |
offset |
|
Rounding |
rnd |
|
Returns
Subtract(Int32)
Declaration
public Quantity Subtract(int tick)
Parameters
Type |
Name |
Description |
Int32 |
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
System.ValueType.ToString()
Operators
Addition(Int32, Quantity)
Declaration
public static Quantity operator +(int tick, Quantity price)
Parameters
Type |
Name |
Description |
Int32 |
tick |
|
Quantity |
price |
|
Returns
Addition(Quantity, Int32)
Declaration
public static Quantity operator +(Quantity price, int tick)
Parameters
Type |
Name |
Description |
Quantity |
price |
|
Int32 |
tick |
|
Returns
Addition(Quantity, Quantity)
Declaration
public static Quantity operator +(Quantity left, Quantity right)
Parameters
Returns
Decrement(Quantity)
Declaration
public static Quantity operator --(Quantity price)
Parameters
Returns
Division(Int32, Quantity)
Declaration
public static Quantity operator /(int tick, Quantity price)
Parameters
Type |
Name |
Description |
Int32 |
tick |
|
Quantity |
price |
|
Returns
Division(Quantity, Int32)
Declaration
public static Quantity operator /(Quantity price, int tick)
Parameters
Type |
Name |
Description |
Quantity |
price |
|
Int32 |
tick |
|
Returns
Division(Quantity, Quantity)
Declaration
public static Quantity operator /(Quantity left, Quantity right)
Parameters
Returns
Equality(Decimal, Quantity)
Declaration
public static bool operator ==(decimal left, Quantity right)
Parameters
Type |
Name |
Description |
Decimal |
left |
|
Quantity |
right |
|
Returns
Equality(Quantity, Decimal)
Declaration
public static bool operator ==(Quantity left, decimal right)
Parameters
Type |
Name |
Description |
Quantity |
left |
|
Decimal |
right |
|
Returns
Equality(Quantity, Quantity)
Declaration
public static bool operator ==(Quantity left, Quantity right)
Parameters
Returns
GreaterThan(Decimal, Quantity)
Declaration
public static bool operator>(decimal left, Quantity right)
Parameters
Type |
Name |
Description |
Decimal |
left |
|
Quantity |
right |
|
Returns
GreaterThan(Quantity, Decimal)
Declaration
public static bool operator>(Quantity left, decimal right)
Parameters
Type |
Name |
Description |
Quantity |
left |
|
Decimal |
right |
|
Returns
GreaterThan(Quantity, Quantity)
Declaration
public static bool operator>(Quantity left, Quantity right)
Parameters
Returns
GreaterThanOrEqual(Decimal, Quantity)
Declaration
public static bool operator >=(decimal left, Quantity right)
Parameters
Type |
Name |
Description |
Decimal |
left |
|
Quantity |
right |
|
Returns
GreaterThanOrEqual(Quantity, Decimal)
Declaration
public static bool operator >=(Quantity left, decimal right)
Parameters
Type |
Name |
Description |
Quantity |
left |
|
Decimal |
right |
|
Returns
GreaterThanOrEqual(Quantity, Quantity)
Declaration
public static bool operator >=(Quantity left, Quantity right)
Parameters
Returns
Implicit(Quantity to Decimal)
Declaration
public static implicit operator decimal (Quantity obj)
Parameters
Returns
Increment(Quantity)
Declaration
public static Quantity operator ++(Quantity price)
Parameters
Returns
Inequality(Decimal, Quantity)
Declaration
public static bool operator !=(decimal left, Quantity right)
Parameters
Type |
Name |
Description |
Decimal |
left |
|
Quantity |
right |
|
Returns
Inequality(Quantity, Decimal)
Declaration
public static bool operator !=(Quantity left, decimal right)
Parameters
Type |
Name |
Description |
Quantity |
left |
|
Decimal |
right |
|
Returns
Inequality(Quantity, Quantity)
Declaration
public static bool operator !=(Quantity left, Quantity right)
Parameters
Returns
LessThan(Decimal, Quantity)
Declaration
public static bool operator <(decimal left, Quantity right)
Parameters
Type |
Name |
Description |
Decimal |
left |
|
Quantity |
right |
|
Returns
LessThan(Quantity, Decimal)
Declaration
public static bool operator <(Quantity left, decimal right)
Parameters
Type |
Name |
Description |
Quantity |
left |
|
Decimal |
right |
|
Returns
LessThan(Quantity, Quantity)
Declaration
public static bool operator <(Quantity left, Quantity right)
Parameters
Returns
LessThanOrEqual(Decimal, Quantity)
Declaration
public static bool operator <=(decimal left, Quantity right)
Parameters
Type |
Name |
Description |
Decimal |
left |
|
Quantity |
right |
|
Returns
LessThanOrEqual(Quantity, Decimal)
Declaration
public static bool operator <=(Quantity left, decimal right)
Parameters
Type |
Name |
Description |
Quantity |
left |
|
Decimal |
right |
|
Returns
LessThanOrEqual(Quantity, Quantity)
Declaration
public static bool operator <=(Quantity left, Quantity right)
Parameters
Returns
Multiply(Int32, Quantity)
Declaration
public static Quantity operator *(int tick, Quantity price)
Parameters
Type |
Name |
Description |
Int32 |
tick |
|
Quantity |
price |
|
Returns
Multiply(Quantity, Int32)
Declaration
public static Quantity operator *(Quantity price, int tick)
Parameters
Type |
Name |
Description |
Quantity |
price |
|
Int32 |
tick |
|
Returns
Multiply(Quantity, Quantity)
Declaration
public static Quantity operator *(Quantity left, Quantity right)
Parameters
Returns
Subtraction(Int32, Quantity)
Declaration
public static Quantity operator -(int tick, Quantity price)
Parameters
Type |
Name |
Description |
Int32 |
tick |
|
Quantity |
price |
|
Returns
Subtraction(Quantity, Int32)
Declaration
public static Quantity operator -(Quantity price, int tick)
Parameters
Type |
Name |
Description |
Quantity |
price |
|
Int32 |
tick |
|
Returns
Subtraction(Quantity, Quantity)
Declaration
public static Quantity operator -(Quantity left, Quantity right)
Parameters
Returns