Skip to content

Collective2 Supports Index Options  #8487

Closed
@AlexCatarino

Description

@AlexCatarino

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions