watchcow 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/watchcow/rate.rb +5 -1
- data/lib/watchcow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4573a11d59d17d89bda6f6afbea3c964112612da2974cf12f42fea503043fc0
|
4
|
+
data.tar.gz: cb7ad9c20387b773747ad38d0b8cab922276994f0f34782b1f3adc81154ae293
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 309ff205f70ba3c7158a5d3d72260e7df6a2824ff376ecb51f611a67eba154ed7234eacbcd15fccdd2be01d66c672187829c5cb65e5c5d46862b6aff3231e44e
|
7
|
+
data.tar.gz: bb042886d415016609c1e2e642030481fb7dbff7d8cdeb2f33154456145beb785a5ad49ddff21f785b91149e35dd5418d61b878e4f3e9a674dfea12ea936aa84
|
data/lib/watchcow/rate.rb
CHANGED
@@ -31,6 +31,8 @@ module Watchcow
|
|
31
31
|
spot_first_bid = spot_result.dig('tick', 'bids')[0][0].to_f
|
32
32
|
margin_annual = (((dm_first_bid - spot_first_bid) / spot_first_bid) / days_remain * 365 * 100).round(6)
|
33
33
|
margin_expect = margin_annual / 365 * days_remain
|
34
|
+
base_gap = dm_first_bid - spot_first_bid
|
35
|
+
gap_rate = base_gap / dm_first_bid * 100
|
34
36
|
|
35
37
|
real_margin_expect = (1.0 / spot_first_bid - 1.0 / dm_first_bid) * spot_first_bid * 100
|
36
38
|
result = {
|
@@ -40,7 +42,9 @@ module Watchcow
|
|
40
42
|
expected_margin: margin_expect,
|
41
43
|
real_margin_expected: real_margin_expect,
|
42
44
|
dm_first_bid: dm_first_bid,
|
43
|
-
spot_first_bid: spot_first_bid
|
45
|
+
spot_first_bid: spot_first_bid,
|
46
|
+
base_gap: base_gap,
|
47
|
+
gap_rate: gap_rate
|
44
48
|
}
|
45
49
|
results.push(result)
|
46
50
|
end
|
data/lib/watchcow/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watchcow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DrinE Liu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|