Click or drag to resize

TraderHelperGetCurrentPrice Method (MarketDepth, Sides, MarketPriceTypes, IEnumerableOrder)

To calculate the current price by the order book depending on the order direction.

Namespace:  StockSharp.Algo
Assembly:  StockSharp.Algo (in StockSharp.Algo.dll) Version: 4.4.16.0 (4.4.16)
Syntax
C#
public static Unit GetCurrentPrice(
	this MarketDepth depth,
	Sides side,
	MarketPriceTypes priceType = MarketPriceTypes.Following,
	IEnumerable<Order> orders = null
)

Parameters

depth
Type: StockSharp.BusinessEntitiesMarketDepth
The order book for the current price calculation.
side
Type: StockSharp.MessagesSides
The order direction. If it is a buy, BestAsk value is used, otherwise BestBid.
priceType (Optional)
Type: StockSharp.AlgoMarketPriceTypes
The type of current price.
orders (Optional)
Type: System.Collections.GenericIEnumerableOrder
Orders to be ignored.

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 MarketDepth. 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).
Remarks
For correct operation of the method the order book export shall be launched.
See Also