Table of Contents

Class UnitHelper

Namespace
StockSharp.Messages
Assembly
StockSharp.Messages.dll

Extension class for Unit.

public static class UnitHelper
Inheritance
UnitHelper
Inherited Members

Methods

Percents(decimal)

Convert the decimal to percents.

public static Unit Percents(this decimal value)

Parameters

value decimal

decimal value.

Returns

Unit

Percents.

Percents(double)

Convert the double to percents.

public static Unit Percents(this double value)

Parameters

value double

double value.

Returns

Unit

Percents.

Percents(int)

Convert the int to percents.

public static Unit Percents(this int value)

Parameters

value int

int value.

Returns

Unit

Percents.

Times(Unit, int)

Multiple Value on the specified times.

public static Unit Times(this Unit unit, int times)

Parameters

unit Unit

Unit.

times int

Multiply value.

Returns

Unit

Result.

ToUnit(string, bool, Func<UnitTypes, decimal?>)

Convert string to Unit.

public static Unit ToUnit(this string str, bool throwIfNull = true, Func<UnitTypes, decimal?> getTypeValue = null)

Parameters

str string

String value of Unit.

throwIfNull bool

Throw ArgumentNullException if the specified string is empty.

getTypeValue Func<UnitTypes, decimal?>

The handler returns a value associated with Type (price or volume steps).

Returns

Unit

Object Unit.