cotcube-indicators 0.1.14 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/cotcube-indicators/calc.rb +10 -2
- data/lib/cotcube-indicators/ema.rb +2 -2
- data/lib/cotcube-indicators/sma.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e549845d62cd14b399913c4881c8491f1392d9b94df1b3fec8405fd95059bf84
|
4
|
+
data.tar.gz: ed52269218da6e88138221e116b8c35e68abc385346cd8376efb230933c71dce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9f7f917c7c6e490d9263456f2d2e2887f672a9b85609546bcd17d695840275a0f4de7f2a34e1632ae9d6be359388f843397bb458e707ec9b0c0af097a657efa
|
7
|
+
data.tar.gz: c9650895d30c9e1457b37b56242916a81a2eb70257fbcc16bf45144ec9f55030b10ec82f0f52cf13307c67a12b9b474b93fed262d82961d7fb984ca572b9a035
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.15
|
@@ -2,9 +2,17 @@
|
|
2
2
|
|
3
3
|
module Cotcube
|
4
4
|
module Indicators
|
5
|
-
def calc(a:, b:, c:nil, d:nil, e:nil, &block) # rubocop:disable Naming/MethodParameterName
|
5
|
+
def calc(a:, b:, c:nil, d:nil, e:nil, f:nil, g:nil, h:nil, finalize: :to_f, &block) # rubocop:disable Naming/MethodParameterName
|
6
6
|
lambda do |x|
|
7
|
-
block.call(
|
7
|
+
block.call(
|
8
|
+
x[a.to_sym],
|
9
|
+
(b.nil? ? nil : x[b.to_sym]),
|
10
|
+
(c.nil? ? nil : x[c.to_sym]),
|
11
|
+
(d.nil? ? nil : x[d.to_sym]),
|
12
|
+
(e.nil? ? nil : x[e.to_sym]),
|
13
|
+
(f.nil? ? nil : x[f.to_sym]),
|
14
|
+
(g.nil? ? nil : x[g.to_sym]),
|
15
|
+
).send(finalize.to_sym)
|
8
16
|
end
|
9
17
|
end
|
10
18
|
end
|
@@ -13,9 +13,9 @@ module Cotcube
|
|
13
13
|
lambda do |x|
|
14
14
|
current = x[key.to_sym]
|
15
15
|
carrier << if carrier.empty?
|
16
|
-
current * (smoothing / (1 + length))
|
16
|
+
current * (smoothing / (1.0 + length))
|
17
17
|
else
|
18
|
-
current * (smoothing / (1 + length)) + carrier.get[-1] * (1 - (smoothing / (1 + length)))
|
18
|
+
current * (smoothing / (1.0 + length)) + carrier.get[-1] * (1.0 - (smoothing / (1.0 + length)))
|
19
19
|
end
|
20
20
|
carrier.size < length ? -1.0 : carrier.get.last
|
21
21
|
end
|
@@ -8,7 +8,7 @@ module Cotcube
|
|
8
8
|
lambda do |x|
|
9
9
|
current = x[key.to_sym]
|
10
10
|
carrier << current
|
11
|
-
carrier.size < length ? 0.0 : (carrier.get.reduce(:+) / carrier.length).to_f
|
11
|
+
carrier.size < length ? 0.0 : (carrier.get.reduce(:+) / carrier.length.to_f).to_f
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cotcube-indicators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin L. Tischendorf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
|
-
rubygems_version: 3.1.
|
102
|
+
rubygems_version: 3.1.6
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: Lambda based indicators, decoupled from legacy cotcube
|