Further Fixes From Peer-Review

This commit is contained in:
AlexCatarino
2019-03-02 01:06:09 +00:00
parent 774b32bc5f
commit 6ca82fd196
12 changed files with 110 additions and 110 deletions
@@ -115,10 +115,10 @@ class MeanReversionIBSAlphaModel(AlphaModel):
# Emit "down" insight for the securities with the highest IBS value
for key,value in highIBS.items():
insights.append(Insight.Price(key, self.predictionInterval, InsightDirection.Down, -returns[key], None))
insights.append(Insight.Price(key, self.predictionInterval, InsightDirection.Down, abs(returns[key]), None))
# Emit "up" insight for the securities with the lowest IBS value
for key,value in lowIBS.items():
insights.append(Insight.Price(key, self.predictionInterval, InsightDirection.Up, -returns[key], None))
insights.append(Insight.Price(key, self.predictionInterval, InsightDirection.Up, abs(returns[key]), None))
return insights
@@ -41,7 +41,7 @@ from datetime import datetime, timedelta, time
# This alpha is part of the Benchmark Alpha Series created by QuantConnect which are open sourced so the community and client funds can see an example of an alpha.
#
class IntradayReversalCurrencyMarkets(QCAlgorithmFramework):
class IntradayReversalCurrencyMarketsAlpha(QCAlgorithmFramework):
def Initialize(self):
@@ -134,5 +134,5 @@ class MeanReversionLunchBreakAlphaModel(AlphaModel):
@property
def Insight(self):
direction = InsightDirection.Down if self.priceChange.Current.Value > 0 else InsightDirection.Up
margnitude = -self.meanOfPriceChange.Current.Value
margnitude = abs(self.meanOfPriceChange.Current.Value)
return Insight.Price(self.symbol, self.period, direction, margnitude, None)
@@ -86,7 +86,7 @@ class SykesShortMicroCapAlphaModel(AlphaModel):
# Emit "down" insight for "pumped" penny stocks
for key,value in pumpedStocks.items():
insights.append(Insight.Price(key, self.predictionInterval, InsightDirection.Down, value, None))
insights.append(Insight.Price(key, self.predictionInterval, InsightDirection.Down, abs(value), None))
return insights
@@ -38,7 +38,7 @@
<ItemGroup>
<Content Include="Alphas\ForexCalendarAlpha.py" />
<Content Include="Alphas\GlobalEquityMeanReversionIBSAlpha.py" />
<Content Include="Alphas\IntradayReversalCurrencyMarkets.py" />
<Content Include="Alphas\IntradayReversalCurrencyMarketsAlpha.py" />
<Content Include="Alphas\MeanReversionLunchBreakAlpha.py" />
<Content Include="Alphas\SykesShortMicroCapAlpha.py" />
<Content Include="Alphas\RebalancingLeveragedETFAlpha.py" />