Skip to content

Commit

Permalink
Merge pull request QuantConnect#1566 from QuantConnect/fix-option-fil…
Browse files Browse the repository at this point in the history
…ter-underlying-data

Fixes options chain underlying price data
  • Loading branch information
jaredbroad authored Feb 13, 2018
2 parents bb4b366 + ab92564 commit 0b84994
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions Engine/DataFeeds/SubscriptionSynchronizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,8 @@ public TimeSlice Sync(IEnumerable<Subscription> subscriptions)
{
if (packetBaseDataCollection is OptionChainUniverseDataCollection)
{
var current = subscription.Current as OptionChainUniverseDataCollection;
var underlying = current != null ? current.Underlying : null;
collection = new OptionChainUniverseDataCollection(_frontier,
subscription.Configuration.Symbol, packetData, underlying);
var current = packetBaseDataCollection as OptionChainUniverseDataCollection;
collection = new OptionChainUniverseDataCollection(_frontier, subscription.Configuration.Symbol, packetData, current?.Underlying);
}
else if (packetBaseDataCollection is FuturesChainUniverseDataCollection)
{
Expand Down
6 changes: 3 additions & 3 deletions Tests/RegressionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -540,15 +540,15 @@ private static TestCaseData[] GetRegressionTestParameters()
{
{"Total Trades", "4"},
{"Average Win", "0.30%"},
{"Average Loss", "-0.32%"},
{"Average Loss", "-0.33%"},
{"Compounding Annual Return", "-85.023%"},
{"Drawdown", "0.400%"},
{"Expectancy", "-0.359"},
{"Expectancy", "-0.358"},
{"Net Profit", "-0.350%"},
{"Sharpe Ratio", "0"},
{"Loss Rate", "67%"},
{"Win Rate", "33%"},
{"Profit-Loss Ratio", "0.92"},
{"Profit-Loss Ratio", "0.93"},
{"Alpha", "0"},
{"Beta", "0"},
{"Annual Standard Deviation", "0"},
Expand Down

0 comments on commit 0b84994

Please sign in to comment.