book
Checkout our new book! Hands on AI Trading with Python, QuantConnect, and AWS Learn More arrow

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:

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);

Data Summary

The following table describes the dataset properties:

PropertyValue
Start DateMay 2015
Asset Coverage3,000 US Equities
Data DensitySparse
ResolutionSecond
TimezoneNew York

Requesting Data

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
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 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}");
    }
}

Historical Data

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.

Universe Selection

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.

Universe History

You can get historical universe data in an algorithm and in the Research Environment.

Historical Universe Data in Algorithms

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}")

Historical Universe Data in Research

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.

Remove Subscriptions

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.

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

Classic Algorithm Example

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()
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();
        }
    }
}

Framework Algorithm Example

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")
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");
            }
        }
    }
}

Research Example

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}")

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:

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: