Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OptionStrategies for Iron Butterfly #8072

Conversation

LouisSzeto
Copy link
Collaborator

@LouisSzeto LouisSzeto commented Jun 4, 2024

Description

Related Issue

NA

Motivation and Context

Missing feature

Requires Documentation Change

Add helper method usage in

  • Trading and Orders -> Option Strategies -> Iron Butterfly
  • Trading and Orders -> Option Strategies -> Short Iron Butterfly
  • Trading and Orders -> Option Strategies -> Short Iron Condor

How Has This Been Tested?

  • Added unit tests
  • Added regression test

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves implementation)
  • Performance (non-breaking change which improves performance. Please add associated performance test and results)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

Copy link
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Minor comments shared

Common/Securities/Option/OptionStrategies.cs Show resolved Hide resolved
@@ -350,6 +350,21 @@ public static ImmutableList<OptionStrategyDefinition> AllDefinitions
(legs, p) => p.Expiration > legs[0].Expiration)
);

/// <summary>
/// Iron Butterfly strategy consists of a long ATM call, a long ATM put, a short OTM call, and a short OTM put.
/// The strike spread between ATM & OTM call and put are the same. All at the same expiration date.
Copy link
Member

@Martin-Molinero Martin-Molinero Jun 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

& breaks the summary, should be and 👍
Sure long ATM call, a long ATM put, a short OTM call, and a short OTM put. is right? I think the sides are the other way round, we sell ATM take a profit and protect us with the bought contracts OTM

See https://www.investopedia.com/articles/active-trading/030314/what-iron-butterfly-option-strategy.asp

For example, let's say ABC Co. rallied to $50 in August and the trader wants to use an iron butterfly to generate profits. The trader writes both a September 50 call and put, receiving a $4.00 premium for each contract, and also buys a September 60 call and September 40 put for $0.75 each. 

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this example is Short the Iron Butterfly. Iron Butterfly is made up by a bear call spread and a bull put spread, so OTM ones are shorting. You can a description of "Short" in https://en.wikipedia.org/wiki/Iron_butterfly_(options_strategy)

Copy link
Member

@Martin-Molinero Martin-Molinero Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm this is IBs example, doesn't seem to match
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image then this description is wrong? same for `IronButterfly` the description seems the other way round to me

@Martin-Molinero
Copy link
Member

Please rebase from master, the regression test interface was changed & a unit test CI bug was shipped

@LouisSzeto LouisSzeto force-pushed the feature-iron-butterfly-option-strategy branch from f7bf2c4 to c4ddee9 Compare June 26, 2024 01:24
Copy link
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some contradiction on the definitions and examples of Iron butterfly available online in difference sources, we will follow the definition of fidelity & wiki

Copy link
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some contradiction on the definitions and examples of Iron butterfly available online in difference sources, we will follow the definition of fidelity & wiki

Never mind, after re reviewing all sources we should match tasty/ib/investopedia, please revert implementation names

fidelity, wikipedia say A -> this PR
      -even wikipedia actually calls Long iron butterfly (reverse iron butterfly) -> meaning the 'short' is the iron butterfly
tasty, IB, investopedia say B

Copy link
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 👍

@Martin-Molinero Martin-Molinero merged commit cd1aad6 into QuantConnect:master Jun 28, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants