Click or drag to resize

TraderHelperShrinkPrice Method (Security, Decimal, ShrinkRules)

To cut the price, to make it multiple of minimal step, also to limit number of signs after the comma.

Namespace:  StockSharp.Algo
Assembly:  StockSharp.Algo (in StockSharp.Algo.dll) Version: (4.4.16)
public static decimal ShrinkPrice(
	this Security security,
	decimal price,
	ShrinkRules rule = ShrinkRules.Auto


Type: StockSharp.BusinessEntitiesSecurity
The instrument from which the PriceStep and Decimals values are taken.
Type: SystemDecimal
The price to be made multiple.
rule (Optional)
Type: StockSharp.AlgoShrinkRules
The price rounding rule.

Return Value

Type: Decimal
The multiple price.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Security. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also