quantitative 0.1.10 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/quant/attributes.rb +31 -43
- data/lib/quant/config.rb +8 -0
- data/lib/quant/errors.rb +4 -0
- data/lib/quant/indicators/dominant_cycle_indicators.rb +49 -0
- data/lib/quant/indicators/dominant_cycles/acr.rb +101 -0
- data/lib/quant/indicators/dominant_cycles/band_pass.rb +85 -0
- data/lib/quant/indicators/dominant_cycles/differential.rb +21 -0
- data/lib/quant/indicators/dominant_cycles/dominant_cycle.rb +144 -0
- data/lib/quant/indicators/dominant_cycles/half_period.rb +21 -0
- data/lib/quant/indicators/dominant_cycles/homodyne.rb +28 -0
- data/lib/quant/indicators/dominant_cycles/phase_accumulator.rb +59 -0
- data/lib/quant/indicators/indicator.rb +38 -7
- data/lib/quant/indicators/indicator_point.rb +12 -2
- data/lib/quant/indicators.rb +9 -2
- data/lib/quant/indicators_proxy.rb +11 -4
- data/lib/quant/indicators_sources.rb +11 -1
- data/lib/quant/mixins/high_pass_filters.rb +98 -25
- data/lib/quant/mixins/super_smoother.rb +18 -15
- data/lib/quant/mixins/universal_filters.rb +14 -1
- data/lib/quant/series.rb +14 -0
- data/lib/quant/settings/indicators.rb +16 -6
- data/lib/quant/settings.rb +1 -1
- data/lib/quant/statistics/correlation.rb +37 -0
- data/lib/quant/version.rb +1 -1
- data/lib/quantitative.rb +1 -1
- metadata +11 -3
- data/lib/quant/indicators/ma.rb +0 -40
data/lib/quant/indicators/ma.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Quant
|
4
|
-
class Indicators
|
5
|
-
class MaPoint < IndicatorPoint
|
6
|
-
attribute :ss, key: "ss"
|
7
|
-
attribute :ema, key: "ema"
|
8
|
-
attr_accessor :ss, :ema, :osc
|
9
|
-
|
10
|
-
def initialize_data_points
|
11
|
-
@ss = input
|
12
|
-
@ema = input
|
13
|
-
@osc = nil
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
# Moving Averages
|
18
|
-
class Ma < Indicator
|
19
|
-
include Quant::Mixins::Filters
|
20
|
-
|
21
|
-
def alpha(period)
|
22
|
-
bars_to_alpha(period)
|
23
|
-
end
|
24
|
-
|
25
|
-
def min_period
|
26
|
-
8 # Quant.config.indicators.min_period
|
27
|
-
end
|
28
|
-
|
29
|
-
def max_period
|
30
|
-
48 # Quant.config.indicators.max_period
|
31
|
-
end
|
32
|
-
|
33
|
-
def compute
|
34
|
-
# p0.ss = super_smoother input, :ss, min_period
|
35
|
-
p0.ema = alpha(max_period) * input + (1 - alpha(max_period)) * p1.ema
|
36
|
-
p0.osc = p0.ss - p0.ema
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|