Class: Quant::DominantCyclesSource

Inherits:
Object
  • Object
show all
Defined in:
lib/quant/dominant_cycles_source.rb

Overview

Dominant Cycles measure the primary cycle within a given range. By default, the library is wired to look for cycles between 10 and 48 bars. These values can be adjusted by setting the ‘min_period` and `max_period` configuration values in Config.

Quant.configure_indicators(min_period: 8, max_period: 32)

The default dominant cycle kind is the ‘half_period` filter. This can be adjusted by setting the `dominant_cycle_kind` configuration value in Config.

Quant.configure_indicators(dominant_cycle_kind: :band_pass)

The purpose of these indicators is to compute the dominant cycle and underpin the various indicators that would otherwise be setting an arbitrary lookback period. This makes the indicators adaptive and auto-tuning to the market dynamics. Or so the theory goes!

Instance Method Summary collapse

Constructor Details

#initialize(indicator_source:) ⇒ DominantCyclesSource

Returns a new instance of DominantCyclesSource.



18
19
20
21
# File 'lib/quant/dominant_cycles_source.rb', line 18

def initialize(indicator_source:)
  @indicator_source = indicator_source
  indicator_source.define_indicator_accessors(indicator_source: self)
end