Closed
Description
Expected Behavior
Collective2 Supports Index Options:
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:
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:
- Because margin requirements for options is zero, so adjust percent is also zero (SignalExportManager.cs, line 160):
var adjustedPercent = security.BuyingPowerModel.GetMaintenanceMargin(marginParameters) / totalPortfolioValue;
- 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