---
title: "Conversion"
description: "A Conversion is a special case of a protective collar with the same strike for all options."
canonical: https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/conversion
markdown: https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/conversion.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/03%20Writing%20Algorithms/22%20Trading%20and%20Orders/08%20Option%20Strategies/28%20Conversion
modified: 2026-10-28
index: https://www.quantconnect.com/llms.txt
---

# Conversion

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Writing Algorithms](https://www.quantconnect.com/docs/v2/writing-algorithms.md) > Trading and Orders > [Option Strategies](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies.md) > Conversion

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

## Introduction

A **Conversion** is a special case of a [protective collar](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/protective-collar.md). It consist of holding one lot of the underlying security, shorting a call, and longing a put with lower strike price. However, the strategy now serves as an delta-neutral arbitration from Option mispricing instead of a hedge strategy. Note that it only attains a true profit when the risk-free return is greater than the [risk-free interest rate](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/risk-free-interest-rate/key-concepts.md).

## Implementation

Follow these steps to implement the conversion strategy:

1. In the `initialize` method, set the start date, set the end date, [subscribe to the underlying Equity](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/us-equity/requesting-data.md#02-Create-Subscriptions), and create an [Option universe](https://www.quantconnect.com/docs/v2/writing-algorithms/universes/equity-options.md).
   ```python
   def initialize(self) -> None:
       self.set_start_date(2024, 9, 1)
       self.set_end_date(2024, 12, 31)
       self.set_cash(100000)

       self.universe_settings.asynchronous = True
       option = self.add_option("GOOG", Resolution.MINUTE)
       self._symbol = option.symbol
       option.set_filter(lambda universe: universe.conversion(30, -5))
   ```
   The `conversion` filter narrows the universe down to just the two contracts you need to form a conversion.
2. In the `on_data` method, select the strike and expiry of the contracts in the strategy legs.
   ```python
   def on_data(self, slice: Slice) -> None:
       if self.portfolio.invested:
           return

       # Get the OptionChain
       chain = slice.option_chains.get(self._symbol, None)
       if not chain:
           return

       # Select an expiry date and ATM strike price
       expiry = max([x.expiry for x in chain])
       strike = sorted(chain, key = lambda x: abs(x.strike - chain.underlying.price))[0].strike
   ```
3. In the `on_data` method, select the contracts and place the orders.
   **Approach A:** Call the `OptionStrategies.conversion` method with the details of each leg and then pass the result to the `buy` method.
   ```python
   conversion = OptionStrategies.conversion(self._symbol, strike, expiry)
   self.buy(conversion, 1)
   ```
   **Approach B:** Create a list of `Leg` objects and then call the [combo_market_order](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/combo-market-orders.md), [combo_limit_order](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/combo-limit-orders.md), or [combo_leg_limit_order](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/combo-leg-limit-orders.md) method.
   ```python
   # Select the call and put contracts
   call = [x for x in chain if x.right == OptionRight.CALL and x.expiry == expiry and x.strike == strike][0]
   put = [x for x in chain if x.right == OptionRight.PUT and x.expiry == expiry and x.strike == strike][0]

   legs = [
       Leg.create(call.symbol, -1),
       Leg.create(put.symbol, 1),
       Leg.create(chain.underlying.symbol, chain.underlying.symbol_properties.contract_multiplier)
   ]
   self.combo_market_order(legs, 1)
   ```

## Strategy Payoff

This is a fixed payoff, delta-neutral strategy. The payoff is

$$ \begin{array}{rcll} C_T & = & (S_T - K)^{+}\\ P_T & = & (K - S_T)^{+}\\ Payoff_T & = & (S_T - S_0 - C_T + P_T + C_0 - P_0)\times m - fee\\ & = & (K - S_0 + C_0 - P_0)\times m - fee \end{array} $$ $$ \begin{array}{rcll} \textrm{where} & C_T & = & \textrm{Call value at time T}\\ & P_T & = & \textrm{Put value at time T}\\ & S_T & = & \textrm{Underlying asset price at time T}\\ & K & = & \textrm{Strike price}\\ & Payoff_T & = & \textrm{Payout total at time T}\\ & S_0 & = & \textrm{Underlying asset price when the trade opened}\\ & C_0 & = & \textrm{Call price when the trade opened (credit received)}\\ & P_0 & = & \textrm{Put price when the trade opened (debit paid)}\\ & m & = & \textrm{Contract multiplier}\\ & T & = & \textrm{Time of expiration} \end{array} $$

In this example, the underlying stock traded at $833.17 at expiration. You traded a call and a put at a strike of $832.50 for $8.10 and $9.50 respectively, and held the underlying.

The following chart shows the payoff at expiration:

![Conversion strategy payoff at expiration](https://cdn.quantconnect.com/docs/i/writing-algorithms/trading-and-orders/option-strategies/conversion.png)

The payoff is only dependent on the strike price and the initial asset prices.

If the Option is American Option, there is a risk of [early assignment](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/options-models/assignment.md) on the contract you sell.

## Example

The following table shows the price details of the assets in the algorithm:

| Asset | Price ($) | Strike ($) |
| --- | --- | --- |
| Call | 8.10 | 832.50 |
| Put | 9.50 | 832.50 |
| Underlying Equity at position opens | 833.17 | - |

Therefore, the payoff is

$$ \begin{array}{rcll} Payoff_T & = & (K - S_0 + C_0 - P_0)\times m - fee\\ & = & (832.50 - 833.17 + 8.10 - 9.50)\times100-1.00\times3\\ & = & -210.00\\ \end{array} $$

So, the strategy loses $210.

The following algorithm implements a conversion Option strategy:

```python
class ConversionOptionStrategy(QCAlgorithm):
    def initialize(self) -> None:
        self.set_start_date(2024, 9, 1)
        self.set_end_date(2024, 12, 31)
        self.set_cash(100000)

        equity = self.add_equity("GOOG", Resolution.MINUTE)
        option = self.add_option("GOOG", Resolution.MINUTE)
        self.symbol = option.symbol

        # set our strike/expiry filter for this option chain
        option.set_filter(lambda universe: universe.conversion(30, -5))

    def on_data(self, data: Slice) -> None:
        # avoid extra orders
        if self.portfolio.invested: return

        # Get the OptionChain of the self.symbol
        chain = data.option_chains.get(self.symbol, None)
        if not chain: return

        # choose the furthest expiration date within 30 days from now on
        expiry = sorted(chain, key = lambda x: x.expiry)[-1].expiry

        # select ATM strike price
        strike = sorted(chain, key = lambda x: abs(x.strike - chain.underlying.price))[0].strike

        # Order Strategy
        conversion = OptionStrategies.conversion(self.symbol, strike, expiry)
        self.buy(conversion, 1)

    def on_end_of_day(self, symbol: Symbol) -> None:
        if symbol.value == "GOOG":
            self.log(f"{self.time}::{symbol}::{self.securities[symbol].price}")
```
