3e9fc57bb0
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Implement RangeConsolidator It turned out that the behavior of RangeConsolidator was similar to ClassicRenkoConsolidator. Then, some of the ClassicRenkoConsolidator methods, were abstracted to new class called BaseTimelessConsolidator.cs, from which both RangeConsolidator and ClassicRenkoConsolidator could inherit, therefore resusing code. The following tasks were done: - Create RangeConsolidator.cs - Create RangeBar.cs - Create BaseTimelessConsolidator.cs - Create RangeConsolidatorTests.cs - Modify ClassicRenkoConsolidator.cs * Allow intermediate/Phantom RangeBar's - Enhance unit tests - Nit changes - Allow intermediate/Phantom RangeBar's on RangeConsolidator * Nit changes * Create ClassicRangeConsolidator and more changes - Add regression tests - Enhance unit tests * Address required changes * Address requested changes * Address requested changes * Add regression tests with Tick Resolution * Address required changes * Increase Range for RangeConsolidatorWithTickAlgo * Add more unit tests and solve bugs * Nit change
17 lines
643 B
Python
17 lines
643 B
Python
|
|
from AlgorithmImports import *
|
|
from RangeConsolidatorWithTickAlgorithm import RangeConsolidatorWithTickAlgorithm
|
|
|
|
### <summary>
|
|
### Example algorithm of how to use ClassicRangeConsolidator with Tick resolution
|
|
### </summary>
|
|
class ClassicRangeConsolidatorWithTickAlgorithm(RangeConsolidatorWithTickAlgorithm):
|
|
def CreateRangeConsolidator(self):
|
|
return ClassicRangeConsolidator(self.GetRange())
|
|
|
|
def OnDataConsolidated(self, sender, rangeBar):
|
|
super().OnDataConsolidated(sender, rangeBar)
|
|
|
|
if rangeBar.Volume == 0:
|
|
raise Exception("All RangeBar's should have non-zero volume, but this doesn't")
|