Click or drag to resize

Unit Class

Special class, allows to set the value as a percentage, absolute, points and pips values.
Inheritance Hierarchy
SystemObject
  CloneableUnit
    EquatableUnit
      StockSharp.MessagesUnit

Namespace:  StockSharp.Messages
Assembly:  StockSharp.Messages (in StockSharp.Messages.dll) Version: 4.4.16.0 (4.4.16)
Syntax
C#
[SerializableAttribute]
public class Unit : Equatable<Unit>, IOperable<Unit>, 
	IComparable<Unit>, IPersistable

The Unit type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyGetTypeValue
The handler returns a value associated with Type (price or volume steps).
Public propertyType
Measure unit.
Public propertyValue
Value.
Top
Methods
  NameDescription
Public methodClone
Create a copy of Unit.
(Overrides Cloneable.Clone.)
Public methodCompareTo(Object) (Inherited from EquatableUnit.)
Public methodCompareTo(Unit)
Compare Unit on the equivalence.
(Overrides Equatable.CompareTo(UTP).)
Public methodConvert(UnitTypes)
Cast the value to another type.
Public methodConvert(UnitTypes, FuncUnitTypes, NullableDecimal)
Cast the value to another type.
Public methodEquals(Object)
Compare Unit on the equivalence.
(Overrides Equatable.Equals(Object).)
Public methodEquals(UTP) (Inherited from EquatableUnit.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Get the hash code of the object Unit.
(Overrides Equatable.GetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodLoad
Load settings.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnEquals
Compare Unit on the equivalence.
(Overrides Equatable.OnEquals(UTP).)
Public methodSave
Save settings.
Public methodToString
Returns a string that represents the current object.
(Overrides ObjectToString.)
Top
Operators
  NameDescription
Public operatorStatic memberAddition
Add the two objects Unit.
Public operatorStatic memberDivision
Divide the unit Unit to another.
Public operatorStatic memberEquality
Compare two values for equality (if the value of different types, the conversion will be used).
Public operatorStatic member(Unit to Decimal)
Cast object from Unit to Decimal.
Public operatorStatic member(Unit to Double)
Cast object from Unit to Double.
Public operatorStatic memberGreaterThan
Check whether the first value is greater than the second.
Public operatorStatic memberGreaterThanOrEqual
Check whether the first value is greater than or equal to the second.
Public operatorStatic member(Decimal to Unit)
Cast Decimal object to the type Unit.
Public operatorStatic member(Double to Unit)
Cast Double object to the type Unit.
Public operatorStatic member(Int32 to Unit)
Cast Int32 object to the type Unit.
Public operatorStatic memberInequality
Compare two values in the inequality (if the value of different types, the conversion will be used).
Public operatorStatic memberLessThan
Check whether the first value is less than the second.
Public operatorStatic memberLessThanOrEqual
Check whether the first value is less than or equal to the second.
Public operatorStatic memberMultiply
Multiply the two objects Unit.
Public operatorStatic memberSubtraction
Subtract the unit Unit from another.
Public operatorStatic memberUnaryNegation
Get the value with the opposite sign from the value Value.
Top
Extension Methods
  NameDescription
Public Extension MethodApplyOffset
To use shifting for price, depending on direction side.
(Defined by TraderHelper.)
Public Extension MethodConvert
Cast the value to another type.
(Defined by UnitHelper2.)
Public Extension MethodSetSecurity
To set the GetTypeValue property for the value.
(Defined by UnitHelper2.)
Top
See Also