Skip to content

Commit

Permalink
Merge pull request #2050 from QuantConnect/bug-ema-cross-resolution
Browse files Browse the repository at this point in the history
Use EMA cross alpha model's resolution when creating the EMA indicators
  • Loading branch information
mchandschuh committed Jun 1, 2018
2 parents 0ec7f29 + d90dcc8 commit 04b99aa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Algorithm.Framework/Alphas/EmaCrossAlphaModel.cs
Expand Up @@ -102,8 +102,8 @@ public override void OnSecuritiesChanged(QCAlgorithmFramework algorithm, Securit
if (!_symbolDataBySymbol.TryGetValue(added.Symbol, out symbolData))
{
// create fast/slow EMAs
var fast = algorithm.EMA(added.Symbol, _fastPeriod);
var slow = algorithm.EMA(added.Symbol, _slowPeriod);
var fast = algorithm.EMA(added.Symbol, _fastPeriod, _resolution);
var slow = algorithm.EMA(added.Symbol, _slowPeriod, _resolution);
_symbolDataBySymbol[added.Symbol] = new SymbolData
{
Security = added,
Expand Down
46 changes: 23 additions & 23 deletions Tests/RegressionTests.cs
Expand Up @@ -911,31 +911,31 @@ private static TestCaseData[] GetRegressionTestParameters()

var compositeAlphaModelFrameworkAlgorithmStatistics = new Dictionary<string, string>
{
{"Total Trades", "468"},
{"Average Win", "0.06%"},
{"Average Loss", "-0.04%"},
{"Compounding Annual Return", "-96.930%"},
{"Drawdown", "4.500%"},
{"Expectancy", "-0.490"},
{"Net Profit", "-4.356%"},
{"Sharpe Ratio", "-26.255"},
{"Loss Rate", "81%"},
{"Win Rate", "19%"},
{"Profit-Loss Ratio", "1.75"},
{"Alpha", "-1.975"},
{"Beta", "-23.261"},
{"Annual Standard Deviation", "0.085"},
{"Annual Variance", "0.007"},
{"Information Ratio", "-26.372"},
{"Tracking Error", "0.085"},
{"Treynor Ratio", "0.096"},
{"Total Fees", "$2215.48"},
{"Total Insights Generated", "289"},
{"Total Trades", "2"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "323.810%"},
{"Drawdown", "0.600%"},
{"Expectancy", "0"},
{"Net Profit", "1.864%"},
{"Sharpe Ratio", "8.033"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0"},
{"Beta", "84.942"},
{"Annual Standard Deviation", "0.117"},
{"Annual Variance", "0.014"},
{"Information Ratio", "7.946"},
{"Tracking Error", "0.117"},
{"Treynor Ratio", "0.011"},
{"Total Fees", "$11.82"},
{"Total Insights Generated", "2"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},
{"Long Insight Count", "146"},
{"Short Insight Count", "143"},
{"Long/Short Ratio", "102.10%"},
{"Long Insight Count", "2"},
{"Short Insight Count", "0"},
{"Long/Short Ratio", "100%"},
{"Estimated Monthly Alpha Value", "$0"},
{"Total Accumulated Estimated Alpha Value", "$0"},
{"Mean Population Estimated Insight Value", "$0"},
Expand Down

0 comments on commit 04b99aa

Please sign in to comment.