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,318 People Enrolled
Learn algorithmic trading with python for FX. Guided strategy development in easily digestible portions.
Author: QuantConnect
Free | 20,636 People Enrolled
Learn algorithmic trading with python for Futures. Guided strategy development in easily digestible portions.
Author: QuantConnect
Free | 7,474 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,023 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 >
FOREX Data
Dataset by QuantConnect
The FOREX Data by QuantConnect serves 71 foreign exchange (FOREX) pairs, starts on various dates from January 2007, and is delivered on any frequency from tick to daily. This dataset is created by QuantConnect processing raw tick data from OANDA.
FOREX data does not include ask and bid sizes.
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 snippet demonstrates how to request data from the FOREX dataset:
self.eurusd = self.add_forex("EURUSD", Resolution.DAILY).symbol
_symbol = AddForex("EURUSD", Resolution.Daily).Symbol;
The following table describes the dataset properties:
Property | Value |
---|---|
Start Date | January 2007 |
Asset Coverage | 71 Currency pairs |
Data Density | Dense |
Resolution | Tick, Second, Minute, Hour, & Daily |
Timezone | UTC |
Market Hours | Always Open, except from Friday 5 PM EST to Sunday 5 PM EST |
The FOREX price data enables you to trade currency pairs in the global mark. Examples include the following strategies:
For more example algorithms, see Examples.
The FOREX dataset provides QuoteBar and Tick objects.
QuoteBar objects have the following attributes:
Tick objects have the following attributes:
The following table shows the available Forex pairs:
Pairs Available (71) | |||||
---|---|---|---|---|---|
AUDCAD | AUDCHF | AUDHKD | AUDJPY | AUDNZD | AUDSGD |
AUDUSD | CADCHF | CADHKD | CADJPY | CADSGD | CHFHKD |
CHFJPY | CHFZAR | EURAUD | EURCAD | EURCHF | EURCZK |
EURDKK | EURGBP | EURHKD | EURHUF | EURJPY | EURNOK |
EURNZD | EURPLN | EURSEK | EURSGD | EURTRY | EURUSD |
EURZAR | GBPAUD | GBPCAD | GBPCHF | GBPHKD | GBPJPY |
GBPNZD | GBPPLN | GBPSGD | GBPUSD | GBPZAR | HKDJPY |
NZDCAD | NZDCHF | NZDHKD | NZDJPY | NZDSGD | NZDUSD |
SGDCHF | SGDHKD | SGDJPY | TRYJPY | USDCAD | USDCHF |
USDCNH | USDCZK | USDDKK | USDHKD | USDHUF | USDINR |
USDJPY | USDMXN | USDNOK | USDPLN | USDSAR | USDSEK |
USDSGD | USDTHB | USDTRY | USDZAR | ZARJPY |
To add FOREX data to your algorithm, call the AddForexadd_forex method. Save a reference to the Forex Symbol so you can access the data later in your algorithm.
class ForexAlgorithm (QCAlgorithm):
def initialize(self) -> None:
self.set_start_date(2019, 2, 20)
self.set_end_date(2019, 2, 21)
self.set_cash(100000)
self.eurusd = self.add_forex('EURUSD', Resolution.MINUTE).symbol
self.set_benchmark(self.eurusd)
namespace QuantConnect.Algorithm.CSharp
{
public class ForexAlgorithm : QCAlgorithm
{
private Symbol _symbol;
public override void Initialize()
{
SetStartDate(2019, 2, 20);
SetEndDate(2019, 2, 21);
SetCash(100000);
_symbol = AddForex("EURUSD", Resolution.Minute).Symbol;
SetBenchmark(_symbol);
}
}
}
For more information about creating Forex subscriptions, see Requesting Data.
To get the current Forex data, index the QuoteBarsquote_bars, or Ticksticks properties of the current Slice with the Forex Symbol. Slice objects deliver unique events to your algorithm as they happen, but the Slice may not contain data for your security 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 self.eurusd in slice.quote_bars:
quote_bar = slice.quote_bars[self.eurusd]
self.log(f"{self.eurusd} bid at {slice.time}: {quote_bar.bid.close}")
if self.eurusd in slice.ticks:
ticks = slice.ticks[self.eurusd]
for tick in ticks:
self.log(f"{self.eurusd} price at {slice.time}: {tick.price}")
public override void OnData(Slice slice)
{
if (slice.QuoteBars.ContainsKey(_symbol))
{
var quoteBar = slice.QuoteBars[_symbol];
Log($"{_symbol} bid at {slice.Time}: {quoteBar.Bid.Close}");
}
if (slice.Ticks.ContainsKey(_symbol))
{
var ticks = slice.Ticks[_symbol];
foreach (var tick in ticks)
{
Log($"{_symbol} price at {slice.Time}: {tick.Price}");
}
}
}
You can also iterate through all of the data objects in the current Slice.
def on_data(self, slice: Slice) -> None:
for symbol, quote_bar in slice.quote_bars.items():
self.log(f"{symbol} bid at {slice.time}: {quote_bar.bid.close}")
for symbol, ticks in slice.ticks.items():
for tick in ticks:
self.log(f"{symbol} price at {slice.time}: {tick.price}")
public override void OnData(Slice slice)
{
foreach (var kvp in slice.QuoteBars)
{
var symbol = kvp.Key;
var quoteBar = kvp.Value;
Log($"{symbol} bid at {slice.Time}: {quoteBar.Bid.Close}");
}
foreach (var kvp in slice.Ticks)
{
var symbol = kvp.Key;
var ticks = kvp.Value;
foreach (var tick in ticks)
{
Log($"{symbol} price at {slice.Time}: {tick.Price}");
}
}
}
For more information about accessing Forex data, see Handling Data.
To get historical Forex data, call the Historyhistory method with the Forex Symbol. If there is no data in the period you request, the history result is empty.
# DataFrame
history_df = self.history(self.eurusd, 100, Resolution.MINUTE)
# QuoteBar objects
history_quote_bars = self.history[QuoteBar](self.eurusd, 100, Resolution.MINUTE)
# Tick objects
history_ticks = self.history[Tick](self.eurusd, timedelta(seconds=10), Resolution.TICK)
// QuoteBar objects
var historyQuoteBars = History<QuoteBar>(_symbol, 100, Resolution.Minute);
// Tick objects
var historyTicks = History<Tick>(_symbol, TimeSpan.FromSeconds(10), Resolution.Tick);
For more information about historical data, see History Requests.
To remove a Forex pair subscription, call the RemoveSecurityremove_security method.
self.remove_security(self.eurusd)
RemoveSecurity(_symbol);
The RemoveSecurityremove_security method cancels your open orders for the security and liquidates your holdings.
The FOREX dataset provides QuoteBar and Tick objects.
QuoteBar objects have the following attributes:
Tick objects have the following attributes:
The following example algorithm implements a FOREX carry trade. It buys the FOREX pair of the country with the lowest interest rate and sells the FOREX pair of the country with the highest interest rate.
from AlgorithmImports import *
from QuantConnect.DataSource import *
class ForexCarryTradeAlgorithm(QCAlgorithm):
def initialize(self) -> None:
self.set_start_date(2008, 1, 1)
self.set_cash(25000)
# We will use hard-coded interest rates for each base currency
self.rates = {
"USDAUD": 1.5, # Australia
"USDCAD": 0.5, # Canada
"USDCNY": 4.35, # China
"USDEUR": 0.0, # Euro Area
"USDINR": 6.5, # India
"USDJPY": -0.1, # Japan
"USDMXN": 4.25, # Mexico
"USDTRY": 7.5, # Turkey
"USDZAR": 7.0 # South Africa
}
# Subscribe to forex data for trading
for ticker in self.rates:
self.add_forex(ticker, Resolution.DAILY)
# Use a month counter as variable to control rebalancing
self.month = -1
def on_data(self, slice: Slice) -> None:
# Monthly rebalance checker
if self.month == self.time.month:
return
self.month = self.time.month
# Long the pair with highest interest rate and sell the pair with the lowest to earn the max monetary inflation difference between the two
sorted_rates = sorted(self.rates.items(), key = lambda x: x[1])
self.set_holdings(sorted_rates[0][0], -0.5)
self.set_holdings(sorted_rates[-1][0], 0.5)
using QuantConnect.DataSource;
namespace QuantConnect
{
public class ForexCarryTradeAlgorithm : QCAlgorithm
{
// Use a month counter as variable to control rebalancing
private int _month = -1;
private Dictionary<string, decimal> _rates;
public override void Initialize()
{
SetStartDate(2008, 1, 1);
SetCash(25000);
// We will use hard-coded interest rates for each base currency
_rates = new Dictionary<string, decimal>()
{
{"USDAUD", 1.5m}, // Australia
{"USDCAD", 0.5m}, // Canada
{"USDCNY", 4.35m}, // China
{"USDEUR", 0.0m}, // Euro Area
{"USDINR", 6.5m}, // India
{"USDJPY", -0.1m}, // Japan
{"USDMXN", 4.25m}, // Mexico
{"USDTRY", 7.5m}, // Turkey
{"USDZAR", 7.0m} // South Africa
};
// Subscribe to forex data for trading
foreach (var ticker in _rates.Keys)
{
AddForex(ticker, Resolution.Daily);
}
}
public override void OnData(Slice slice)
{
// Monthly rebalance checker
if (_month == Time.Month) return;
_month = Time.Month;
// Long the pair with highest interest rate and sell the pair with the lowest to earn the max monetary inflation difference between the two
var sortedRates = (from kvp in _rates orderby kvp.Value ascending select kvp.Key).ToArray();
SetHoldings(sortedRates[0], -0.5);
SetHoldings(sortedRates[sortedRates.Length-1], 0.5);
}
}
}
The following example algorithm implements a FOREX carry trade. It buys the FOREX pair of the country with the lowest interest rate and sells the FOREX pair of the country with the highest interest rate.
from AlgorithmImports import *
from QuantConnect.DataSource import *
class ForexCarryTradeAlgorithm(QCAlgorithm):
def initialize(self) -> None:
self.set_start_date(2008, 1, 1)
self.set_cash(25000)
def to_symbol(ticker: str) -> Symbol:
return Symbol.create(ticker, SecurityType.FOREX, Market.OANDA)
# We will use hard-coded interest rates for each base currency
rates = {
to_symbol("USDAUD"): 1.5, # Australia
to_symbol("USDCAD"): 0.5, # Canada
to_symbol("USDCNY"): 4.35, # China
to_symbol("USDEUR"): 0.0, # Euro Area
to_symbol("USDINR"): 6.5, # India
to_symbol("USDJPY"): -0.1, # Japan
to_symbol("USDMXN"): 4.25, # Mexico
to_symbol("USDTRY"): 7.5, # Turkey
to_symbol("USDZAR"): 7.0 # South Africa
}
self.set_universe_selection(ManualUniverseSelectionModel(list(rates.keys())))
# A custom alpha model to emit insight according to interest rate
self.set_alpha(IntestRatesAlphaModel(rates))
# Equal size to capitalize the monetary value of quote currency only based on interest rate difference
# For dollar-neutral to save margin cost
self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel(Expiry.END_OF_MONTH))
class IntestRatesAlphaModel(AlphaModel):
def __init__(self, rates: float) -> None:
self.rates = rates
# Variable to control the rebalancing time
self.month = -1
def update(self, algorithm: QCAlgorithm, slice: Slice) -> List[Insight]:
# Monthly rebalance
if self.month == algorithm.time.month:
return []
self.month = algorithm.time.month
# # Long the pair with highest interest rate and sell the pair with the lowest to earn the max monetary inflation difference between the two
sorted_rates = sorted(self.rates.items(), key = lambda x: x[1])
self.set_holdings(sorted_rates[0][0], -0.5)
self.set_holdings(sorted_rates[-1][0], 0.5)
sorted_rates = sorted(self.rates.items(), key = lambda x: x[1])
return Insight.group(
Insight.price(sorted_rates[0][0], Expiry.END_OF_MONTH, InsightDirection.UP),
Insight.price(sorted_rates[-1][0], Expiry.END_OF_MONTH, InsightDirection.DOWN)
)
using QuantConnect.DataSource;
namespace QuantConnect
{
public class ForexCarryTradeAlgorithm : QCAlgorithm
{
public override void Initialize()
{
SetStartDate(2008, 1, 1);
SetCash(25000);
Symbol toSymbol(string ticker)
{
return QuantConnect.Symbol.Create(ticker, SecurityType.Forex, Market.Oanda);
}
// We will use hard-coded interest rates for each base currency
var rates = new Dictionary<Symbol, decimal>()
{
{toSymbol("USDAUD"), 1.5m}, // Australia
{toSymbol("USDCAD"), 0.5m}, // Canada
{toSymbol("USDCNY"), 4.35m}, // China
{toSymbol("USDEUR"), 0.0m}, // Euro Area
{toSymbol("USDINR"), 6.5m}, // India
{toSymbol("USDJPY"), -0.1m}, // Japan
{toSymbol("USDMXN"), 4.25m}, // Mexico
{toSymbol("USDTRY"), 7.5m}, // Turkey
{toSymbol("USDZAR"), 7.0m} // South Africa
};
SetUniverseSelection(new ManualUniverseSelectionModel(rates.Keys));
// A custom alpha model to emit insight according to interest rate
SetAlpha(new IntestRatesAlphaModel(rates));
// Equal size to capitalize the monetary value of quote currency only based on interest rate difference
// For dollar-neutral to save margin cost
SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel(Expiry.EndOfMonth));
}
}
public class IntestRatesAlphaModel : AlphaModel
{
// Variable to control the rebalancing time
private int _month = -1;
private Dictionary<Symbol, decimal> _rates;
public IntestRatesAlphaModel(Dictionary<Symbol, decimal> rates)
{
_rates = rates;
}
public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice slice)
{
// Monthly rebalance
if (_month == algorithm.Time.Month)
{
return Enumerable.Empty<Insight>();
}
_month = algorithm.Time.Month;
// Long the pair with highest interest rate and sell the pair with the lowest to earn the max monetary inflation difference between the two
sorted_rates = sorted(self.rates.items(), key = lambda x: x[1])
self.set_holdings(sorted_rates[0][0], -0.5)
self.set_holdings(sorted_rates[-1][0], 0.5)
var sortedRates = (from kvp in _rates orderby kvp.Value ascending select kvp.Key).ToArray();
return Insight.Group(
Insight.Price(sortedRates[0], Expiry.EndOfMonth, InsightDirection.Up),
Insight.Price(sortedRates[sortedRates.Length-1], Expiry.EndOfMonth, InsightDirection.Down)
);
}
}
}
FOREX Data 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
FOREX Data can be downloaded on premise with the LEAN CLI, for a charge per file downloaded. This download is for the licensed organization's internal LEAN use only and cannot be redistributed or converted in any format.
Free with Subscription | 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 "FOREX Data" \
--data-type "quote" \
--ticker "EURUSD, GBPUSD" \
--resolution "minute" \
--start "20240414" \
--end "20250414"
lean data download `
--dataset "FOREX Data" `
--data-type "quote" `
--ticker "EURUSD, GBPUSD" `
--resolution "minute" `
--start "20240414" `
--end "20250414"
Freely harness gigabytes of FOREX data in the QuantConnect Cloud for your backtesting and live trading purposes.
FOREX Second resolution archives in LEAN format for on premise backtesting and research. One file per ticker/day.
FOREX Minute resolution archives in LEAN format for on premise backtesting and research. One file per ticker/day.
FOREX Hour resolution archives in LEAN format for on premise backtesting and research. One file per ticker.
FOREX Daily resolution archives in LEAN format for on premise backtesting and research. One file per ticker.
Bulk download second data
Bulk download minute data
Bulk download hour data
Bulk download daily data
Bulk download second data
Bulk download minute data
Bulk download hour data
Bulk download daily data
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 13 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 .