stockcruncher 1.4.1 → 1.4.2
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/lib/stockcruncher/influxdb.rb +7 -7
- data/lib/stockcruncher/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03dfe0d9f40c0b298cbe4c7d5f3d37683765ccb737b3a4d82ec75f6e04f46e06
|
4
|
+
data.tar.gz: e0da9a269671deb3400042cf87a7bfb39bf7b0842af91483d979d3c672c6c7a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d858ff01048b66b048ec634519b9e19123e2b74204dc71826118e9c41fec707612e0424260b628fdc3a2e228366c1c1d7b2312bf8191beef0683f88ede20481d
|
7
|
+
data.tar.gz: 70fb3692a8d45ce7c292b89b551a0d78b11076b93a53caeefae4fc642d1f8ae2d50ebd09b43d6ec7cd59edf1117214aa7723a04bd96b958d866015f0479cd35d
|
@@ -28,14 +28,14 @@ module StockCruncher
|
|
28
28
|
|
29
29
|
# Method to calculate moving averages based on last day values
|
30
30
|
def moving_averages(symbol, fullsize, catchup)
|
31
|
-
|
32
|
-
mas = catchup ? get_ma_values(symbol, fullsize) : {}
|
31
|
+
data = get_daily_values(symbol, fullsize)
|
32
|
+
mas = catchup ? get_ma_values(symbol, fullsize) : { 'time' => [] }
|
33
33
|
tags = create_tags(symbol)
|
34
|
-
series
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
write_moving_averages(tags,
|
34
|
+
dates, series, weights = data.values_at 'time', 'close', 'volume'
|
35
|
+
series.each_index do |i|
|
36
|
+
next if mas['time'].include? dates[i]
|
37
|
+
|
38
|
+
write_moving_averages(tags, series[i, 201], weights[i, 201], dates[i])
|
39
39
|
break unless fullsize
|
40
40
|
end
|
41
41
|
end
|