Click or drag to resize

TraderHelperGetCurrentPrice Method (Security, IMarketDataProvider, NullableSides, MarketPriceTypes, IEnumerableOrder)

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

Namespace:  StockSharp.Algo
Assembly:  StockSharp.Algo (in StockSharp.Algo.dll) Version: (4.4.16)
public static Unit GetCurrentPrice(
	this Security security,
	IMarketDataProvider provider,
	Nullable<Sides> direction = null,
	MarketPriceTypes priceType = MarketPriceTypes.Following,
	IEnumerable<Order> orders = null


Type: StockSharp.BusinessEntitiesSecurity
The instrument used for the current price calculation.
Type: StockSharp.BusinessEntitiesIMarketDataProvider
The market data provider.
direction (Optional)
Type: SystemNullableSides
Order side.
priceType (Optional)
Type: StockSharp.AlgoMarketPriceTypes
The type of market 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 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