Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
c60968d
Initial code for DataBento Implementation.
Joseph-Matteo-Scorsone Sep 23, 2025
8208365
Got rid of my data type to use QuantConnects TradeBar and QuoteBar an…
Joseph-Matteo-Scorsone Sep 25, 2025
d6e734a
Updates for tests and bug fixes
Joseph-Matteo-Scorsone Oct 13, 2025
972017f
Needed to be .c not .v for Continuous
Joseph-Matteo-Scorsone Oct 13, 2025
580759a
Better code for authentication with cram.
Joseph-Matteo-Scorsone Oct 14, 2025
141d3c2
Merge branch 'databento-integration' of https://github.com/Joseph-Mat…
Joseph-Matteo-Scorsone Oct 14, 2025
7e04cb4
Additions to ticker formatting, prop[er auth receiving.
Joseph-Matteo-Scorsone Oct 17, 2025
2882977
Merge branch 'databento-integration' of https://github.com/Joseph-Mat…
Joseph-Matteo-Scorsone Oct 17, 2025
901bcc5
Authentication and message flow finalized. Consolidated data properly…
Joseph-Matteo-Scorsone Oct 20, 2025
2a958c7
Properly get trade and quote ticks. properly push OHLCV data
Joseph-Matteo-Scorsone Oct 20, 2025
5fbb1f3
Tidy up, few more comments also fixed bug to get bars without being e…
Joseph-Matteo-Scorsone Oct 21, 2025
6f57a67
Delete QuantConnect.DataBento.Tests/obj/Debug/net9.0 directory
Joseph-Matteo-Scorsone Oct 21, 2025
e33430d
Added history provider and show demonstration of it in example.
Joseph-Matteo-Scorsone Nov 5, 2025
c54a4d1
Merge branch 'databento-integration' of https://github.com/Joseph-Mat…
Joseph-Matteo-Scorsone Nov 5, 2025
8e5574c
Not needed files
Joseph-Matteo-Scorsone Nov 5, 2025
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
54 changes: 54 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build & Test

on:
push:
branches: ['*']
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Liberate disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
large-packages: false
docker-images: false
swap-storage: false

- name: Checkout Lean Same Branch
id: lean-same-branch
uses: actions/checkout@v2
continue-on-error: true
with:
ref: ${{ github.ref }}
repository: QuantConnect/Lean
path: Lean

- name: Checkout Lean Master
if: steps.lean-same-branch.outcome != 'success'
uses: actions/checkout@v2
with:
repository: QuantConnect/Lean
path: Lean

- name: Move Lean
run: mv Lean ../Lean

- uses: addnab/docker-run-action@v3
with:
image: quantconnect/lean:foundation
options: --workdir /__w/Lean.DataSource.SDK/Lean.DataSource.SDK -v /home/runner/work:/__w
shell: bash
run: |
# BuildDataSource
dotnet build ./QuantConnect.DataSource.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1 && \
# BuildTests
dotnet build ./tests/Tests.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1 && \
# Run Tests
dotnet test ./tests/bin/Release/net9.0/Tests.dll
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,16 @@ modules.order
Module.symvers
Mkfile.old
dkms.conf

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
.vs/
build/
bld/
[Bb]in/
[Oo]bj/
82 changes: 82 additions & 0 deletions Demonstration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

using QuantConnect.Algorithm;
using QuantConnect.Data.Market;
using QuantConnect.Interfaces;
using QuantConnect;
using QuantConnect.Data;
using QuantConnect.Securities.Future;
using QuantConnect.Util;
using System;

namespace QuantConnect.Algorithm.CSharp
{
public class DatabentoFuturesTestAlgorithm : QCAlgorithm
{
private Future _es;

public override void Initialize()
{
Log("Algorithm Initialize");

SetStartDate(2025, 10, 1);
SetEndDate(2025, 10, 16);
SetCash(100000);

var exp = new DateTime(2025, 12, 19);
var symbol = QuantConnect.Symbol.CreateFuture("ES", Market.CME, exp);
_es = AddFutureContract(symbol, Resolution.Second, true, 1, true);
}

public override void OnData(Slice slice)
{
if (!slice.HasData)
{
Log("Slice has no data");
return;
}

Log($"OnData: Slice has {slice.Count} data points");

// For Tick resolution, check Ticks collection
if (slice.Ticks.ContainsKey(_es.Symbol))
{
var ticks = slice.Ticks[_es.Symbol];
Log($"Received {ticks.Count} ticks for {_es.Symbol}");

foreach (var tick in ticks)
{
if (tick.TickType == TickType.Trade)
{
Log($"Trade Tick - Price: {tick.Price}, Quantity: {tick.Quantity}, Time: {tick.Time}");
}
else if (tick.TickType == TickType.Quote)
{
Log($"Quote Tick - Bid: {tick.BidPrice}x{tick.BidSize}, Ask: {tick.AskPrice}x{tick.AskSize}, Time: {tick.Time}");
}
}
}

// These won't have data for Tick resolution
if (slice.Bars.ContainsKey(_es.Symbol))
{
var bar = slice.Bars[_es.Symbol];
Log($"Bar - O:{bar.Open} H:{bar.High} L:{bar.Low} C:{bar.Close} V:{bar.Volume}");
}
}
}
}
28 changes: 28 additions & 0 deletions DemonstrationUniverse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

using System.Linq;
using QuantConnect.Data.UniverseSelection;
using QuantConnect.DataSource;

namespace QuantConnect.Algorithm.CSharp
{
/// <summary>
/// Example algorithm using the custom data type as a source of alpha
/// </summary>
public class CustomDataUniverse : QCAlgorithm
{ }
}
34 changes: 34 additions & 0 deletions Lean.DataSource.DataBento.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.2.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuantConnect.DataBento", "QuantConnect.DataBento\QuantConnect.DataSource.DataBento.csproj", "{367AEEDC-F0B3-7F47-539D-10E5EC242C2A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuantConnect.DataBento.Tests", "QuantConnect.DataBento.Tests\QuantConnect.DataSource.DataBento.Tests.csproj", "{9CF47860-2CEA-F379-09D8-9AEF27965D12}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{367AEEDC-F0B3-7F47-539D-10E5EC242C2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{367AEEDC-F0B3-7F47-539D-10E5EC242C2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{367AEEDC-F0B3-7F47-539D-10E5EC242C2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{367AEEDC-F0B3-7F47-539D-10E5EC242C2A}.Release|Any CPU.Build.0 = Release|Any CPU
{4B379C8F-16CE-1972-73E3-C14F6410D428}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B379C8F-16CE-1972-73E3-C14F6410D428}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B379C8F-16CE-1972-73E3-C14F6410D428}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B379C8F-16CE-1972-73E3-C14F6410D428}.Release|Any CPU.Build.0 = Release|Any CPU
{9CF47860-2CEA-F379-09D8-9AEF27965D12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9CF47860-2CEA-F379-09D8-9AEF27965D12}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9CF47860-2CEA-F379-09D8-9AEF27965D12}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9CF47860-2CEA-F379-09D8-9AEF27965D12}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CE272A88-90FF-4452-B402-D3AD0D08FB15}
EndGlobalSection
EndGlobal
Loading