Click or drag to resize

TraderHelperSubscribeTrades Method

To start getting trades (tick data) by the instrument. New trades will come through the event NewTrade.

Namespace:  StockSharp.Algo
Assembly:  StockSharp.Algo (in StockSharp.Algo.dll) Version: 5.0.0.0 (5.0.0)
Syntax
C#
public static Subscription SubscribeTrades(
	this ISubscriptionProvider provider,
	Security security,
	Nullable<DateTimeOffset> from = null,
	Nullable<DateTimeOffset> to = null,
	Nullable<long> count = null,
	MarketDataBuildModes buildMode = MarketDataBuildModes.LoadAndBuild,
	DataType buildFrom = null,
	IMessageAdapter adapter = null,
	Nullable<long> skip = null
)

Parameters

provider
Type: StockSharp.AlgoISubscriptionProvider
Subscription provider.
security
Type: StockSharp.BusinessEntitiesSecurity
The instrument by which trades getting should be started.
from (Optional)
Type: SystemNullableDateTimeOffset
The initial date from which you need to get data.
to (Optional)
Type: SystemNullableDateTimeOffset
The final date by which you need to get data.
count (Optional)
Type: SystemNullableInt64
Max count.
buildMode (Optional)
Type: StockSharp.MessagesMarketDataBuildModes
Build mode.
buildFrom (Optional)
Type: StockSharp.MessagesDataType
Which market-data type is used as a source value.
adapter (Optional)
Type: StockSharp.MessagesIMessageAdapter
Target adapter. Can be .
skip (Optional)
Type: SystemNullableInt64
Skip count.

Return Value

Type: Subscription
Subscription.

Usage Note

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