Disable OHLC session tracking by default (#9046)
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Disable OHLC session tracking by default * Minor test fix
This commit is contained in:
@@ -20,6 +20,7 @@ from AlgorithmImports import *
|
||||
class SecuritySessionRegressionAlgorithm(QCAlgorithm):
|
||||
|
||||
def initialize(self):
|
||||
self.add_security_initializer(self.initialize_session_tracking)
|
||||
self.initialize_security()
|
||||
|
||||
# Check initial session values
|
||||
@@ -51,6 +52,10 @@ class SecuritySessionRegressionAlgorithm(QCAlgorithm):
|
||||
self.set_end_date(2013, 10, 11)
|
||||
self.security = self.add_equity("SPY", Resolution.HOUR)
|
||||
|
||||
def initialize_session_tracking(self, security):
|
||||
# activate session tracking
|
||||
security.session.size = 3
|
||||
|
||||
def _are_equal(self, value1, value2):
|
||||
tolerance = 1e-10
|
||||
return abs(value1 - value2) <= tolerance
|
||||
@@ -125,4 +130,4 @@ class SecuritySessionRegressionAlgorithm(QCAlgorithm):
|
||||
self.high = data[symbol].high
|
||||
self.low = data[symbol].low
|
||||
self.volume = data[symbol].volume
|
||||
self.current_date = data.time
|
||||
self.current_date = data.time
|
||||
|
||||
Reference in New Issue
Block a user