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

Collective2 Supports Index Options #8487

Closed
4 tasks done
AlexCatarino opened this issue Dec 27, 2024 · 0 comments · Fixed by #8494
Closed
4 tasks done

Collective2 Supports Index Options #8487

AlexCatarino opened this issue Dec 27, 2024 · 0 comments · Fixed by #8494

Comments

@AlexCatarino
Copy link
Member

AlexCatarino commented Dec 27, 2024

Expected Behavior

Collective2 Supports Index Options:

altoids_1735313096

I hacked LEAN to send the following message:

"message = "{ \"StrategyId\":145772785,\"Positions\":[{ \"C2Symbol\":{ \"FullSymbol\":\"SPXW2431L5900\",\"SymbolType\":\"option\"},\"Quantity\":1.0}]}";

and Collective2 accepted the orders:

Captura de ecrã 2024-12-30 231952

Actual Behavior

It doesn't support it (see ConvertTypeOfSymbol method)

Potential Solution

Using

typeOfSymbol = targetSymbol.SecurityType switch
{
    SecurityType.Equity => "stock",
    SecurityType.Forex => "forex",
    SecurityType.Future => "future",
    SecurityType.IndexOption => "option",
    SecurityType.Option => "option",
    _ => "NotImplemented",
};

fixes the issue.

However, there are other problems:

  1. Because margin requirements for options is zero, so adjust percent is also zero (SignalExportManager.cs, line 160):
var adjustedPercent = security.BuyingPowerModel.GetMaintenanceMargin(marginParameters) / totalPortfolioValue;
  1. In Collective2SignalExport.cs line 150,
    SymbolRepresentation.GenerateOptionTicker
    doesn't handle SPXW, it returns SPX as ticker.

Reproducing the Problem

Place order for SPXW,

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants