Smart Insider
Corporate Buybacks
Introduction
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.
For more information about the Corporate Buybacks dataset, including CLI commands and pricing, see the dataset listing.
About the Provider
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.
Getting Started
The following snippet demonstrates how to request data from the Corporate Buybacks dataset:
from QuantConnect.DataSource import * self.symbol = self.AddEquity("AAPL", Resolution.Minute).Symbol self.intention_symbol = self.AddData(SmartInsiderIntention, self.symbol).Symbol self.transaction_symbol = self.AddData(SmartInsiderTransaction, self.symbol).Symbol self.AddUniverse(SmartInsiderIntentionUniverse, "SmartInsiderIntentionUniverse", Resolution.Daily, self.IntentionSelection) self.AddUniverse(SmartInsiderTransactionUniverse, "SmartInsiderTransactionUniverse", Resolution.Daily, self.TransactionSelection)
using QuantConnect.DataSource; _symbol = AddEquity("AAPL", Resolution.Minute).Symbol; _intentionSymbol = AddData<SmartInsiderIntention>(_symbol).Symbol; _transactionSymbol = AddData<SmartInsiderTransaction>(_symbol).Symbol; AddUniverse<SmartInsiderIntentionUniverse>("SmartInsiderIntentionUniverse", Resolution.Daily, IntentionSelection); AddUniverse<SmartInsiderTransactionUniverse>("SmartInsiderTransactionUniverse", Resolution.Daily, TransactionSelection);
Data Point Attributes
The Corporate Buybacks dataset provides SmartInsiderIntention, SmartInsiderIntentionUniverse, SmartInsiderTransaction, and SmartInsiderTransactionUniverse objects.
SmartInsiderIntention Attributes
SmartInsiderIntention objects have the following attributes:
SmartInsiderIntentionUniverse Attributes
SmartInsiderIntentionUniverse objects have the following attributes:
SmartInsiderTransaction Attributes
SmartInsiderTransaction objects have the following attributes:
SmartInsiderTransactionUniverse Attributes
SmartInsiderTransactionUniverse objects have the following attributes:
Requesting Data
To add Corporate Buybacks data to your algorithm, call the AddData 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.SetStartDate(2016, 1, 1) self.SetEndDate(2021, 1, 1) self.SetCash(100000) self.symbol = self.AddEquity("AAPL", Resolution.Minute).Symbol self.intention_symbol = self.AddData(SmartInsiderIntention, self.symbol).Symbol self.transaction_symbol = self.AddData(SmartInsiderTransaction, self.symbol).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; } } }
Accessing Data
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 OnData(self, slice: Slice) -> None: if slice.ContainsKey(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.ContainsKey(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 Get method.
def OnData(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}"); } }
Historical Data
To get historical Corporate Buybacks data, call the History 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.
Universe Selection
To select a dynamic universe of US Equities based on Corporate Buybacks data, call the AddUniverse method with the SmartInsiderIntentionUniverse class or the SmartInsiderTransactionUniverse and a selection function.
def Initialize(self) -> None: self.AddUniverse(SmartInsiderIntentionUniverse, "SmartInsiderIntentionUniverse", Resolution.Daily, self.IntentionSelection) self.AddUniverse(SmartInsiderTransactionUniverse, "SmartInsiderTransactionUniverse", Resolution.Daily, self.TransactionSelection) def IntentionSelection(self, alt_coarse: List[SmartInsiderIntentionUniverse]) -> List[Symbol]: return [d.Symbol for d in alt_coarse \ if d.Percentage > 0.005 \ and d.USDMarketCap > 100000000] def TransactionSelection(self, alt_coarse: List[SmartInsiderTransactionUniverse]) -> List[Symbol]: return [d.Symbol for d in alt_coarse \ if d.BuybackPercentage > 0.005 \ and d.USDMarketCap > 100000000]
public override void Initialize() { AddUniverse("SmartInsiderIntentionUniverse", Resolution.Daily, IntentionSelection); AddUniverse("SmartInsiderTransactionUniverse", Resolution.Daily, TransactionSelection); } private IEnumerable<Symbol> IntentionSelection(IEnumerable<SmartInsiderIntentionUniverse> altCoarse) { return from d in altCoarse where d.Percentage > 0.005m && d.USDMarketCap > 100000000m select d.Symbol; } private IEnumerable<Symbol> TransactionSelection(IEnumerable<SmartInsiderTransactionUniverse> altCoarse) { return from d in altCoarse where d.BuybackPercentage > 0.005m && d.USDMarketCap > 100000000m select d.Symbol; }
For more information about dynamic universes, see Universes.
Remove Subscriptions
To remove a subscription, call the RemoveSecurity method.
self.RemoveSecurity(self.intention_symbol) self.RemoveSecurity(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.
Example Applications
The Corporate Buybacks dataset enables you to design strategies using information on company buyback programs. Examples include the following strategies:
- Buying securities when the company announces an upcoming share buyback on the premise that the reduction in supply (shares outstanding) will drive up the remaining shares price
- Buying securities when the company executes an upcoming share buyback on the premise that the reduction in supply (shares outstanding) will drive up the remaining shares price