pep8 conversion of python algos #13 (#7955)

* t status
pep8 conversion

* Minor tweaks and rebase

* Various minor fixes

---------

Co-authored-by: Martin Molinero <martin.molinero1@gmail.com>
This commit is contained in:
Louis Szeto
2024-04-20 03:14:12 +08:00
committed by GitHub
parent d2669fb0c2
commit 08a3de9e2d
33 changed files with 312 additions and 312 deletions
@@ -19,17 +19,17 @@ from AlgorithmImports import *
class QuitAfterInitializationRegressionAlgorithm(QCAlgorithm):
'''Basic template algorithm simply initializes the date range and cash'''
def Initialize(self):
def initialize(self):
'''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''
self.SetStartDate(2013,10, 7) #Set Start Date
self.SetEndDate(2013,10,11) #Set End Date
self.SetCash(100000) #Set Strategy Cash
self.set_start_date(2013,10, 7) #Set Start Date
self.set_end_date(2013,10,11) #Set End Date
self.set_cash(100000) #Set Strategy Cash
self.AddEquity("SPY", Resolution.Daily)
self.add_equity("SPY", Resolution.DAILY)
self._stopped = False
def OnData(self, data):
def on_data(self, data):
'''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
Arguments:
@@ -38,4 +38,4 @@ class QuitAfterInitializationRegressionAlgorithm(QCAlgorithm):
if self._stopped:
raise ValueError("Algorithm should of stopped!")
self._stopped = True
self.Quit()
self.quit()