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
33 changes: 22 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,28 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
container:
image: quantconnect/lean:foundation
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: BuildDataSource
run: dotnet build ./QuantConnect.DataSource.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1
- name: Liberate disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
large-packages: false
docker-images: false
swap-storage: false

- name: BuildTests
run: dotnet build ./tests/Tests.csproj /p:Configuration=Release /v:quiet /p:WarningLevel=1

- name: Run Tests
run: dotnet test ./tests/bin/Release/net6.0/Tests.dll
- uses: addnab/docker-run-action@v3
with:
image: quantconnect/lean:foundation
options: --workdir /__w/Lean.DataSource.SmartInsiderIntentionsTransactions/Lean.DataSource.SmartInsiderIntentionsTransactions -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
2 changes: 1 addition & 1 deletion DataProcessing/DataProcessing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<AssemblyName>process</AssemblyName>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion QuantConnect.DataSource.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>QuantConnect.DataSource</RootNamespace>
<AssemblyName>QuantConnect.DataSource.SmartInsiderIntentionsTransactions</AssemblyName>
<OutputPath>bin\$(Configuration)</OutputPath>
Expand Down
4 changes: 2 additions & 2 deletions SmartInsiderTransactionUniverseTestAlgorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ public override void Initialize()
AddUniverse<SmartInsiderTransactionUniverse>("SmartInsiderTransactionUniverse", Resolution.Daily, UniverseSelectionMethod);
}

private IEnumerable<Symbol> UniverseSelectionMethod(IEnumerable<SmartInsiderTransactionUniverse> data)
private IEnumerable<Symbol> UniverseSelectionMethod(IEnumerable<BaseData> data)
{
_datum = data.FirstOrDefault(datum => datum.Symbol.Value == _symbol.Value);
_datum = data.OfType<SmartInsiderTransactionUniverse>().FirstOrDefault(datum => datum.Symbol.Value == _symbol.Value);

if (_datum != null)
{
Expand Down
9 changes: 9 additions & 0 deletions tests/SmartInsiderIntentionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,22 @@
using Newtonsoft.Json;
using NUnit.Framework;
using QuantConnect.Data;
using QuantConnect.Data.Auxiliary;
using QuantConnect.DataSource;
using QuantConnect.Interfaces;
using QuantConnect.Util;

namespace QuantConnect.DataLibrary.Tests
{
[TestFixture]
public class SmartInsiderIntentionTests
{
[OneTimeSetUp]
public void Setup()
{
Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(Configuration.Config.Get("map-file-provider", typeof(LocalDiskMapFileProvider).Name));
}

[TestCase("\"TransactionID\" \"BuybackType\" \"LastUpdate\" \"LastIDsUpdate\" \"ISIN\" \"USDMarketCap\" \"CompanyID\" \"companyPageURL\" \"ICBIndustry\" \"ICBSuperSector\" \"ICBSector\" \"ICBSubSector\" \"ICBCode\" \"CompanyName\" \"ShortCompanyName\" \"previousResultsAnnsDate\" \"nextResultsAnnsDate\" \"nextCloseBegin\" \"LastCloseEnded\" \"SecurityDescription\" \"TickerCountry\" \"TickerSymbol\" \"BuybackDate\" \"BybackVia\" \"BybackBy\" \"HoldingType\" \"Currency\" \"Price\" \"TransactionAmount\" \"GBPValue\" \"EURValue\" \"USDValue\" \"NoteText\" \"BuybackPercentage\" \"VolumePercentage\" \"ConvRate\" \"previousClosePrice\" \"AmountAdjFactor\" \"PriceAdjFactor\" \"TreasuryHolding\" \"AnnouncementDate\" \"TimeReleased\" \"TimeProcessed\" \"TimeReleasedGMT\" \"TimeProcessedGMT\" \"AnnouncedIn\" \"showOriginal\" \"IntentionVia\" \"IntentionBy\" \"BuybackIntentionHoldingType\" \"IntentionAmount\" \"ValueCurrency\" \"IntentionValue\" \"IntentionPercentage\" \"StartDate\" \"EndDate\" \"PriceCurrency\" \"MinimumPrice\" \"MaximumPrice\" \"BuybackIntentionNoteText\" \"UserVarChar1\" \"UserVarChar2\" \"UserVarChar3\" \"UserVarChar4\" \"UserVarChar5\" \"SystemVarChar1\" \"SystemVarChar2\" \"SystemVarChar3\" \"SystemVarChar4\" \"SystemVarChar5\" \"UserNumber1\" \"UserNumber2\" \"UserNumber3\" \"UserNumber4\" \"UserNumber5\" \"SystemNumber1\" \"SystemNumber2\" \"SystemNumber3\" \"SystemNumber4\" \"SystemNumber5\" \"UserInteger1\" \"UserInteger2\" \"UserInteger3\" \"UserInteger4\" \"UserInteger5\" \"SystemInteger1\" \"SystemInteger2\" \"SystemInteger3\" \"SystemInteger4\" \"SystemInteger5\" \"UserDateTime1\" \"UserDateTime2\" \"UserDateTime3\" \"UserDateTime4\" \"UserDateTime5\" \"SystemDateTime1\" \"SystemDateTime2\" \"SystemDateTime3\" \"SystemDateTime4\" \"SystemDateTime5\"",
"\"BI15149\" \"Authorisation\" 2021-08-01 2021-08-02 \"IT0001044996\" \"\" 88056 \"https://data.smartinsider.com/members/company?c=15149\" \"Financials\" \"Financial Services\" \"Investment Banking and Brokerage Services\" \"Diversified Financial Services\" 30202000 \"Dovalue S.P.A\" \"Dovalues S.P.A\" \"\" \"\" \"\" \"\" \"Ord NPV\" \"IT\" \"DOV\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" 4180028 4865000 5775549 \" \" \"\" \"\" \"\" \"\" \"\" \"\" \"\" 2021-06-18 \"\" \"\" \"\" 2021-06-23 12:49:11 \"IT\" \"https://data.smartinsider.com/members/linkbi?bid=15149\" \"On Market\" \"Broker\" \"In Treasury\" \"500000\" \"\" \"\" 2021-07-01 2021-12-31 \"\" \"\"",
ExpectedResult=true)]
Expand Down
20 changes: 9 additions & 11 deletions tests/SmartInsiderIntentionUniverseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,23 @@
using Newtonsoft.Json;
using NUnit.Framework;
using QuantConnect.Data;
using QuantConnect.Data.Auxiliary;
using QuantConnect.DataProcessing;
using QuantConnect.DataSource;
using QuantConnect.Interfaces;
using QuantConnect.Util;

namespace QuantConnect.DataLibrary.Tests
{
[TestFixture]
public class SmartInsiderIntentionUniverseTests
{
[OneTimeSetUp]
public void Setup()
{
Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(Configuration.Config.Get("map-file-provider", typeof(LocalDiskMapFileProvider).Name));
}

[TestCase(
new string[]{"20200921 07:50:38 BI12705 New Intention 20211212 20200602 US00164V1035 68556 Consumer Discretionary Media Media Entertainment 40301010 AMC Networks Inc Com A US AMCX 20200921 US Tender Offer Issuer Not Reported USD 250000000 22.5000 26.5000 "},
"20200921",
Expand Down Expand Up @@ -58,17 +67,6 @@ public string ProcessUniverseTest(string[] tickerData, string date)
return $"{result.Key},{result.Value}";
}

[Test]
public void JsonRoundTrip()
{
var expected = CreateNewInstance();
var type = expected.GetType();
var serialized = JsonConvert.SerializeObject(expected);
var result = JsonConvert.DeserializeObject(serialized, type);

AssertAreEqual(expected, result);
}

[Test]
public void Selection()
{
Expand Down
9 changes: 9 additions & 0 deletions tests/SmartInsiderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using QuantConnect.Data.Auxiliary;
using QuantConnect.Interfaces;
using QuantConnect.Util;

namespace QuantConnect.DataLibrary.Tests
{
Expand All @@ -26,6 +29,12 @@ public class SmartInsiderTests
{
private static Symbol SymbolsAAPL = Symbol.Create("AAPL", SecurityType.Equity, Market.USA);

[OneTimeSetUp]
public void Setup()
{
Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(Configuration.Config.Get("map-file-provider", typeof(LocalDiskMapFileProvider).Name));
}

[Test]
public void ErrorGetsMappedToSatisfyStockVesting()
{
Expand Down
9 changes: 9 additions & 0 deletions tests/SmartInsiderTransactionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,22 @@
using Newtonsoft.Json;
using NUnit.Framework;
using QuantConnect.Data;
using QuantConnect.Data.Auxiliary;
using QuantConnect.DataSource;
using QuantConnect.Interfaces;
using QuantConnect.Util;

namespace QuantConnect.DataLibrary.Tests
{
[TestFixture]
public class SmartInsiderTransactionsTests
{
[OneTimeSetUp]
public void Setup()
{
Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(Configuration.Config.Get("map-file-provider", typeof(LocalDiskMapFileProvider).Name));
}

[TestCase("\"TransactionID\" \"BuybackType\" \"LastUpdate\" \"LastIDsUpdate\" \"ISIN\" \"USDMarketCap\" \"CompanyID\" \"companyPageURL\" \"ICBIndustry\" \"ICBSuperSector\" \"ICBSector\" \"ICBSubSector\" \"ICBCode\" \"CompanyName\" \"ShortCompanyName\" \"previousResultsAnnsDate\" \"nextResultsAnnsDate\" \"nextCloseBegin\" \"LastCloseEnded\" \"SecurityDescription\" \"TickerCountry\" \"TickerSymbol\" \"BuybackDate\" \"BybackVia\" \"BybackBy\" \"HoldingType\" \"Currency\" \"Price\" \"TransactionAmount\" \"GBPValue\" \"EURValue\" \"USDValue\" \"NoteText\" \"BuybackPercentage\" \"VolumePercentage\" \"ConvRate\" \"previousClosePrice\" \"AmountAdjFactor\" \"PriceAdjFactor\" \"TreasuryHolding\" \"AnnouncementDate\" \"TimeReleased\" \"TimeProcessed\" \"TimeReleasedGMT\" \"TimeProcessedGMT\" \"AnnouncedIn\" \"showOriginal\" \"IntentionVia\" \"IntentionBy\" \"BuybackIntentionHoldingType\" \"IntentionAmount\" \"ValueCurrency\" \"IntentionValue\" \"IntentionPercentage\" \"StartDate\" \"EndDate\" \"PriceCurrency\" \"MinimumPrice\" \"MaximumPrice\" \"BuybackIntentionNoteText\" \"UserVarChar1\" \"UserVarChar2\" \"UserVarChar3\" \"UserVarChar4\" \"UserVarChar5\" \"SystemVarChar1\" \"SystemVarChar2\" \"SystemVarChar3\" \"SystemVarChar4\" \"SystemVarChar5\" \"UserNumber1\" \"UserNumber2\" \"UserNumber3\" \"UserNumber4\" \"UserNumber5\" \"SystemNumber1\" \"SystemNumber2\" \"SystemNumber3\" \"SystemNumber4\" \"SystemNumber5\" \"UserInteger1\" \"UserInteger2\" \"UserInteger3\" \"UserInteger4\" \"UserInteger5\" \"SystemInteger1\" \"SystemInteger2\" \"SystemInteger3\" \"SystemInteger4\" \"SystemInteger5\" \"UserDateTime1\" \"UserDateTime2\" \"UserDateTime3\" \"UserDateTime4\" \"UserDateTime5\" \"SystemDateTime1\" \"SystemDateTime2\" \"SystemDateTime3\" \"SystemDateTime4\" \"SystemDateTime5\"",
"\"BT7\" \"Transaction\" 2021-08-02 2021-02-01 \"GB0008829292\" 1954021690 2142 \"https://data.smartinsider.com/members/company?c=2142\" \"Financials\" \"Financial Services\" \"Closed End Investments\" \"Closed End Investments\" 30204000 \"Templeton Emerging Markets Investment Trust\" \"Templeton Emergi\" 2015-06-12 2015-06-12 \"Ord\" \"GB\" \"TEM\" 2014-04-09 \"On Market\" \"Issuer\" \"For Cancellation\" \"GBP\" 5.4574 \"27227\" 148589 180016 247832 \" \" \"0.0001\" 8.6209 1.000000 545.5000 5.000 0.200 2014-04-09 2014-04-09 16:55:00 \"\" 2014-04-09 15:55:00 2014-04-16 16:47:59 \"GB\" \"https://data.smartinsider.com/members/linkbb?bid=7\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"",
ExpectedResult=true)]
Expand Down
20 changes: 9 additions & 11 deletions tests/SmartInsiderTransactionUniverseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,23 @@
using Newtonsoft.Json;
using NUnit.Framework;
using QuantConnect.Data;
using QuantConnect.Data.Auxiliary;
using QuantConnect.DataProcessing;
using QuantConnect.DataSource;
using QuantConnect.Interfaces;
using QuantConnect.Util;

namespace QuantConnect.DataLibrary.Tests
{
[TestFixture]
public class SmartInsiderTransactionUniverseTests
{
[OneTimeSetUp]
public void Setup()
{
Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(Configuration.Config.Get("map-file-provider", typeof(LocalDiskMapFileProvider).Name));
}

[TestCase(
new string[]{"20220309 11:53:36 BT812996 Transaction 20220309 20191004 US00846U1016 38843345345 27276 Health Care Health Care Medical Equipment and Services Medical Equipment 20102010 Agilent Technologies Inc 20211217 20220222 20220131 20211217 Com US A 20220309 20220303 17:02:17 20220303 22:02:17 US 20211231 On Market Issuer For Cancellation USD 154.4500 2038115 232558230 276699052 314786862 0.0081 6.0456 1.350000 "},
"20220309",
Expand All @@ -52,17 +61,6 @@ public string ProcessUniverseTest(string[] tickerData, string date)

return $"{result.Key},{result.Value}";
}

[Test]
public void JsonRoundTrip()
{
var expected = CreateNewInstance();
var type = expected.GetType();
var serialized = JsonConvert.SerializeObject(expected);
var result = JsonConvert.DeserializeObject(serialized, type);

AssertAreEqual(expected, result);
}

[Test]
public void Selection()
Expand Down
9 changes: 6 additions & 3 deletions tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>QuantConnect.DataLibrary.Tests</RootNamespace>
</PropertyGroup>
<ItemGroup>
Expand All @@ -18,15 +18,18 @@
<Content Include="..\SmartInsiderTransactionUniverseSelectionAlgorithm.py" Link="SmartInsiderTransactionUniverseSelectionAlgorithm.py" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1">
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="16.9.4" />
<PackageReference Include="QuantConnect.Algorithm" Version="2.5.*" />
<PackageReference Include="QuantConnect.Algorithm.Framework" Version="2.5.*" />
</ItemGroup>
<ItemGroup>
<Using Include="NUnit.Framework.Legacy.ClassicAssert" Alias="Assert" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\QuantConnect.DataSource.csproj" />
<ProjectReference Include="..\DataProcessing\DataProcessing.csproj" />
Expand Down