Skip to content

Commit 084cd29

Browse files
committed
Remove semicolon in python algrotihms
1 parent 889fd92 commit 084cd29

28 files changed

Lines changed: 51 additions & 51 deletions

‎Algorithm.Framework/Alphas/MacdAlphaModel.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self,
4545
self.resolution = resolution
4646
self.insightPeriod = Time.Multiply(Extensions.ToTimeSpan(resolution), fastPeriod)
4747
self.bounceThresholdPercent = 0.01
48-
self.symbolData = {};
48+
self.symbolData = {}
4949

5050
resolutionString = Extensions.GetEnumString(resolution, Resolution)
5151
movingAverageTypeString = Extensions.GetEnumString(movingAverageType, MovingAverageType)
@@ -75,7 +75,7 @@ def Update(self, algorithm, data):
7575

7676
# ignore signal for same direction as previous signal
7777
if direction == sd.PreviousDirection:
78-
continue;
78+
continue
7979

8080
insight = Insight.Price(sd.Security.Symbol, self.insightPeriod, direction)
8181
sd.PreviousDirection = insight.Direction
@@ -97,7 +97,7 @@ def OnSecuritiesChanged(self, algorithm, changes):
9797
data = self.symbolData.pop(removed.Symbol, None)
9898
if data is not None:
9999
# clean up our consolidator
100-
algorithm.SubscriptionManager.RemoveConsolidator(removed.Symbol, data.Consolidator);
100+
algorithm.SubscriptionManager.RemoveConsolidator(removed.Symbol, data.Consolidator)
101101

102102
class SymbolData:
103103
def __init__(self, algorithm, security, fastPeriod, slowPeriod, signalPeriod, movingAverageType, resolution):

‎Algorithm.Framework/Alphas/PairsTradingAlphaModel.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def __init__(self, asset1, asset2, threshold = 1):
4545
self.asset2Price = None
4646
self.ratio = None
4747
self.mean = None
48-
self.upperThreshold = None;
49-
self.lowerThreshold = None;
48+
self.upperThreshold = None
49+
self.lowerThreshold = None
5050

5151
self.Name = '{}({},{},{})'.format(self.__class__.__name__, asset1, asset2, Extensions.Normalize(threshold))
5252

‎Algorithm.Python/BasicTemplateOptionsFrameworkAlgorithm.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def OnSecuritiesChanged(self, changes):
6161

6262
def SelectOptionChainSymbols(self, utcTime):
6363
newYorkTime = Extensions.ConvertFromUtc(utcTime, TimeZones.NewYork)
64-
ticker = "TWX" if newYorkTime.date() < date(2014, 6, 6) else "AAPL";
64+
ticker = "TWX" if newYorkTime.date() < date(2014, 6, 6) else "AAPL"
6565
return [ Symbol.Create(ticker, SecurityType.Option, Market.USA, f"?{ticker}") ]
6666

6767
class EarliestExpiringWeeklyAtTheMoneyPutOptionUniverseSelectionModel(OptionUniverseSelectionModel):

‎Algorithm.Python/BubbleAlgorithm.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def OnData(self, data):
114114
# Cape Ratio is missing from orignial data
115115
# Most recent cape data is most likely to be missing
116116
elif self._currCape == 0:
117-
self.Debug("Exiting due to no CAPE!");
117+
self.Debug("Exiting due to no CAPE!")
118118
self.Quit("CAPE ratio not supplied in data, exiting.")
119119

120120
except:

‎Algorithm.Python/CoarseFineFundamentalComboAlgorithm.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def OnData(self, data):
8181
for security in self._changes.AddedSecurities:
8282
self.SetHoldings(security.Symbol, 0.2)
8383

84-
self._changes = None;
84+
self._changes = None
8585

8686

8787
# this event fires whenever we have changes to our universe

‎Algorithm.Python/CoarseFundamentalTop5Algorithm.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def OnData(self, data):
7373
for security in self._changes.AddedSecurities:
7474
self.SetHoldings(security.Symbol, 0.2)
7575

76-
self._changes = None;
76+
self._changes = None
7777

7878

7979
# this event fires whenever we have changes to our universe

‎Algorithm.Python/CustomBenchmarkAlgorithm.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ def Initialize(self):
3636
# Find more symbols here: http://quantconnect.com/data
3737
self.AddEquity("SPY", Resolution.Second)
3838

39-
self.SetBenchmark("SPY");
39+
self.SetBenchmark("SPY")
4040

4141
def OnData(self, data):
4242
'''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.'''
4343
if not self.Portfolio.Invested:
4444
self.SetHoldings("SPY", 1)
45-
self.Debug("Purchased Stock");
45+
self.Debug("Purchased Stock")

‎Algorithm.Python/CustomChartingAlgorithm.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def OnData(self, slice):
7272

7373
if self.Time > self.resample:
7474
self.resample = self.Time + self.resamplePeriod
75-
self.Plot("Average Cross", "FastMA", self.fastMA);
76-
self.Plot("Average Cross", "SlowMA", self.slowMA);
75+
self.Plot("Average Cross", "FastMA", self.fastMA)
76+
self.Plot("Average Cross", "SlowMA", self.slowMA)
7777

7878
# On the 5th days when not invested buy:
7979
if not self.Portfolio.Invested and self.Time.day % 13 == 0:

‎Algorithm.Python/CustomDataNIFTYAlgorithm.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ def OnData(self, data):
8383
class Nifty(PythonData):
8484
'''NIFTY Custom Data Class'''
8585
def GetSource(self, config, date, isLiveMode):
86-
return SubscriptionDataSource("https://www.dropbox.com/s/rsmg44jr6wexn2h/CNXNIFTY.csv?dl=1", SubscriptionTransportMedium.RemoteFile);
86+
return SubscriptionDataSource("https://www.dropbox.com/s/rsmg44jr6wexn2h/CNXNIFTY.csv?dl=1", SubscriptionTransportMedium.RemoteFile)
8787

8888

8989
def Reader(self, config, line, date, isLiveMode):
9090
if not (line.strip() and line[0].isdigit()): return None
9191

9292
# New Nifty object
93-
index = Nifty();
93+
index = Nifty()
9494
index.Symbol = config.Symbol
9595

9696
try:
@@ -122,7 +122,7 @@ def Reader(self, config, line, date, isLiveMode):
122122
if not (line.strip() and line[0].isdigit()): return None
123123

124124
# New USDINR object
125-
currency = DollarRupee();
125+
currency = DollarRupee()
126126
currency.Symbol = config.Symbol
127127

128128
try:
@@ -135,7 +135,7 @@ def Reader(self, config, line, date, isLiveMode):
135135
# Do nothing
136136
return None
137137

138-
return currency;
138+
return currency
139139

140140

141141
class CorrelationPair:

‎Algorithm.Python/CustomDataRegressionAlgorithm.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ class Bitcoin(PythonData):
5656

5757
def GetSource(self, config, date, isLiveMode):
5858
if isLiveMode:
59-
return SubscriptionDataSource("https://www.bitstamp.net/api/ticker/", SubscriptionTransportMedium.Rest);
59+
return SubscriptionDataSource("https://www.bitstamp.net/api/ticker/", SubscriptionTransportMedium.Rest)
6060

61-
#return "http://my-ftp-server.com/futures-data-" + date.ToString("Ymd") + ".zip";
61+
#return "http://my-ftp-server.com/futures-data-" + date.ToString("Ymd") + ".zip"
6262
# OR simply return a fixed small data file. Large files will slow down your backtest
63-
return SubscriptionDataSource("https://www.quandl.com/api/v3/datasets/BCHARTS/BITSTAMPUSD.csv?order=asc", SubscriptionTransportMedium.RemoteFile);
63+
return SubscriptionDataSource("https://www.quandl.com/api/v3/datasets/BCHARTS/BITSTAMPUSD.csv?order=asc", SubscriptionTransportMedium.RemoteFile)
6464

6565

6666
def Reader(self, config, line, date, isLiveMode):
@@ -108,7 +108,7 @@ def Reader(self, config, line, date, isLiveMode):
108108
coin["VolumeBTC"] = float(data[5])
109109
coin["VolumeUSD"] = float(data[6])
110110
coin["WeightedPrice"] = float(data[7])
111-
return coin;
111+
return coin
112112

113113
except ValueError:
114114
# Do nothing, possible error in json decoding

0 commit comments

Comments
 (0)