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

Box Spread Option Strategy #8041

Conversation

LouisSzeto
Copy link
Collaborator

@LouisSzeto LouisSzeto commented May 20, 2024

Description

Add box spread and short box spread option strategy and their buying power model
ref magin requirements from IB

Box Spread: Margin Impact = 0 USD
image

Short Box Spread: Margin Impact = 2000 USD
image

Related Issue

closes #8033
closes #8034

Motivation and Context

missing

Requires Documentation Change

add section to writing algorithm -> tradings and orders -> option strategies

How Has This Been Tested?

  • added unit tests
  • added regression tests

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.

Thank you, looks good, posted minor comments 👍

MarketOrder(buySidePut.Symbol, -10);

MarketOrder(sellSideCall.Symbol, -10);
MarketOrder(sellSidePut.Symbol, +10);
Copy link
Member

Choose a reason for hiding this comment

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

These variable names seem off, sellSidePut but going long? Same for the other regression algorithm

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi! The "buy side" and "sell side" are defined this way.
image

Tests/Common/Securities/Options/OptionStrategiesTests.cs Outdated Show resolved Hide resolved
@LouisSzeto LouisSzeto force-pushed the feature-8033-box-spread-option-strategy branch from 3ef7a36 to 61a2f33 Compare May 30, 2024 12:07
@Martin-Molinero Martin-Molinero merged commit 79a8c66 into QuantConnect:master May 30, 2024
6 of 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.

Short Box Spread Option Strategy Box Spread Option Strategy
2 participants