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,018 People Enrolled
Learn algorithmic trading with python for FX. Guided strategy development in easily digestible portions.
Author: QuantConnect
Free | 20,592 People Enrolled
Learn algorithmic trading with python for Futures. Guided strategy development in easily digestible portions.
Author: QuantConnect
Free | 7,425 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 | 28,801 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
Optimizing a Gold-SPY Portfolio Using Hidden Markov Models for Market Downtime
Gold-SPY portfolio optimization using Hidden Markov Models for minimizing market downturn risk....
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 >
US Equities Short Availability
Dataset by QuantConnect
The US Equity Short Availability dataset provides the available shares for open short positions and their borrowing cost in the US Equity market. The data covers 10,500 US Equities, starts in January 2018, and is delivered on a daily frequency. This dataset is created using information from the exchanges.
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.
QuantConnect was founded in 2012 to serve quants everywhere with the best possible algorithmic trading technology. Seeking to disrupt a notoriously closed-source industry, QuantConnect takes a radically open-source approach to algorithmic trading. Through the QuantConnect web platform, more than 50,000 quants are served every month.
The following snippets demonstrate how to request data from the US Equities Short Availability dataset.
security.set_shortable_provider(InteractiveBrokersShortableProvider())
security.SetShortableProvider(new InteractiveBrokersShortableProvider());
security.set_shortable_provider(LocalDiskShortableProvider("axos"))
security.SetShortableProvider(new LocalDiskShortableProvider("axos"));
The following table describes the dataset properties:
Property | Value |
---|---|
Start Date | January 2018 |
Asset Coverage | 10,500 US Equities |
Data Density | Sparse |
Resolution | Daily |
Timezone | New York |
The US Equities Short Availability dataset enables you to accurately design strategies harnessing information about short availability. Examples include the following use cases:
For more example algorithms, see Examples.
To add US Equities Short Availability data to your algorithm, set the shortable provider of each US Equity in your algorithm.
class ShortAvailabilityDataAlgorithm(QCAlgorithm):
def initialize(self) -> None:
self.set_start_date(2019, 1, 1)
security = self.add_equity("AAPL")
# Set shortable provider as IB
security.set_shortable_provider(InteractiveBrokersShortableProvider())
self._symbol = security.symbol
using QuantConnect.Data.Shortable;
namespace QuantConnect
{
public class ShortAvailabilityDataAlgorithm : QCAlgorithm
{
private Symbol _symbol;
public override void Initialize()
{
SetStartDate(2019, 1, 1);
var security = AddEquity("AAPL");
// Set shortable provider as IB
security.SetShortableProvider(new InteractiveBrokersShortableProvider());
_symbol = security.Symbol;
}
}
}
To check how many shares are available for a security to short, call the ShortableQuantityshortable_quantity method of the ShortableProvidershortable_provider
var shortableProvider = Securities[_symbol].ShortableProvider;
// Get the shortable quantity of the selected symbol at the selected time
var shortableQuantity = shortableProvider.ShortableQuantity(_symbol, Time);
// Check if there are a certain quantity of shares available
var quantity = 100;
var isShortableQuantity = Shortable(_symbol, quantity);
shortable_provider = self.securities[self._symbol].shortable_provider
# Get the shortable quantity of the selected symbol at the selected time
shortable_quantity = shortable_provider.shortable_quantity(self._symbol, self.time)
# Check if there are a certain quantity of shares available
quantity = 100;
is_shortable_quantity = self.shortable(self._symbol, quantity)
To check borrowing cost, call the FeeRatefee_rate or RebateRaterebate_rate method of the ShortableProvidershortable_provider
var feeRate = shortableProvider.FeeRate(_symbol, Time);
var rebateRate = shortableProvider.RebateRate(_symbol, Time);
fee_rate = shortable_provider.fee_rate(self._symbol, self.time);
rebate_rate = shortable_provider.rebate_rate(self._symbol, self.time);
The following example algorithm shorts GameStop every day there are shares available to short. If the algorithm receives a margin call, it liquidates the position and start again on the next day.
from AlgorithmImports import *
class ShortAvailabilityDataAlgorithm(QCAlgorithm):
def initialize(self) -> None:
self.set_start_date(2021, 1, 1)
self.set_end_date(2021, 7, 1)
self.set_cash(1000)
# Seed the security price as the last known price, such that the price data is immediately available at initial rebalance
self.set_security_initializer(MySecurityInitializer(self.brokerage_model, FuncSecuritySeeder(self.get_last_known_prices)))
self.equity = self.add_equity("GME")
# Set up daily rebalance scheduled event, since shortable quantity is updated daily
self.schedule.on(
self.date_rules.every_day(self.equity.symbol),
self.time_rules.after_market_open(self.equity.symbol, 10),
self.rebalance)
def rebalance(self) -> None:
symbol = self.equity.symbol
# You can obtain the shortable quantity to decide the submission of a short order
shortable_quantity = self.equity.shortable_provider.shortable_quantity(symbol, self.time)
if not shortable_quantity:
shortable_quantity = 0
# Fee and rebate rate is also available, such that you can calculate the expected return and decide if the margin is worthwhile
self.plot('Total Shortable Quantity', symbol, shortable_quantity)
self.plot('Borrowing Cost', "Fee Rate", self.equity.shortable_provider.fee_rate(symbol, self.time))
self.plot('Borrowing Cost', "Rebate Rate", self.equity.shortable_provider.rebate_rate(symbol, self.time))
# Test whether we can short the desired quantity
quantity = self.calculate_order_quantity(symbol, -1)
if self.shortable(symbol, quantity):
self.market_order(symbol, quantity)
def on_margin_call_warning(self) -> None:
self.liquidate()
class MySecurityInitializer(BrokerageModelSecurityInitializer):
def __init__(self, brokerage_model: IBrokerageModel, security_seeder: ISecuritySeeder) -> None:
super().__init__(brokerage_model, security_seeder)
def initialize(self, security: Security) -> None:
super().initialize(security)
# Set the shortable provider as your broker for accurate short reality modeling
security.set_shortable_provider(InteractiveBrokersShortableProvider())
using QuantConnect.Data.Shortable;
namespace QuantConnect
{
public class ShortAvailabilityDataAlgorithm : QCAlgorithm
{
private Equity _equity;
public override void Initialize()
{
SetStartDate(2021, 1, 1);
SetEndDate(2021, 7, 1);
SetCash(1000);
// Seed the security price as the last known price, such that the price data is immediately available at initial rebalance
SetSecurityInitializer(new MySecurityInitializer(BrokerageModel, new FuncSecuritySeeder(GetLastKnownPrices)));
_equity = AddEquity("GME");
// Set up daily rebalance scheduled event, since shortable quantity is updated daily
Schedule.On(
DateRules.EveryDay(_equity.Symbol),
TimeRules.AfterMarketOpen(_equity.Symbol, 10),
Rebalance);
}
public void Rebalance()
{
var symbol = _equity.Symbol;
// You can obtain the shortable quantity to decide the submission of a short order
// Fee and rebate rate is also available, such that you can calculate the expected return and decide if the margin is worthwhile
Plot("Total Shortable Quantity", symbol, _equity.ShortableProvider.ShortableQuantity(symbol, Time) ?? 0m);
Plot("Borrowing Cost", "Fee Rate", _equity.ShortableProvider.FeeRate(symbol, Time));
Plot("Borrowing Cost", "Rebate Rate", _equity.ShortableProvider.RebateRate(symbol, Time));
// Test whether we can short the desired quantity
var quantity = CalculateOrderQuantity(symbol, -1m);
if (Shortable(symbol, quantity))
{
MarketOrder(symbol, quantity);
}
}
public override void OnMarginCallWarning()
{
Liquidate();
}
class MySecurityInitializer : BrokerageModelSecurityInitializer
{
public MySecurityInitializer(IBrokerageModel brokerageModel, ISecuritySeeder securitySeeder)
: base(brokerageModel, securitySeeder) {}
public override void Initialize(Security security)
{
base.Initialize(security);
// Set the shortable provider as your broker for accurate short reality modeling
security.SetShortableProvider(new InteractiveBrokersShortableProvider());
}
}
}
}
The following example algorithm shorts GameStop every day there are shares available to short. If the algorithm receives a margin call, it liquidates the position and start again on the next day.
from AlgorithmImports import *
from QuantConnect.DataSource import *
class ShortAvailabilityDataAlgorithm(QCAlgorithm):
def initialize(self) -> None:
self.set_start_date(2021, 1, 1)
self.set_end_date(2021, 7, 1)
self.set_cash(1000)
# Seed the security price as the last known price, such that the price data is immediately available at initial rebalance
self.set_security_initializer(MySecurityInitializer(self.brokerage_model, FuncSecuritySeeder(self.get_last_known_prices)))
self.set_universe_selection(ManualUniverseSelectionModel(
[Symbol.create("GME", SecurityType.EQUITY, Market.USA)]))
# Emit down-direction insights to short all securities in the universe
self.set_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.DOWN, timedelta(1)))
self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())
self.set_execution(ShortableExecutionModel())
# On Margin Call, emit flat-direction insights to liquidate the positions
def on_margin_call_warning(self) -> None:
self.emit_insights([Insight.price(kvp.Key, timedelta(1), InsightDirection.FLAT)
for kvp in self.securities if kvp.Value.invested])
class ShortableExecutionModel(ExecutionModel):
def __init__(self) -> None:
self.targets_collection = PortfolioTargetCollection()
def execute(self, algorithm: QCAlgorithm, targets: List[PortfolioTarget]) -> None:
'''Immediately submits orders for the specified portfolio targets.
Args:
algorithm: The algorithm instance
targets: The portfolio targets to be ordered'''
# for performance we check count value, OrderByMarginImpact and ClearFulfilled are expensive to call
self.targets_collection.add_range(targets)
if self.targets_collection.count > 0:
for target in self.targets_collection.order_by_margin_impact(algorithm):
# calculate remaining quantity to be ordered
quantity = OrderSizing.get_unordered_quantity(algorithm, target)
# If the quantity is negative, ensure that the security is shortable
if quantity > 0 or algorithm.shortable(target.symbol, quantity):
algorithm.market_order(target.symbol, quantity)
self.targets_collection.clear_fulfilled(algorithm)
class MySecurityInitializer(BrokerageModelSecurityInitializer):
def __init__(self, brokerage_model: IBrokerageModel, security_seeder: ISecuritySeeder) -> None:
super().__init__(brokerage_model, security_seeder)
def initialize(self, security: Security) -> None:
super().initialize(security)
# Set the shortable provider as IB
security.set_shortable_provider(InteractiveBrokersShortableProvider())
using QuantConnect.Data.Shortable;
namespace QuantConnect
{
public class ShortAvailabilityDataAlgorithm : QCAlgorithm
{
public override void Initialize()
{
SetStartDate(2021, 1, 1);
SetEndDate(2021, 7, 1);
SetCash(1000);
// Seed the security price as the last known price, such that the price data is immediately available at initial rebalance
SetSecurityInitializer(new MySecurityInitializer(BrokerageModel, new FuncSecuritySeeder(GetLastKnownPrices)));
SetUniverseSelection(new ManualUniverseSelectionModel(
QuantConnect.Symbol.Create("GME", SecurityType.Equity, Market.USA)));
// Emit down-direction insights to short all securities in the universe
SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Down, TimeSpan.FromDays(1)));
SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());
SetExecution(new ShortableExecutionModel());
}
// On Margin Call, emit flat-direction insights to liquidate the positions
public override void OnMarginCallWarning()
{
EmitInsights(Securities
.Where(kvp => kvp.Value.Invested)
.Select(kvp => Insight.Price(kvp.Key, TimeSpan.FromDays(1), InsightDirection.Flat))
.ToArray());
}
public class ShortableExecutionModel : ImmediateExecutionModel
{
private readonly PortfolioTargetCollection _targetsCollection = new PortfolioTargetCollection();
public override void Execute(QCAlgorithm algorithm, IPortfolioTarget[] targets)
{
_targetsCollection.AddRange(targets);
// for performance we check count value, OrderByMarginImpact and ClearFulfilled are expensive to call
if (_targetsCollection.Count > 0)
{
foreach (var target in _targetsCollection.OrderByMarginImpact(algorithm))
{
// calculate remaining quantity to be ordered
var quantity = OrderSizing.GetUnorderedQuantity(algorithm, target);
// If the quantity is negative, ensure that the security is shortable
if (quantity > 0 || algorithm.Shortable(target.Symbol, quantity))
{
algorithm.MarketOrder(target.Symbol, quantity);
}
}
_targetsCollection.ClearFulfilled(algorithm);
}
}
}
class MySecurityInitializer : BrokerageModelSecurityInitializer
{
public MySecurityInitializer(IBrokerageModel brokerageModel, ISecuritySeeder securitySeeder)
: base(brokerageModel, securitySeeder) {}
public override void Initialize(Security security)
{
base.Initialize(security);
// Set the shortable provider as IB
security.SetShortableProvider(new InteractiveBrokersShortableProvider());
}
}
}
}
US Equities Short Availability is allowed to be used in the cloud for personal and commercial projects for free. The data is permissioned for use within the licensed organization only
Free | Documentation
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.
Enable realistic modeling of shortable stock limits for your QuantConnect Cloud backtesting. Plot and explore the data in backtesting and research.
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 1 licensing option
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 .