What is Boot Camp?
Boot Camp is a great way to improve your skills and learn the QuantConnect API in easily digestible portions.
Don't have an account? Join QuantConnect Today
We are dedicated to providing investors with a cutting-edge platform for rapidly creating quant investment strategies. Founded in 2012, we've empowered more than 250,000 quants and engineers to create and trade their ideas.
Quickly and easily started with our API to build your strategy. The learning center lessons are interactive, step-by-step guides to make you productive as fast as possible.
Focus your efforts on driving alpha, not parsing CSV files. Our cloud offers hundreds of terabytes of traditional and alternative data preformatted, cleaned, and instantly accessible by our API.
Coordinate teamwork, control access permissions, and your shared cloud resources. Grow your trading organization safely and efficiently on top of our cloud architecture.
A selection of streaming live-trading strategies written by QuantConnect, and top highlights from the community available to follow and clone. Peer into detailed real-time positions to gain insight for your own trading.
What is Boot Camp?
Boot Camp is a great way to improve your skills and learn the QuantConnect API in easily digestible portions.
A collection of courses from independent educators to improve your quant skill base and create better strategies.
Solidify and expand your quant skill base with courses at QuantConnect
Learn algorithmic trading with python for US Equities. Guided strategy development in easily digestible portions.
Author: QuantConnect
Free | 96,701 People Enrolled
Learn algorithmic trading with python for FX. Guided strategy development in easily digestible portions.
Author: QuantConnect
Free | 20,692 People Enrolled
Learn algorithmic trading with python for Futures. Guided strategy development in easily digestible portions.
Author: QuantConnect
Free | 7,536 People Enrolled
In this algorithmic trading tutorial series you will learn everything you need to know to start writing your own trading bots using Python and the QuantConnect quantitative trading platform.
Author: Louis
Free | 29,226 People Enrolled
Master algorithmic trading on QuantConnect; backtest and live trade Stocks, Options, Futures, Forex, and Crypto.
Author: Cheng Li
Paid | Enroll on Udemy
Learn to use Python, Pandas, Matplotlib, and the QuantConnect Lean Engine to perform financial analysis and trading.
Author: Jose Portilla, Pierian Training
Paid | Enroll on Udemy
Learn to write programs that algorithmically trade cryptocurrencies using QuantConnect (C#).
Author: Eric Summers
Paid | Enroll on Udemy
Organization Notes
Get Started with Algorithm Lab
New Research
Portfolio Construction Using Topological Data Analysis
Harnessing topological techniques to diversify SPY constituents by clustering top constituents to reduce correlation risk and drawdown....
ReadNew Announcement
Quant League Q1 2025 Results: Triton Quantitative Trading Takes the 1st Place!
ReadAlgorithm Lab is your playground for developing and refining trading algorithms with QuantConnect. Utilize advanced tools, historical data, and robust backtesting to enhance your trading strategies. Transform your ideas into actionable insights and optimize your trading approach with ease.
Sign Up for FreeAlready have an account Log In.
This account is protected by two-factor authentication.
Request Token Information Reset My TokenCreated | Last Time Used | Agent | |
---|---|---|---|
No entries found |
To continue please enter your email:
(No google account required)
To verify that everything goes well please enter the 6 digit verification code generated by the authenticator application
Algorithm Lab is your playground for developing and refining trading algorithms with QuantConnect. Utilize advanced tools, historical data, and robust backtesting to enhance your trading strategies. Transform your ideas into actionable insights and optimize your trading approach with ease.
Sign Up for FreeAlready have an account Log In.
Please stop one of the following coding sessions, or upgrade your account.
NAME | ORGANIZATION |
---|
QuantConnect Datasets
Explore free and paid datasets available on QuantConnect covering fundamentals, pricing, and alternative options.
Datasets >
Dashboard
A transparent, community reporting system. Report suspected issues with our cloud data to be investigated by the QuantConnect Team.
Issue List
Loading...
Data Explorer Issues are a way to report and track data problems. They give the QuantConnect community a way to discuss potential solutions and be notified when they are resolved. If you think you have found a data problem please check the existing open and closed issues first; often another user may have already reported your problem.
Does your issue match any of the already listed issues?
Thank you for your contribution! Our team is currently working on resolving these issues, please subscribe to them to receive updates.
Datasets >
Corporate Buybacks
Dataset by Smart Insider
The Corporate Buybacks dataset by Smart Insider tracks US Equities share buyback programs. The data covers 3,000 US Equities, starts in May 2015, and is delivered on a second frequency. This dataset is created by analyzing daily buyback announcements and by using secondary data sources to ensure records are accurate and complete.
This dataset depends on the US Equity Security Master dataset because the US Equity Security Master dataset contains information on splits, dividends, and symbol changes.
Smart Insider was founded by Michael Tindale in 2016 with the goal of forming the most progressive insider data vendor in the field. Smart Insider provides access to buyback intention and transactions for quantitative researchers. In addition to their Corporate Buybacks dataset, Smart Insider provides data on stock trades made by US politicians and thousands of high net worth individuals around the globe.
The following snippet demonstrates how to request data from the Corporate Buybacks dataset:
self.aapl = self.add_equity("AAPL", Resolution.MINUTE).symbol
self.intention_symbol = self.add_data(SmartInsiderIntention, self.aapl).symbol
self.transaction_symbol = self.add_data(SmartInsiderTransaction, self.aapl).symbol
self.intention_universe = self.add_universe(SmartInsiderIntentionUniverse, self.intention_selection)
self.transaction_universe = self.add_universe(SmartInsiderTransactionUniverse, self.transaction_selection)
_symbol = AddEquity("AAPL", Resolution.Minute).Symbol;
_intentionSymbol = AddData<SmartInsiderIntention>(_symbol).Symbol;
_transactionSymbol = AddData<SmartInsiderTransaction>(_symbol).Symbol;
_intentionUniverse = AddUniverse<SmartInsiderIntentionUniverse>(IntentionSelection);
_transactionUniverse = AddUniverse<SmartInsiderTransactionUniverse>(TransactionSelection);
The following table describes the dataset properties:
Property | Value |
---|---|
Start Date | May 2015 |
Asset Coverage | 3,000 US Equities |
Data Density | Sparse |
Resolution | Second |
Timezone | New York |
The Corporate Buybacks dataset enables you to design strategies using information on company buyback programs. Examples include the following strategies:
For more example algorithms, see Examples.
The Corporate Buybacks dataset provides SmartInsiderIntention, SmartInsiderIntentionUniverse, SmartInsiderTransaction, and SmartInsiderTransactionUniverse objects.
SmartInsiderIntention objects have the following attributes:
SmartInsiderIntentionUniverse objects have the following attributes:
SmartInsiderTransaction objects have the following attributes:
SmartInsiderTransactionUniverse objects have the following attributes:
To add Corporate Buybacks data to your algorithm, call the AddDataadd_data method. Save a reference to the dataset Symbol so you can access the data later in your algorithm.
class CorporateBuybacksDataAlgorithm(QCAlgorithm):
def initialize(self) -> None:
self.set_start_date(2016, 1, 1)
self.set_end_date(2021, 1, 1)
self.set_cash(100000)
self.aapl = self.add_equity("AAPL", Resolution.MINUTE).symbol
self.intention_symbol = self.add_data(SmartInsiderIntention, self.aapl).symbol
self.transaction_symbol = self.add_data(SmartInsiderTransaction, self.aapl).symbol
namespace QuantConnect.Algorithm.CSharp.AltData
{
public class CorporateBuybacksDataAlgorithm : QCAlgorithm
{
private Symbol _symbol, _intentionSymbol, _transactionSymbol;
public override void Initialize()
{
SetStartDate(2016, 1, 1);
SetEndDate(2021, 1, 1);
SetCash(100000);
_symbol = AddEquity("AAPL", Resolution.Minute).Symbol;
_intentionSymbol = AddData<SmartInsiderIntention>(_symbol).Symbol;
_transactionSymbol = AddData<SmartInsiderTransaction>(_symbol).Symbol;
}
}
}
To get the current Corporate Buybacks data, index the current Slice with the dataset Symbol. Slice objects deliver unique events to your algorithm as they happen, but the Slice may not contain data for your dataset at every time step. To avoid issues, check if the Slice contains the data you want before you index it.
def on_data(self, slice: Slice) -> None:
if slice.contains_key(self.intention_symbol):
data_point = slice[self.intention_symbol]
self.log(f"{self.intention_symbol} intention amount at {slice.time}: {data_point.amount}")
if slice.contains_key(self.transaction_symbol):
data_point = slice[self.transaction_symbol]
self.log(f"{self.transaction_symbol} transaction amount at {slice.time}: {data_point.amount}")
public override void OnData(Slice slice)
{
if (slice.ContainsKey(_intentionSymbol))
{
var dataPoint = slice[_intentionSymbol];
Log($"{_intentionSymbol} intention amount at {slice.Time}: {dataPoint.Amount}");
}
if (slice.ContainsKey(_transactionSymbol))
{
var dataPoint = slice[_transactionSymbol];
Log($"{_transactionSymbol} transaction amount at {slice.Time}: {dataPoint.Amount}");
}
}
To iterate through all of the dataset objects in the current Slice, call the Getget method.
def on_data(self, slice: Slice) -> None:
for dataset_symbol, data_point in slice.get(SmartInsiderIntention).items():
self.log(f"{dataset_symbol} intention amount at {slice.time}: {data_point.amount}")
for dataset_symbol, data_point in slice.get(SmartInsiderTransaction).items():
self.log(f"{dataset_symbol} transaction amount at {slice.time}: {data_point.amount}")
public override void OnData(Slice slice)
{
foreach (var kvp in slice.Get<SmartInsiderIntention>())
{
var datasetSymbol = kvp.Key;
var dataPoint = kvp.Value;
Log($"{datasetSymbol} intention amount at {slice.Time}: {dataPoint.Amount}");
}
foreach (var kvp in slice.Get<SmartInsiderTransaction>())
{
var datasetSymbol = kvp.Key;
var dataPoint = kvp.Value;
Log($"{datasetSymbol} transaction amount at {slice.Time}: {dataPoint.Amount}");
}
}
To get historical Corporate Buybacks data, call the Historyhistory method with the dataset Symbol. If there is no data in the period you request, the history result is empty.
# DataFrames
intention_history_df = self.history(self.intention_symbol, 100, Resolution.DAILY)
transaction_history_df = self.history(self.transaction_symbol, 100, Resolution.DAILY)
history_df = self.history([self.intention_symbol, self.transaction_symbol], 100, Resolution.DAILY)
# Dataset objects
intention_history_bars = self.history[SmartInsiderIntention](self.intention_symbol, 100, Resolution.DAILY)
transaction_history_bars = self.history[SmartInsiderTransaction](self.transaction_symbol, 100, Resolution.DAILY)
// Dataset objects
var intentionHistory = History<SmartInsiderIntention>(_intentionSymbol, 100, Resolution.Daily);
var transactionHistory = History<SmartInsiderTransaction>(_transactionSymbol, 100, Resolution.Daily);
// Slice objects
var history = History(new[] {_intentionSymbol, _transactionSymbol}, 100, Resolution.Daily);
For more information about historical data, see History Requests.
To select a dynamic universe of US Equities based on Corporate Buybacks data, call the AddUniverseadd_universe method with the SmartInsiderIntentionUniverse class or the SmartInsiderTransactionUniverse and a selection function.
def initialize(self) -> None:
self.intention_universe = self.add_universe(SmartInsiderIntentionUniverse, self.intention_selection)
self.transaction_universe = self.add_universe(SmartInsiderTransactionUniverse, self.transaction_selection)
def intention_selection(self, alt_coarse: List[SmartInsiderIntentionUniverse]) -> List[Symbol]:
return [d.symbol for d in alt_coarse \
if d.percentage > 0.005 \
and d.usd_market_cap > 100000000]
def transaction_selection(self, alt_coarse: List[SmartInsiderTransactionUniverse]) -> List[Symbol]:
return [d.symbol for d in alt_coarse \
if d.buyback_percentage > 0.005 \
and d.usd_market_cap > 100000000]
private Universe _intentionUniverse;
private Universe _transactionUniverse;
public override void Initialize()
{
_intentionUniverse = AddUniverse<SmartInsiderIntentionUniverse>(altCoarse =>
{
return from d in altCoarse.OfType<SmartInsiderIntentionUniverse>()
where d.Percentage > 0.005m && d.USDMarketCap > 100000000m
select d.Symbol;
});
_transactionUniverse = AddUniverse<SmartInsiderTransactionUniverse>(altCoarse =>
{
return from d in altCoarse.OfType<SmartInsiderTransactionUniverse>()
where d.BuybackPercentage > 0.005m && d.USDMarketCap > 100000000m
select d.Symbol;
});
}
For more information about dynamic universes, see Universes.
You can get historical universe data in an algorithm and in the Research Environment.
To get historical universe data in an algorithm, call the Historyhistory method with the Universe object and the lookback period. If there is no data in the period you request, the history result is empty.
var intentionUniverseHistory = History(_intentionUniverse, 30, Resolution.Daily);
foreach (var intentions in intentionUniverseHistory)
{
foreach (SmartInsiderIntentionUniverse intention in intentions)
{
Log($"{intention.Symbol.Value} amount at {intention.EndTime}: {intention.AmountValue}");
}
}
var transactionUniverseHistory = History(_transactionUniverse, 30, Resolution.Daily);
foreach (var transactions in transactionHistory)
{
foreach (SmartInsiderTransactionUniverse transaction in transactions)
{
Log($"{transaction.Symbol.Value} amount at {transaction.EndTime}: {transaction.Amount}");
}
}
# DataFrame example where the columns are the SmartInsiderIntentionUniverse attributes:
intention_history_df = self.history(self._universe, 30, Resolution.DAILY, flatten=True)
# Series example where the values are lists of SmartInsiderIntentionUniverse objects:
intention_universe_history = self.history(self.intention_universe, 30, Resolution.DAILY)
for (_, time), intentions in intention_universe_history.items():
for intention in intentions:
self.log(f"{intention.symbol.value} amount value at {intention.end_time}: {intention.amount_value}")
# DataFrame example where the columns are the SmartInsiderTransactionUniverse attributes:
transaction_history_df = self.history(self._universe, 30, Resolution.DAILY, flatten=True)
# Series example where the values are lists of SmartInsiderTransactionUniverse objects:
transaction_universe_history = self.history(self.transaction_universe, 30, Resolution.DAILY)
for (_, time), transactions in transaction_universe_history.items():
for transaction in transactions:
self.log(f"{transaction.symbol.value} amount at {intention.end_time}: {intention.amount}")
To get historical universe data in research, call the UniverseHistoryuniverse_history method with the Universe object, a start date, and an end date. This method returns the filtered universe. If there is no data in the period you request, the history result is empty.
var intentionUniverseHistory = qb.UniverseHistory(intentionUniverse, qb.Time.AddDays(-30), qb.Time);
foreach (var intentions in intentionUniverseHistory)
{
foreach (SmartInsiderIntentionUniverse intention in intentions)
{
Console.WriteLine($"{intention.Symbol.Value} amount at {intention.EndTime}: {intention.AmountValue}");
}
}
var transactionUniverseHistory = qb.UniverseHistory(transactionUniverse, qb.Time.AddDays(-30), qb.Time);
foreach (var transactions in transactionHistory)
{
foreach (SmartInsiderTransactionUniverse transaction in transactions)
{
Console.WriteLine($"{transaction.Symbol.Value} amount at {transaction.EndTime}: {transaction.Amount}");
}
}
# DataFrame example where the columns are the SmartInsiderIntentionUniverse attributes:
intention_history_df = qb.universe_history(universe, qb.time-timedelta(30), qb.time, flatten=True)
# Series example where the values are lists of SmartInsiderIntentionUniverse objects:
intention_universe_history = qb.universe_history(intention_universe, qb.time-timedelta(30), qb.time)
for (_, time), intentions in intention_universe_history.items():
for intention in intentions:
print(f"{intention.symbol.value} amount value at {intention.end_time}: {intention.amount_value}")
# DataFrame example where the columns are the SmartInsiderTransactionUniverse attributes:
transaction_history_df = qb.universe_history(universe, qb.time-timedelta(30), qb.time, flatten=True)
# Series example where the values are lists of SmartInsiderTransactionUniverse objects:
transaction_universe_history = qb.universe_history(transaction_universe, qb.time-timedelta(30), qb.time)
for (_, time), transactions in transaction_universe_history.items():
for transaction in transactions:
print(f"{transaction.symbol.value} amount at {transaction.end_time}: {transaction.amount}")
You can call the Historyhistory method in Research.
To remove a subscription, call the RemoveSecurityremove_security method.
self.remove_security(self.intention_symbol)
self.remove_security(self.transaction_symbol)
RemoveSecurity(_intentionSymbol);
RemoveSecurity(_transactionSymbol);
If you subscribe to Corporate Buybacks data for assets in a dynamic universe, remove the dataset subscription when the asset leaves your universe. To view a common design pattern, see Track Security Changes.
The Corporate Buybacks dataset provides SmartInsiderIntention, SmartInsiderIntentionUniverse, SmartInsiderTransaction, and SmartInsiderTransactionUniverse objects.
SmartInsiderIntention objects have the following attributes:
SmartInsiderIntentionUniverse objects have the following attributes:
SmartInsiderTransaction objects have the following attributes:
SmartInsiderTransactionUniverse objects have the following attributes:
The following example algorithm buys Apple stock when there is a buyback intention or transaction and then it sells the stock 3 days later:
from AlgorithmImports import *
from QuantConnect.DataSource import *
class CorporateBuybacksDataAlgorithm(QCAlgorithm):
def initialize(self) -> None:
self.set_start_date(2016, 1, 1)
self.set_end_date(2021, 1, 1)
self.set_cash(100000)
self.aapl = self.add_equity("AAPL", Resolution.MINUTE).symbol
# Requesting insider trade intention news and actual trades to estimate the return, since insiders may have better information of the future confidence
self.smart_insider_intention = self.add_data(SmartInsiderIntention, self.aapl).symbol
self.smart_insider_transaction = self.add_data(SmartInsiderTransaction, self.aapl).symbol
# Historical data
history = self.history(self.smart_insider_intention, 365, Resolution.DAILY)
self.debug(f"We got {len(history)} items from our history request for intentions")
history = self.history(self.smart_insider_transaction, 365, Resolution.DAILY)
self.debug(f"We got {len(history)} items from our history request for transactions")
def on_data(self, slice: Slice) -> None:
# Buy Apple whenever we receive a buyback intention or transaction notification, given the insiders may have confidence in the future to buy more
# This news may stimulate market popularity
if slice.contains_key(self.smart_insider_intention) or slice.contains_key(self.smart_insider_transaction):
self.set_holdings(self.aapl, 1)
self.entry_time = self.time
# Liquidate holdings 3 days after the latest entry
# The market popularity and possible overbrought is cooled
if self.portfolio.invested and self.time >= self.entry_time + timedelta(days=3):
self.liquidate()
using QuantConnect.DataSource;
namespace QuantConnect.Algorithm.CSharp.AltData
{
public class CorporateBuybacksDataAlgorithm : QCAlgorithm
{
private Symbol _aapl;
private Symbol _smartInsiderIntention;
private Symbol _smartInsiderTransaction;
private DateTime _entryTime;
public override void Initialize()
{
SetStartDate(2016, 1, 1);
SetEndDate(2021, 1, 1);
SetCash(100000);
_aapl = AddEquity("AAPL", Resolution.Minute).Symbol;
// Requesting insider trade intention news and actual trades to estimate the return, since insiders may have better information of the future confidence
_smartInsiderIntention = AddData<SmartInsiderIntention>(_aapl).Symbol;
_smartInsiderTransaction = AddData<SmartInsiderTransaction>(_aapl).Symbol;
// Historical data
var intentionHistory = History<SmartInsiderIntention>(_smartInsiderIntention, 365, Resolution.Daily);
Debug($"We got {intentionHistory.Count()} items from our history request for intentions");
var transactionHistory = History<SmartInsiderTransaction>(_smartInsiderTransaction, 365, Resolution.Daily);
Debug($"We got {transactionHistory.Count()} items from our history request for transactions");
}
public override void OnData(Slice slice)
{
// Buy Apple whenever we receive a buyback intention or transaction notification, given the insiders may have confidence in the future to buy more
// This news may stimulate market popularity
if (slice.ContainsKey(_smartInsiderIntention) || slice.ContainsKey(_smartInsiderTransaction))
{
SetHoldings(_aapl, 1);
_entryTime = Time;
}
// Liquidate holdings 3 days after the latest entry
// The market popularity and possible overbrought is cooled
if (Portfolio.Invested && Time >= _entryTime + TimeSpan.FromDays(3))
{
Liquidate();
}
}
}
}
The following example algorithm buys Apple stock when there is a buyback intention or transaction and then it sells the stock 3 days later:
from AlgorithmImports import *
from QuantConnect.DataSource import *
class CorporateBuybacksDataAlgorithm(QCAlgorithm):
def initialize(self) -> None:
self.set_start_date(2016, 1, 1)
self.set_end_date(2021, 1, 1)
self.set_cash(100000)
# Only interest in AAPL's insider trades information
symbols = [Symbol.create("AAPL", SecurityType.EQUITY, Market.USA)]
self.add_universe_selection(ManualUniverseSelectionModel(symbols))
self.add_alpha(CorporateBuybacksAlphaModel())
self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())
class CorporateBuybacksAlphaModel(AlphaModel):
def update(self, algorithm: QCAlgorithm, slice: Slice) -> List[Insight]:
# Buy Apple whenever we receive a buyback intention or transaction notification, given the insiders may have confidence in the future to buy more
# This news may stimulate market popularity, so we hold for 3 days
if slice.contains_key(self.smart_insider_intention) or slice.contains_key(self.smart_insider_transaction):
return [Insight.price(self.aapl, timedelta(days=3), InsightDirection.UP)]
return []
def on_securities_changed(self, algorithm: QCAlgorithm, changes: SecurityChanges) -> None:
for security in changes.added_securities:
self.aapl = security.symbol
# Requesting insider trade intention news and actual trades to estimate the return, since insiders may have better information of the future confidence
self.smart_insider_intention = algorithm.add_data(SmartInsiderIntention, self.aapl).symbol
self.smart_insider_transaction = algorithm.add_data(SmartInsiderTransaction, self.aapl).symbol
# Historical data
history = algorithm.history(self.smart_insider_intention, 365, Resolution.DAILY)
algorithm.debug(f"We got {len(history)} items from our history request for intentions")
history = algorithm.history(self.smart_insider_transaction, 365, Resolution.DAILY)
algorithm.debug(f"We got {len(history)} items from our history request for transactions")
using QuantConnect.DataSource;
namespace QuantConnect.Algorithm.CSharp.AltData
{
public class CorporateBuybacksDataAlgorithm : QCAlgorithm
{
public override void Initialize()
{
SetStartDate(2016, 1, 1);
SetEndDate(2021, 1, 1);
SetCash(100000);
// Only interest in AAPL's insider trades information
var symbols = new[] {QuantConnect.Symbol.Create("AAPL", SecurityType.Equity, Market.USA)};
AddUniverseSelection(new ManualUniverseSelectionModel(symbols));
AddAlpha(new CorporateBuybacksAlphaModel());
SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());
}
public class CorporateBuybacksAlphaModel : AlphaModel
{
private Symbol _aapl;
private Symbol _smartInsiderIntention;
private Symbol _smartInsiderTransaction;
public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice slice)
{
var insights = new List<Insight>();
// Buy Apple whenever we receive a buyback intention or transaction notification, given the insiders may have confidence in the future to buy more
// This news may stimulate market popularity, so we hold for 3 days
if (slice.ContainsKey(_smartInsiderIntention) || slice.ContainsKey(_smartInsiderTransaction))
{
insights.Add(Insight.Price(_aapl, TimeSpan.FromDays(3), InsightDirection.Up));
}
return insights;
}
public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)
{
foreach (var security in changes.AddedSecurities)
{
_aapl = security.Symbol;
// Requesting insider trade intention news and actual trades to estimate the return, since insiders may have better information of the future confidence
_smartInsiderIntention = algorithm.AddData<SmartInsiderIntention>(_aapl).Symbol;
_smartInsiderTransaction = algorithm.AddData<SmartInsiderTransaction>(_aapl).Symbol;
// Historical data
var intentionHistory = algorithm.History<SmartInsiderIntention>(_smartInsiderIntention, 365, Resolution.Daily);
algorithm.Debug($"We got {intentionHistory.Count()} items from our history request for intentions");
var transactionHistory = algorithm.History<SmartInsiderTransaction>(_smartInsiderTransaction, 365, Resolution.Daily);
algorithm.Debug($"We got {transactionHistory.Count()} items from our history request for transactions");
}
}
}
}
}
The following example lists US Equities with the highest buyback amount.
#r "../QuantConnect.DataSource.SmartInsiderIntentionsTransactions.dll"
using QuantConnect.DataSource;
var qb = new QuantBook();
// Requesting data
var symbol = qb.AddEquity("AAPL").Symbol;
var intentionSymbol = qb.AddData<SmartInsiderIntention>(symbol).Symbol;
var transactionSymbol = qb.AddData<SmartInsiderTransaction>(symbol).Symbol;
// Historical data for SmartInsiderIntention
var intentionHistory = qb.History<SmartInsiderIntention>(symbol, 300, Resolution.Daily);
foreach (SmartInsiderIntention intention in intentionHistory)
{
Console.WriteLine($"{intention.NoteText} at {intention.EndTime}");
}
// Historical data for SmartInsiderTransaction
var transactionHistory = qb.History<SmartInsiderTransaction>(symbol, 300, Resolution.Daily);
foreach (SmartInsiderTransaction transaction in transactionHistory)
{
Console.WriteLine($"{transaction.NoteText} at {transaction.EndTime}");
}
// Add Universe Selection for SmartInsiderIntention
IEnumerable<Symbol> IntentionSelection(IEnumerable<BaseData> altCoarse)
{
return (from d in altCoarse.OfType<SmartInsiderIntentionUniverse>()
where d.AmountValue.HasValue
orderby d.AmountValue descending select d.Symbol).Take(10);
}
var intentionUniverse = qb.AddUniverse<SmartInsiderIntentionUniverse>(IntentionSelection);
// Historical Universe data
var intentionUniverseHistory = qb.UniverseHistory(intentionUniverse, qb.Time.AddDays(-10), qb.Time);
foreach (var intentions in intentionUniverseHistory)
{
foreach (SmartInsiderIntentionUniverse intention in intentions)
{
Console.WriteLine($"{intention.Symbol.Value} amount at {intention.EndTime}: {intention.AmountValue}");
}
}
// Add Universe Selection for SmartInsiderTransaction
IEnumerable<Symbol> TransactionSelection(IEnumerable<BaseData> altCoarse)
{
return (from d in altCoarse.OfType<SmartInsiderTransactionUniverse>()
where d.Amount.HasValue
orderby d.Amount descending select d.Symbol).Take(10);
}
var transactionUniverse = qb.AddUniverse<SmartInsiderTransactionUniverse>(TransactionSelection);
// Historical Universe data
var transactionHistory = qb.UniverseHistory(transactionUniverse, qb.Time.AddDays(-10), qb.Time);
foreach (var transactions in transactionHistory)
{
foreach (SmartInsiderTransactionUniverse transaction in transactions)
{
Console.WriteLine($"{transaction.Symbol.Value} amount at {transaction.EndTime}: {transaction.Amount}");
}
}
from math import isnan
qb = QuantBook()
# Requesting Data
symbol = qb.AddEquity("AAPL").Symbol
intention_symbol = qb.AddData(SmartInsiderIntention, symbol).Symbol
transaction_symbol = qb.AddData(SmartInsiderTransaction, symbol).Symbol
# Historical data
intention_history = qb.History(SmartInsiderIntention, intention_symbol, 300, Resolution.Daily)
for (symbol, time), row in intention_history.iterrows():
if isnan(row['amountvalue']): continue
print(f"{symbol} amount value at {time}: {row['amountvalue']}")
transaction_history = qb.History(SmartInsiderTransaction, transaction_symbol, 300, Resolution.Daily)
for (symbol, time), row in transaction_history.iterrows():
if isnan(row['amount']): continue
print(f"{symbol} amount at {time}: {row['amount']}")
# Add Universe Selection for SmartInsiderIntention
def IntentionSelection(alt_coarse: List[SmartInsiderIntentionUniverse]) -> List[Symbol]:
return [d.Symbol for d in sorted([x for x in alt_coarse if x.AmountValue],
key=lambda x: x.AmountValue, reverse=True)[:10]]
intention_universe = qb.AddUniverse(SmartInsiderIntentionUniverse, IntentionSelection)
# Historical Universe data
intention_universe_history = qb.UniverseHistory(intention_universe, qb.Time-timedelta(10), qb.Time)
for (_, time), intentions in intention_universe_history.items():
for intention in intentions:
print(f"{intention.Symbol.Value} amount value at {intention.EndTime}: {intention.AmountValue}")
# Add Universe Selection for SmartInsiderTransaction
def IntentionSelection(alt_coarse: List[SmartInsiderTransactionUniverse]) -> List[Symbol]:
return [d.Symbol for d in sorted([x for x in alt_coarse if x.Amount],
key=lambda x: x.Amount, reverse=True)[:10]]
transaction_universe = qb.AddUniverse(SmartInsiderTransactionUniverse, IntentionSelection)
# Historical Universe data
transaction_universe_history = qb.UniverseHistory(transaction_universe, qb.Time-timedelta(10), qb.Time)
for (_, time), transactions in transaction_universe_history.items():
for transaction in transactions:
print(f"{transaction.Symbol.Value} amount at {transaction.EndTime}: {transaction.Amount}")
Corporate Buybacks is allowed to be used in the cloud for personal and commercial projects with a subscription. The data is permissioned for use within the licensed organization only
Subscription Required | License Now
LEAN CLI is a cross-platform wrapper on the QuantConnect algorithmic trading engine called LEAN. The CLI makes using LEAN incredibly easy, reducing most of the pain points of developing and managing an algorithmic trading strategy to a few lines of bash.
Using the CLI you can download the same data QuantConnect hosts in the cloud for a small fee. These fees are per file downloaded, and are paid for in QuantConnect-Credits (QCC). We recommend purchasing credits to enable downloading.
The CLI command generator is a helpful tool to generate a copy-paste command to download this dataset from the form below.
lean data download \
--dataset "Corporate Buybacks" \
--data-type "intentions" \
--ticker "AAPL, MSFT"
lean data download `
--dataset "Corporate Buybacks" `
--data-type "intentions" `
--ticker "AAPL, MSFT"
Harness Corporate Buybacks Intentions data in the QuantConnect Cloud for your backtesting and live trading purposes.
Harness Corporate Buybacks Transactions data in the QuantConnect Cloud for your backtesting and live trading purposes.
What people are saying about this
This product has not received any reviews yet, be the first to post one!
Rate the Module:
Provider offers 2 licensing options
Explore free and paid datasets available on QuantConnect covering fundamentals, pricing, and alternative options.
Dataset Status from to
No Runs
OK
Degraded
Failure
Explore free and paid datasets available on QuantConnect covering fundamentals, pricing, and alternative options.
Lorem ipsum dolor sit amet conjectura lorem ipsum dolor sit amet conjectura lorem ipsum
Configuration Keys
Environment Variables
Lorem ipsum dolor sit amet conjectura lorem ipsum dolor sit amet conjectura lorem ipsum
File Link
Lorem ipsum dolor sit amet conjectura lorem ipsum dolor sit amet conjectura lorem ipsum
Lorem ipsum dolor sit amet conjectura lorem ipsum dolor sit amet conjectura lorem ipsum
Upload a manually created tar or zip file to all cloud data systems.
Add a link and click the Sync Dataset button to upload the dataset
Upload Destinations
The dataset synchronizer is an internal tool for the QuantConnect team to upload data to the
cloud data storage environments. It supports TAR files which are extracted in the root directory
of the cloud data environments.
Take extreme care to carefully structure your data TAR package with
the same folders as the LEAN data folder. Ensure all folders and file names are lowercase as Linux is case-sensitive.
Support
Algorithm Lab is your playground for developing and refining trading algorithms with QuantConnect. Utilize advanced tools, historical data, and robust backtesting to enhance your trading strategies. Transform your ideas into actionable insights and optimize your trading approach with ease.
Sign Up for FreeAlready have an account Log In.
â‘
â‘
â‘
â‘
â‘
Hover and click over the stars to rate us.
It looks like you are not fully satisfied with your experience on QuantConnect, please take a moment to let us know how we can improve our services for you:
If you have a minute to spare, please leave us a review on Trustpilot.
Stories like yours help others see the full potential of QuantConnect.
Organization Name |
---|
Upgrade to Team plan or higher to enable custom invoicing
Changes will be applied to future invoices.
Users will be able to join by following the link in the invitation email.
You’ve been invited by Jared Broad to join his G-Force Organization.
Would you like to accept the invitation?
Are you sure you want to delete the encryption key "undefined"?
Caution: We will not be able to decrypt encrypted projects without the original key.
Drag & Drop or
Keys are added to the local storage in your web browser and not uploaded to QuantConnect. To use an encrypted project on another computer you will need to bring a copy of the key.
This project is encrypted using the key .
This project will be encrypted using the key .