Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ namespace QuantConnect.Lean.DataSource.DataBento.Tests;
[TestFixture]
public class DataBentoDataProviderHistoryTests
{
private DataBentoProvider _historyDataProvider;
private DataBentoDataProvider _historyDataProvider;

[SetUp]
public void SetUp()
{
_historyDataProvider = new DataBentoProvider();
_historyDataProvider = new DataBentoDataProvider();
}

[TearDown]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace QuantConnect.Lean.DataSource.DataBento.Tests;
[TestFixture]
public class DataBentoDataQueueHandlerTests
{
private DataBentoProvider _dataProvider;
private DataBentoDataProvider _dataProvider;
private CancellationTokenSource _cancellationTokenSource;

[SetUp]
Expand Down
4 changes: 2 additions & 2 deletions QuantConnect.DataBento.Tests/DataBentoHistoryProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace QuantConnect.Lean.DataSource.DataBento.Tests;
[TestFixture]
public class DataBentoHistoryProviderTests
{
private DataBentoProvider _historyDataProvider;
private DataBentoDataProvider _historyDataProvider;

[OneTimeSetUp]
public void OneTimeSetUp()
Expand All @@ -42,7 +42,7 @@ public void OneTimeSetUp()
Assert.Fail("DataBento API key is not set. Please set 'databento-api-key' in the configuration to run these tests.");
}

_historyDataProvider = new DataBentoProvider(apiKey);
_historyDataProvider = new DataBentoDataProvider(apiKey);
}

[OneTimeTearDown]
Expand Down
4 changes: 2 additions & 2 deletions QuantConnect.DataBento/DataBentoDataDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class DataBentoDataDownloader : IDataDownloader, IDisposable
/// <summary>
/// Provides access to historical market data via the DataBento service.
/// </summary>
private readonly DataBentoProvider _historyProvider;
private readonly DataBentoDataProvider _historyProvider;

/// <summary>
/// Provides exchange trading hours and market-specific time zone information.
Expand All @@ -52,7 +52,7 @@ public DataBentoDataDownloader()
/// <param name="apiKey">The DataBento API key.</param>
public DataBentoDataDownloader(string apiKey)
{
_historyProvider = new DataBentoProvider(apiKey);
_historyProvider = new DataBentoDataProvider(apiKey);
_marketHoursDatabase = MarketHoursDatabase.FromDataFolder();
}

Expand Down
14 changes: 7 additions & 7 deletions QuantConnect.DataBento/DataBentoDataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace QuantConnect.Lean.DataSource.DataBento;
/// Handles Subscribing, Unsubscribing, and fetching historical data from DataBento.
/// It will handle if a symbol is subscribable and will log errors if it is not.
/// </summary>
public partial class DataBentoProvider : IDataQueueHandler
public partial class DataBentoDataProvider : IDataQueueHandler
{
private HistoricalAPIClient _historicalApiClient;

Expand Down Expand Up @@ -72,14 +72,14 @@ public partial class DataBentoProvider : IDataQueueHandler


/// <summary>
/// Initializes a new instance of the DataBentoProvider
/// Initializes a new instance of the DataBentoDataProvider
/// </summary>
public DataBentoProvider()
public DataBentoDataProvider()
: this(Config.Get("databento-api-key"))
{
}

public DataBentoProvider(string apiKey)
public DataBentoDataProvider(string apiKey)
{
if (string.IsNullOrWhiteSpace(apiKey))
{
Expand All @@ -103,7 +103,7 @@ private void Initialize(string apiKey)
if (_aggregator == null)
{
var aggregatorName = Config.Get("data-aggregator", "QuantConnect.Lean.Engine.DataFeeds.AggregationManager");
Log.Trace($"{nameof(DataBentoProvider)}.{nameof(Initialize)}: found no data aggregator instance, creating {aggregatorName}");
Log.Trace($"{nameof(DataBentoDataProvider)}.{nameof(Initialize)}: found no data aggregator instance, creating {aggregatorName}");
_aggregator = Composer.Instance.GetExportedValueByTypeName<IDataAggregator>(aggregatorName, forceTypeNameOnExisting: false);
}

Expand All @@ -127,13 +127,13 @@ private void Initialize(string apiKey)

private void OnConnectionLost(object? _, ConnectionLostEventArgs cle)
{
Log.Trace($"{nameof(DataBentoProvider)}.{nameof(OnConnectionLost)}: The connection was lost. Starting ReSubscription process");
Log.Trace($"{nameof(DataBentoDataProvider)}.{nameof(OnConnectionLost)}: The connection was lost. Starting ReSubscription process");

var symbols = _levelOneServiceManager.GetSubscribedSymbols();

Subscribe(symbols);

Log.Trace($"{nameof(DataBentoProvider)}.{nameof(OnConnectionLost)}: Re-subscription completed successfully for {_levelOneServiceManager.Count} symbol(s).");
Log.Trace($"{nameof(DataBentoDataProvider)}.{nameof(OnConnectionLost)}: Re-subscription completed successfully for {_levelOneServiceManager.Count} symbol(s).");
}

private void OnSymbolMappingConfirmation(object? _, SymbolMappingConfirmationEventArgs smce)
Expand Down
8 changes: 4 additions & 4 deletions QuantConnect.DataBento/DataBentoHistoryProivder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace QuantConnect.Lean.DataSource.DataBento;
/// Implements a history provider for DataBento historical data.
/// Uses consolidators to produce the requested resolution when necessary.
/// </summary>
public partial class DataBentoProvider : MappedSynchronizingHistoryProvider
public partial class DataBentoDataProvider : MappedSynchronizingHistoryProvider
{
private static int _dataPointCount;

Expand Down Expand Up @@ -72,7 +72,7 @@ public override void Initialize(HistoryProviderInitializeParameters parameters)
if (!_invalidSecurityTypeWarningFired)
{
_invalidSecurityTypeWarningFired = true;
Log.Trace($"{nameof(DataBentoProvider)}.{nameof(GetHistory)}:" +
Log.Trace($"{nameof(DataBentoDataProvider)}.{nameof(GetHistory)}:" +
$"History request not supported for symbol '{historyRequest.Symbol}' (SecurityType: {historyRequest.Symbol.SecurityType}, Canonical: {historyRequest.Symbol.IsCanonical()}).");
}
return null;
Expand All @@ -83,7 +83,7 @@ public override void Initialize(HistoryProviderInitializeParameters parameters)
if (!_invalidStartTimeErrorFired)
{
_invalidStartTimeErrorFired = true;
Log.Error($"{nameof(DataBentoProvider)}.{nameof(GetHistory)}: Invalid date range: the start date must be earlier than the end date.");
Log.Error($"{nameof(DataBentoDataProvider)}.{nameof(GetHistory)}: Invalid date range: the start date must be earlier than the end date.");
}
return null;
}
Expand All @@ -93,7 +93,7 @@ public override void Initialize(HistoryProviderInitializeParameters parameters)
if (!_dataBentoDatasetErrorFired)
{
_dataBentoDatasetErrorFired = true;
Log.Error($"{nameof(DataBentoProvider)}.{nameof(GetHistory)}: " +
Log.Error($"{nameof(DataBentoDataProvider)}.{nameof(GetHistory)}: " +
$"DataBento dataset not found for symbol '{historyRequest.Symbol.Value}, Market = {historyRequest.Symbol.ID.Market}."
);
}
Expand Down
Loading