Click or drag to resize

TraderHelperGetCurrentPrice Method (MarketDepthPair, Sides, MarketPriceTypes)

To calculate the current price based on the best pair of quotes, depending on the order direction.

Namespace:  StockSharp.Algo
Assembly:  StockSharp.Algo (in StockSharp.Algo.dll) Version: (4.4.16)
public static Unit GetCurrentPrice(
	this MarketDepthPair bestPair,
	Sides side,
	MarketPriceTypes priceType = MarketPriceTypes.Following


Type: StockSharp.BusinessEntitiesMarketDepthPair
The best pair of quotes, used for the current price calculation.
Type: StockSharp.MessagesSides
The order direction. If it is a buy, Ask value is used, otherwise Bid.
priceType (Optional)
Type: StockSharp.AlgoMarketPriceTypes
The type of current price.

Return Value

Type: Unit
The current price. If information in order book is insufficient, then will be returned.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type MarketDepthPair. 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).
For correct operation of the method the order book export shall be launched.
See Also