---
title: "Requesting Data"
description: "Request Crypto Future data in your algorithm to receive a feed of asset prices in the OnData method."
canonical: https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/crypto-futures/requesting-data
markdown: https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/crypto-futures/requesting-data.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/03%20Writing%20Algorithms/03%20Securities/99%20Asset%20Classes/04%20Crypto%20Futures/01%20Requesting%20Data
modified: 2026-10-29
index: https://www.quantconnect.com/llms.txt
---

# Requesting Data

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Writing Algorithms](https://www.quantconnect.com/docs/v2/writing-algorithms.md) > Securities > [Asset Classes](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes.md) > [Crypto Futures](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/crypto-futures.md) > Requesting Data

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

Request Crypto Futures data in your algorithm to receive a feed of asset prices in the `on_data` method. For more information about the specific datasets we use for backtests, see the [Binance Crypto Future Price Data dataset listing](https://www.quantconnect.com/datasets/binance-cryptofuture-price-data). To trade Crypto Futures live, you can use the [QuantConnect data provider](https://www.quantconnect.com/docs/v2/cloud-platform/datasets/quantconnect/crypto-futures.md).

## Create Subscriptions

To create a Crypto Futures subscription, in the `initialize` method, call the `add_crypto_future` method. The `add_crypto_future` method returns a `CryptoFuture` object, which contains a `symbol` property. Save a reference to the `symbol` so you can use it in `on_data` to access the security data in the `Slice`.

```python
self._symbol = self.add_crypto_future("BTCUSD").symbol
```

The `add_crypto_future` method creates a subscription for a single Crypto Futures asset and adds it to your **user-defined** universe.

To view the supported assets in the Crypto Futures dataset, see [Supported Assets](https://www.quantconnect.com/docs/v2/writing-algorithms/datasets/quantconnect/binance-crypto-future-price-data.md#09-Supported-Assets).

## Resolutions

The following table shows the available resolutions and data formats for Crypto Futures contract subscriptions:

| Resolution | TradeBar | QuoteBar | Trade Tick | Quote Tick |
| --- | --- | --- | --- | --- |
| `TICK` | Not supported | Not supported | Supported✓ | Supported✓ |
| `SECOND` | Supported✓ | Supported✓ | Not supported | Not supported |
| `MINUTE` | Supported✓ | Supported✓ | Not supported | Not supported |
| `HOUR` | Supported✓ | Supported✓ | Not supported | Not supported |
| `DAILY` | Supported✓ | Supported✓ | Not supported | Not supported |

The default resolution for Crypto Futures subscriptions is `Resolution.MINUTE`. To change the resolution, pass a `resolution` argument to the `add_crypto_future` method.

```python
self._symbol = self.add_crypto_future("BTCUSD", Resolution.DAILY).symbol
```

To create custom resolution periods, see [Consolidating Data](https://www.quantconnect.com/docs/v2/writing-algorithms/consolidating-data/getting-started.md).

## Supported Markets

The following `Market` enumeration members are available for Cryptofuture:

*Members of `QuantConnect.Market` (JSON): https://www.quantconnect.com/services/inspector?type=T:QuantConnect.Market&language=python*

Fields: `BINANCE`, `Binance`, `BYBIT`, `Bybit`, `DYDX`

```python
self._symbol = self.add_crypto_future("BTCUSD", market=Market.BINANCE).symbol
```

The [brokerage models](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/key-concepts.md) have a default market for each asset class. If you set a brokerage model, you may not need to specify the market to use.

## Fill Forward

Fill forward means if there is no data point for the current [slice](https://www.quantconnect.com/docs/v2/writing-algorithms/key-concepts/time-modeling/timeslices.md), LEAN uses the previous data point. Fill forward is the default data setting. If you disable fill forward, you may get [stale fills](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/trade-fills/key-concepts.md#06-Stale-Fills) or you may see trade volume as zero.

To disable fill forward for a security, set the `fill_forward` argument to false when you create the security subscription.

```python
self._symbol = self.add_crypto_future("BTCUSD", fill_forward=False).symbol
```

## Margin and Leverage

LEAN models buying power and margin calls to ensure your algorithm stays within the margin requirements. The amount of leverage available to you depends on the brokerage you use. To change the amount of leverage you can use for a security, pass a `leverage` argument to the `add_crypto_future` method.

```python
self._symbol = self.add_crypto_future("BTCUSD", leverage=3).symbol
```

For more information about the leverage each brokerage provides, see [Brokerages](https://www.quantconnect.com/docs/v2/cloud-platform/live-trading/brokerages.md).

## Data Normalization

The data normalization mode doesn't affect the data that LEAN passes to `on_data` or the data from [history request](https://www.quantconnect.com/docs/v2/writing-algorithms/historical-data/history-requests.md). If you change the data normalization mode, it won't change the outcome.

## Properties

The `add_crypto_future` method returns a `CryptoFuture` object, which have the following properties:

*Members of `QuantConnect.Securities.CryptoFuture.CryptoFuture` (JSON): https://www.quantconnect.com/services/inspector?type=T:QuantConnect.Securities.CryptoFuture.CryptoFuture&language=python*

## Examples

The following examples demonstrate some common practices for requesting Crypto Futures data.

### Example 1: Respect Lot Sizes

Like Futures, Crypto Futures contracts have a fixed discrete lot size to trade instead of fractional like spot Crypto pairs. The following algorithm demonstrates how to place orders that respect the lot size to avoid rounding errors.

```python
class CryptoFutureAlgorithm(QCAlgorithm):

    def initialize(self) -> None:
        self.set_start_date(2024, 9, 1)
        self.set_end_date(2024, 12, 31)
        # Set brokerage and account type to match your brokerage environment for accurate fee and margin behavior.
        self.set_brokerage_model(BrokerageName.BINANCE, AccountType.MARGIN)
        # In the Binance brokerage, you can't trade with USD.
        # Set the account currency as USDT and add the starting cash.
        self.set_account_currency("USDT", 100_000)
        # Subscribe to the BTCUSDT perpetual Future contract.
        self._symbol = self.add_crypto_future("BTCUSDT").symbol

    def on_data(self, slice: Slice) -> None:
        # Only place orders when market is open since market on open orders aren't supported.
        if not self.portfolio.invested and self.is_market_open(self._symbol):
            # Get the lot size from the symbol properties. Placing an order that respects the lot size
            # ensures the order is valid and allows accurate profit and risk calculations for the whole portfolio.
            lot_size = self.securities[self._symbol].symbol_properties.lot_size
            # This example demonstrates an initial desired order size of 2.5 contracts, which will be rounded
            # to 2 contracts since the lot size is 1.
            quantity = 2.5 // lot_size * lot_size
            self.market_order(self._symbol, quantity)
```
