Skip to content

Commit

Permalink
Rename new option universe Algorithm API method
Browse files Browse the repository at this point in the history
- Rename new option universe Algorith API method from
  AddChainedOptionUniverse to AddUniverseOptions
- Rebase and update regression test order hash because of
  option expiration message changed
  • Loading branch information
Martin-Molinero committed Oct 9, 2020
1 parent dcef614 commit 352a67c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public override void OnData(Slice data)
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "1472204120"}
{"OrderListHash", "1123164511"}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override void Initialize()
var selectionUniverse = AddUniverse(enumerable => new[] { Time.Date <= new DateTime(2014, 6, 5) ? _twx : _aapl },
enumerable => new[] { Time.Date <= new DateTime(2014, 6, 5) ? _twx : _aapl });

AddChainedOptionUniverse(selectionUniverse, universe =>
AddUniverseOptions(selectionUniverse, universe =>
{
if (universe.Underlying == null)
{
Expand Down Expand Up @@ -120,7 +120,7 @@ public override void OnEndOfAlgorithm()
var config = SubscriptionManager.Subscriptions.ToList();
if (config.Any(dataConfig => dataConfig.Symbol == _twx || dataConfig.Symbol.Underlying == _twx))
{
throw new Exception($"Was NOT expecting any configurations for {_twx} or it's options, since coarse/fine should deselected it");
throw new Exception($"Was NOT expecting any configurations for {_twx} or it's options, since coarse/fine should have deselected it");
}

if (_optionCount == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def Initialize(self):

universe = self.AddUniverse(self.CoarseSelectionFunction, self.FineSelectionFunction)

self.AddChainedOptionUniverse(universe, self.OptionFilterFunction)
self.AddUniverseOptions(universe, self.OptionFilterFunction)

def OptionFilterFunction(self, universe):
universe.IncludeWeeklys().FrontMonth()
Expand Down
4 changes: 2 additions & 2 deletions Algorithm/QCAlgorithm.Python.cs
Original file line number Diff line number Diff line change
Expand Up @@ -448,14 +448,14 @@ public Universe AddUniverse(Type dataType, SecurityType securityType, string nam
/// </summary>
/// <param name="universe">The universe we want to chain an option universe selection model too</param>
/// <param name="optionFilter">The option filter universe to use</param>
public void AddChainedOptionUniverse(PyObject universe, PyObject optionFilter)
public void AddUniverseOptions(PyObject universe, PyObject optionFilter)
{
Func<OptionFilterUniverse, OptionFilterUniverse> convertedOptionChain;
Universe universeToChain;

if (universe.TryConvert(out universeToChain) && optionFilter.TryConvertToDelegate(out convertedOptionChain))
{
AddChainedOptionUniverse(universeToChain, convertedOptionChain);
AddUniverseOptions(universeToChain, convertedOptionChain);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Algorithm/QCAlgorithm.Universe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ public Universe AddUniverse(SecurityType securityType, string name, Resolution r
/// </summary>
/// <param name="universe">The universe we want to chain an option universe selection model too</param>
/// <param name="optionFilter">The option filter universe to use</param>
public void AddChainedOptionUniverse(Universe universe, Func<OptionFilterUniverse, OptionFilterUniverse> optionFilter)
public void AddUniverseOptions(Universe universe, Func<OptionFilterUniverse, OptionFilterUniverse> optionFilter)
{
AddUniverseSelection(new OptionChainedUniverseSelectionModel(universe, optionFilter));
}
Expand Down

0 comments on commit 352a67c

Please sign in to comment.