Lean  $LEAN_TAG$
ISubscriptionDataConfigService.cs
1 /*
2  * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
3  * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  *
15 */
16 
17 using System;
18 using System.Collections.Generic;
19 using QuantConnect.Data;
20 
22 {
23  /// <summary>
24  /// This interface exposes methods for creating a list of <see cref="SubscriptionDataConfig" /> for a given
25  /// configuration
26  /// </summary>
28  {
29  /// <summary>
30  /// Creates and adds a list of <see cref="SubscriptionDataConfig" /> for a given symbol and configuration.
31  /// Can optionally pass in desired subscription data type to use.
32  /// If the config already existed will return existing instance instead
33  /// </summary>
35  Type dataType,
36  Symbol symbol,
37  Resolution? resolution = null,
38  bool fillForward = true,
39  bool extendedMarketHours = false,
40  bool isFilteredSubscription = true,
41  bool isInternalFeed = false,
42  bool isCustomData = false,
43  DataNormalizationMode dataNormalizationMode = DataNormalizationMode.Adjusted,
44  DataMappingMode dataMappingMode = DataMappingMode.OpenInterest,
45  uint contractDepthOffset = 0
46  );
47 
48  /// <summary>
49  /// Creates and adds a list of <see cref="SubscriptionDataConfig" /> for a given symbol and configuration.
50  /// Can optionally pass in desired subscription data types to use.
51  /// If the config already existed will return existing instance instead
52  /// </summary>
53  List<SubscriptionDataConfig> Add(
54  Symbol symbol,
55  Resolution? resolution = null,
56  bool fillForward = true,
57  bool extendedMarketHours = false,
58  bool isFilteredSubscription = true,
59  bool isInternalFeed = false,
60  bool isCustomData = false,
61  List<Tuple<Type, TickType>> subscriptionDataTypes = null,
62  DataNormalizationMode dataNormalizationMode = DataNormalizationMode.Adjusted,
63  DataMappingMode dataMappingMode = DataMappingMode.OpenInterest,
64  uint contractDepthOffset = 0
65  );
66 
67  /// <summary>
68  /// Get the data feed types for a given <see cref="SecurityType" /> <see cref="Resolution" />
69  /// </summary>
70  /// <param name="symbolSecurityType">The <see cref="SecurityType" /> used to determine the types</param>
71  /// <param name="resolution">The resolution of the data requested</param>
72  /// <param name="isCanonical">Indicates whether the security is Canonical (future and options)</param>
73  /// <returns>Types that should be added to the <see cref="SubscriptionDataConfig" /></returns>
74  List<Tuple<Type, TickType>> LookupSubscriptionConfigDataTypes(
75  SecurityType symbolSecurityType,
76  Resolution resolution,
77  bool isCanonical
78  );
79 
80  /// <summary>
81  /// Gets the available data types
82  /// </summary>
83  Dictionary<SecurityType, List<TickType>> AvailableDataTypes { get; }
84  }
85 }