Lean icon indicating copy to clipboard operation
Lean copied to clipboard

AddFutureOption api refactor

Open Martin-Molinero opened this issue 3 years ago • 0 comments

Expected Behavior

  • AddFutureOption follows the AddSecurity/Equity/Option/Future.. etc pattern

Actual Behavior

  • Current implementation is public void AddFutureOption(Symbol symbol, Func<OptionFilterUniverse, OptionFilterUniverse> optionFilter = null)

Potential Solution

  • Add missing arguments in the expected order: resolution, fillForward, extended market hours,,
  • Should default to the settings of the underlying if no argument was given
  • If the settings of the FOP and the underlying are different should throw
  • Remove the optionFilter argument. Instead return a the OptionChainedUniverseSelectionModel instance wrapped behind an interface which allows users to call SetFilter on it like for Option & Future. The selection model would use this filter when creating the new universes.
    • AddUniverseOptions could also return the wrapped OptionChainedUniverseSelectionModel instance, but we can keep the option filter argument for it

Reproducing the Problem

N/A

System Information

N/A

Checklist

  • [x] I have completely filled out this template
  • [x] I have confirmed that this issue exists on the current master branch
  • [x] I have confirmed that this is not a duplicate issue by searching issues
  • [x] I have provided detailed steps to reproduce the issue

Martin-Molinero avatar Jul 18 '22 19:07 Martin-Molinero