cotcube-indicators 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11f1af1cbae6dfbd31c7ab543801a6b71d6add09dd157f823a380d16d0cc3354
4
- data.tar.gz: f5012e6bffd26cb739260d17efad7a7deff8725d3c02e9ec6994798f0462ebb0
3
+ metadata.gz: 98fa4ef0045f9137be38cfca9279bf35c9e482e2342a59ed758a8b3815b40fa5
4
+ data.tar.gz: d5b4ae3d93be6c0ed918f0c0421cf001b61e0b455989bb4d7ec6e3912f62b4c4
5
5
  SHA512:
6
- metadata.gz: 826229e58f828396cb60fe6af1f86a92b4894f1f34e1d61eef3b65cada0e743679465e1a183a2723f82e480d18e3964608ac8299c9ed492a8f0fe8123df68b81
7
- data.tar.gz: 50e7d157baa972a579cd78ec662544f70ef9af48297fe22f9c45d2fbe338cb512cea6beb363d9020cb518994bd7bfb520968470d5aa4ed2b7224c5aa19f66840
6
+ metadata.gz: e6c9d35924768befeb84eec7c2c4f71e03e612cc43e3759787db21cf1ad51ce012e51cf583b3edbf4fb38e7e19a782f381f0c499831659b8a42c9ff0a37adcfc
7
+ data.tar.gz: 1db27198c66a931a5822d6d58991a252c79356e78c71c269432251cc001d41c75cf15ba797f3606eca51c6b30c98e0ecee9a127f7eeed49f7d9aa67870916bd4
@@ -1,3 +1,6 @@
1
+ ## 0.1.12 (December 05, 2020)
2
+ - added tests for SMA, EMA, RSI
3
+
1
4
  ## 0.1.11 (December 05, 2020)
2
5
  - Fixing 'smoothing' keyword argument in EMA
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.11
1
+ 0.1.12
@@ -4,10 +4,12 @@ module Cotcube
4
4
  module Indicators
5
5
  # the classic exponential moving average
6
6
  def ema(key:, length:, smoothing: nil)
7
- raise 'Missing parameter, need :length' unless length.is_a? Integer
7
+ raise ArgumentError, 'Improper :length parameter, should be positive Integer' unless length.is_a? Integer and length.positive?
8
8
 
9
9
  smoothing ||= (2 / (length - 1).to_f.round(2))
10
- carrier = Carrier.new(length)
10
+ raise ArgumentError, 'Improper smoothing, should be Numeric' unless smoothing.is_a? Numeric
11
+
12
+ carrier = Cotcube::Indicators::Carrier.new(length: length)
11
13
  lambda do |x|
12
14
  current = x[key.to_sym]
13
15
  carrier << if carrier.empty?
@@ -3,8 +3,6 @@
3
3
  module Cotcube
4
4
  module Indicators
5
5
  def rsi(length:, key:, debug: false)
6
- raise 'Missing parameter, need :key and :length options' if length.nil? || key.nil?
7
-
8
6
  carrier = Carrier.new(length: length)
9
7
 
10
8
  lambda do |x|
@@ -3,7 +3,6 @@
3
3
  module Cotcube
4
4
  module Indicators
5
5
  def sma(length:, key:)
6
- raise 'Missing parameter, need :length and :value options' if opts[:length].nil? || opts[:value].nil?
7
6
 
8
7
  carrier = Cotcube::Indicators::Carrier.new(length: length)
9
8
  lambda do |x|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cotcube-indicators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin L. Tischendorf