-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Description
Implement the Gamma Exposure (GEX) calculation for the option chain, along with a method to return a Curve representation of GEX. GEX represents the second-order price risk in the options market and is crucial for understanding potential market stability or instability.
The GEX calculation should:
- Consider both call and put options.
- Handle both long and short positions.
- Apply the appropriate contract multiplier.
- Aggregate results by strike price.
- Compute interpolated gamma exposure at the current spot price (spot GEX).
- Provide a
Curverepresentation for visualization and analysis.
Tasks
Implementation:
- Create a structure to hold GEX-related data, including total GEX, exposure by strike, and interpolated spot GEX.
- Implement a method to calculate GEX by iterating through the option chain, computing values for each position, and aggregating results by strike price.
- Implement interpolation to estimate the gamma exposure at the current spot price.
- Implement a method to transform the aggregated GEX data into a
Curverepresentation, ensuring it captures key strike price points and their corresponding exposures.
Testing:
- Write unit tests to validate the correctness of GEX calculations across different market conditions.
- Include edge cases such as:
- High and low volatility.
- Strike prices very close to or far from the spot.
- Long and short positions.
- Effects of different contract multipliers.
- Ensuring the curve representation properly handles empty or irregular data points.
Documentation:
- Document the structure and methods related to GEX calculations.
- Explain the purpose and expected output of the curve representation.
- Provide usage examples demonstrating how to use the implemented methods.
Additional Notes
- The implementation should prioritize accuracy and computational efficiency.
- Ensure compatibility with the existing options system architecture.
- The
Curverepresentation will be useful for visualizing GEX changes across different strike prices.
Labels
enhancement, greeks, options-trading, visualization, testing, documentation
Metadata
Metadata
Assignees
Labels
No labels