Click or drag to resize

TraderHelperGetAveragePrice Method (IEnumerableMyTrade)

To get the weighted mean price of matching by own trades.

Namespace:  StockSharp.Algo
Assembly:  StockSharp.Algo (in StockSharp.Algo.dll) Version: (4.4.17)
public static decimal GetAveragePrice(
	this IEnumerable<MyTrade> trades


Type: System.Collections.GenericIEnumerableMyTrade
Trades, for which the weighted mean price of matching shall be got.

Return Value

Type: Decimal
The weighted mean price. If no trades, 0 is returned.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableMyTrade. 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