quantitative 0.3.3 → 0.4.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/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/Gemfile.lock +99 -74
- data/lib/quant/experimental.rb +1 -1
- data/lib/quant/ticks/ohlc.rb +5 -2
- data/lib/quant/ticks/spot.rb +6 -2
- data/lib/quant/version.rb +1 -1
- metadata +21 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e3d3c818bd142e017de0c61523ac0dfb14ec104fab94e073336892829128d87a
|
|
4
|
+
data.tar.gz: 642e8f7c285556847597a4a046443144d9a2fc394448af6ed95fc6d34f90dfd6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: db5a09bfe7dab83b4697726e1ea52a487231c02b3d57498c5a7a6e8cc152b3baf80c701cc7c01cd5a20732746f5be6d17dfe9d5425a1396f2a08adaba3e091a4
|
|
7
|
+
data.tar.gz: 566493343ff4c6986573072b5c6309c4ad3088b13b2c1b518d9cd6cae60d81c4c081bb60dfde54f684e245c347586c1a5ed1efa2b6f5c30708c39d61a278e8bc
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4.0.4
|
data/Gemfile.lock
CHANGED
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
quantitative (0.
|
|
4
|
+
quantitative (0.4.1)
|
|
5
|
+
csv
|
|
5
6
|
oj (~> 3.10)
|
|
6
7
|
zeitwerk (~> 2.6)
|
|
7
8
|
|
|
8
9
|
GEM
|
|
9
10
|
remote: https://rubygems.org/
|
|
10
11
|
specs:
|
|
11
|
-
ast (2.4.
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
ast (2.4.3)
|
|
13
|
+
base64 (0.3.0)
|
|
14
|
+
benchmark-ips (2.14.0)
|
|
15
|
+
bigdecimal (4.1.2)
|
|
14
16
|
coderay (1.1.3)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
csv (3.3.5)
|
|
18
|
+
date (3.5.1)
|
|
19
|
+
debug (1.11.1)
|
|
20
|
+
irb (~> 1.10)
|
|
21
|
+
reline (>= 0.3.8)
|
|
22
|
+
diff-lcs (1.6.2)
|
|
23
|
+
docile (1.4.1)
|
|
24
|
+
erb (6.0.4)
|
|
25
|
+
ffi (1.17.4-arm64-darwin)
|
|
26
|
+
ffi (1.17.4-x86_64-linux-gnu)
|
|
27
|
+
formatador (1.2.3)
|
|
28
|
+
reline
|
|
29
|
+
guard (2.20.1)
|
|
23
30
|
formatador (>= 0.2.4)
|
|
24
31
|
listen (>= 2.7, < 4.0)
|
|
32
|
+
logger (~> 1.6)
|
|
25
33
|
lumberjack (>= 1.0.12, < 2.0)
|
|
26
34
|
nenv (~> 0.1)
|
|
27
35
|
notiffany (~> 0.0)
|
|
@@ -33,104 +41,121 @@ GEM
|
|
|
33
41
|
guard (~> 2.1)
|
|
34
42
|
guard-compat (~> 1.1)
|
|
35
43
|
rspec (>= 2.99.0, < 4.0)
|
|
36
|
-
io-console (0.
|
|
37
|
-
irb (1.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
io-console (0.8.2)
|
|
45
|
+
irb (1.18.0)
|
|
46
|
+
pp (>= 0.6.0)
|
|
47
|
+
prism (>= 1.3.0)
|
|
48
|
+
rdoc (>= 4.0.0)
|
|
49
|
+
reline (>= 0.4.2)
|
|
50
|
+
json (2.19.5)
|
|
51
|
+
language_server-protocol (3.17.0.5)
|
|
52
|
+
lint_roller (1.1.0)
|
|
53
|
+
listen (3.10.0)
|
|
54
|
+
logger
|
|
43
55
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
44
56
|
rb-inotify (~> 0.9, >= 0.9.10)
|
|
45
|
-
|
|
46
|
-
|
|
57
|
+
logger (1.7.0)
|
|
58
|
+
lumberjack (1.4.2)
|
|
59
|
+
method_source (1.1.0)
|
|
47
60
|
nenv (0.3.0)
|
|
48
61
|
notiffany (0.1.3)
|
|
49
62
|
nenv (~> 0.1)
|
|
50
63
|
shellany (~> 0.0)
|
|
51
|
-
oj (3.
|
|
64
|
+
oj (3.17.0)
|
|
52
65
|
bigdecimal (>= 3.0)
|
|
53
|
-
|
|
54
|
-
|
|
66
|
+
ostruct (>= 0.2)
|
|
67
|
+
ostruct (0.6.3)
|
|
68
|
+
parallel (2.1.0)
|
|
69
|
+
parser (3.3.11.1)
|
|
55
70
|
ast (~> 2.4.1)
|
|
56
71
|
racc
|
|
57
|
-
|
|
72
|
+
pp (0.6.3)
|
|
73
|
+
prettyprint
|
|
74
|
+
prettyprint (0.2.0)
|
|
75
|
+
prism (1.9.0)
|
|
76
|
+
pry (0.16.0)
|
|
58
77
|
coderay (~> 1.1)
|
|
59
78
|
method_source (~> 1.0)
|
|
60
|
-
|
|
79
|
+
reline (>= 0.6.0)
|
|
80
|
+
psych (5.3.1)
|
|
81
|
+
date
|
|
61
82
|
stringio
|
|
62
|
-
racc (1.
|
|
83
|
+
racc (1.8.1)
|
|
63
84
|
rainbow (3.1.1)
|
|
64
|
-
rake (13.
|
|
85
|
+
rake (13.4.2)
|
|
65
86
|
rb-fsevent (0.11.2)
|
|
66
|
-
rb-inotify (0.
|
|
87
|
+
rb-inotify (0.11.1)
|
|
67
88
|
ffi (~> 1.0)
|
|
68
|
-
rdoc (
|
|
89
|
+
rdoc (7.2.0)
|
|
90
|
+
erb
|
|
69
91
|
psych (>= 4.0.0)
|
|
70
|
-
|
|
92
|
+
tsort
|
|
93
|
+
regexp_parser (2.12.0)
|
|
71
94
|
relaxed-rubocop (2.5)
|
|
72
|
-
reline (0.
|
|
95
|
+
reline (0.6.3)
|
|
73
96
|
io-console (~> 0.5)
|
|
74
|
-
rexml (3.
|
|
75
|
-
rspec (3.
|
|
76
|
-
rspec-core (~> 3.
|
|
77
|
-
rspec-expectations (~> 3.
|
|
78
|
-
rspec-mocks (~> 3.
|
|
79
|
-
rspec-core (3.
|
|
80
|
-
rspec-support (~> 3.
|
|
81
|
-
rspec-expectations (3.
|
|
97
|
+
rexml (3.4.4)
|
|
98
|
+
rspec (3.13.2)
|
|
99
|
+
rspec-core (~> 3.13.0)
|
|
100
|
+
rspec-expectations (~> 3.13.0)
|
|
101
|
+
rspec-mocks (~> 3.13.0)
|
|
102
|
+
rspec-core (3.13.6)
|
|
103
|
+
rspec-support (~> 3.13.0)
|
|
104
|
+
rspec-expectations (3.13.5)
|
|
82
105
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
83
|
-
rspec-support (~> 3.
|
|
84
|
-
rspec-github (
|
|
106
|
+
rspec-support (~> 3.13.0)
|
|
107
|
+
rspec-github (3.0.0)
|
|
85
108
|
rspec-core (~> 3.0)
|
|
86
|
-
rspec-mocks (3.
|
|
109
|
+
rspec-mocks (3.13.8)
|
|
87
110
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
88
|
-
rspec-support (~> 3.
|
|
89
|
-
rspec-support (3.
|
|
90
|
-
rubocop (1.
|
|
111
|
+
rspec-support (~> 3.13.0)
|
|
112
|
+
rspec-support (3.13.7)
|
|
113
|
+
rubocop (1.86.1)
|
|
91
114
|
json (~> 2.3)
|
|
92
|
-
language_server-protocol (
|
|
93
|
-
|
|
115
|
+
language_server-protocol (~> 3.17.0.2)
|
|
116
|
+
lint_roller (~> 1.1.0)
|
|
117
|
+
parallel (>= 1.10)
|
|
94
118
|
parser (>= 3.3.0.2)
|
|
95
119
|
rainbow (>= 2.2.2, < 4.0)
|
|
96
|
-
regexp_parser (>=
|
|
97
|
-
|
|
98
|
-
rubocop-ast (>= 1.30.0, < 2.0)
|
|
120
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
121
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
99
122
|
ruby-progressbar (~> 1.7)
|
|
100
|
-
unicode-display_width (>= 2.4.0, <
|
|
101
|
-
rubocop-ast (1.
|
|
102
|
-
parser (>= 3.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
rubocop (~> 1.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
rubocop-factory_bot (~> 2.22)
|
|
111
|
-
ruby-prof (1.7.0)
|
|
123
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
124
|
+
rubocop-ast (1.49.1)
|
|
125
|
+
parser (>= 3.3.7.2)
|
|
126
|
+
prism (~> 1.7)
|
|
127
|
+
rubocop-rspec (3.9.0)
|
|
128
|
+
lint_roller (~> 1.1)
|
|
129
|
+
rubocop (~> 1.81)
|
|
130
|
+
ruby-prof (2.0.4)
|
|
131
|
+
base64
|
|
132
|
+
ostruct
|
|
112
133
|
ruby-progressbar (1.13.0)
|
|
113
134
|
shellany (0.0.1)
|
|
114
135
|
simplecov (0.22.0)
|
|
115
136
|
docile (~> 1.1)
|
|
116
137
|
simplecov-html (~> 0.11)
|
|
117
138
|
simplecov_json_formatter (~> 0.1)
|
|
118
|
-
simplecov-cobertura (
|
|
139
|
+
simplecov-cobertura (3.1.0)
|
|
119
140
|
rexml
|
|
120
141
|
simplecov (~> 0.19)
|
|
121
|
-
simplecov-html (0.
|
|
142
|
+
simplecov-html (0.13.2)
|
|
122
143
|
simplecov_json_formatter (0.1.4)
|
|
123
|
-
stackprof (0.2.
|
|
124
|
-
stringio (3.
|
|
125
|
-
test-prof (1.
|
|
126
|
-
thor (1.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
144
|
+
stackprof (0.2.28)
|
|
145
|
+
stringio (3.2.0)
|
|
146
|
+
test-prof (1.6.1)
|
|
147
|
+
thor (1.5.0)
|
|
148
|
+
tsort (0.2.0)
|
|
149
|
+
unicode-display_width (3.2.0)
|
|
150
|
+
unicode-emoji (~> 4.1)
|
|
151
|
+
unicode-emoji (4.2.0)
|
|
152
|
+
vernier (1.10.1)
|
|
153
|
+
yard (0.9.43)
|
|
154
|
+
zeitwerk (2.7.5)
|
|
131
155
|
|
|
132
156
|
PLATFORMS
|
|
133
157
|
arm64-darwin-22
|
|
158
|
+
arm64-darwin-25
|
|
134
159
|
x86_64-linux
|
|
135
160
|
|
|
136
161
|
DEPENDENCIES
|
|
@@ -153,4 +178,4 @@ DEPENDENCIES
|
|
|
153
178
|
yard (~> 0.9)
|
|
154
179
|
|
|
155
180
|
BUNDLED WITH
|
|
156
|
-
|
|
181
|
+
4.0.10
|
data/lib/quant/experimental.rb
CHANGED
|
@@ -22,7 +22,7 @@ module Quant
|
|
|
22
22
|
|
|
23
23
|
Experimental.tracker[caller.first] = message
|
|
24
24
|
|
|
25
|
-
calling_method = caller.first
|
|
25
|
+
calling_method = caller.first[/in ["`'](.+?)[`']/, 1] || "unknown"
|
|
26
26
|
full_message = "EXPERIMENTAL: #{calling_method.inspect}: #{message}\nsource location: #{caller.first}"
|
|
27
27
|
puts full_message
|
|
28
28
|
end
|
data/lib/quant/ticks/ohlc.rb
CHANGED
|
@@ -45,8 +45,11 @@ module Quant
|
|
|
45
45
|
@low_price = low_price.to_f
|
|
46
46
|
@close_price = close_price.to_f
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
# Volumes are floats, not ints — crypto markets and many futures markets express
|
|
49
|
+
# fractional base/target volumes routinely (e.g., 0.12345 BTC). Existing specs already
|
|
50
|
+
# asserted Float values (`eq(2.0)`); a prior `.to_i` regression silently truncated.
|
|
51
|
+
@base_volume = (volume || base_volume).to_f
|
|
52
|
+
@target_volume = (target_volume || @base_volume).to_f
|
|
50
53
|
@trades = trades.to_i
|
|
51
54
|
|
|
52
55
|
@green = green.nil? ? compute_green : green
|
data/lib/quant/ticks/spot.rb
CHANGED
|
@@ -39,8 +39,12 @@ module Quant
|
|
|
39
39
|
@close_timestamp = extract_time(timestamp || close_timestamp || Quant.current_time)
|
|
40
40
|
@open_timestamp = @close_timestamp
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
# Volumes are floats, not ints — crypto markets and many futures markets express
|
|
43
|
+
# fractional base/target volumes routinely (e.g., 0.12345 BTC). Existing specs already
|
|
44
|
+
# asserted Float values (`eq(2.0)`); a prior `.to_i` regression silently truncated.
|
|
45
|
+
# See OHLC for the same fix.
|
|
46
|
+
@base_volume = (volume || base_volume).to_f
|
|
47
|
+
@target_volume = (target_volume || @base_volume).to_f
|
|
44
48
|
|
|
45
49
|
@trades = trades.to_i
|
|
46
50
|
super()
|
data/lib/quant/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: quantitative
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Lang
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: csv
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
13
26
|
- !ruby/object:Gem::Dependency
|
|
14
27
|
name: oj
|
|
15
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -38,8 +51,7 @@ dependencies:
|
|
|
38
51
|
- - "~>"
|
|
39
52
|
- !ruby/object:Gem::Version
|
|
40
53
|
version: '2.6'
|
|
41
|
-
description: Quantitative and statistical tools written for Ruby
|
|
42
|
-
and finance.
|
|
54
|
+
description: Quantitative and statistical tools written for Ruby for trading and finance.
|
|
43
55
|
email:
|
|
44
56
|
- mwlang@cybrains.net
|
|
45
57
|
executables: []
|
|
@@ -143,8 +155,7 @@ metadata:
|
|
|
143
155
|
allowed_push_host: https://rubygems.org
|
|
144
156
|
homepage_uri: https://github.com/mwlang/quantitative
|
|
145
157
|
source_code_uri: https://github.com/mwlang/quantitative
|
|
146
|
-
changelog_uri: https://github.com/mwlang/quantitative
|
|
147
|
-
post_install_message:
|
|
158
|
+
changelog_uri: https://github.com/mwlang/quantitative/blob/main/CHANGELOG.md
|
|
148
159
|
rdoc_options: []
|
|
149
160
|
require_paths:
|
|
150
161
|
- lib
|
|
@@ -152,16 +163,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
152
163
|
requirements:
|
|
153
164
|
- - ">="
|
|
154
165
|
- !ruby/object:Gem::Version
|
|
155
|
-
version: '3.
|
|
166
|
+
version: '3.3'
|
|
156
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
168
|
requirements:
|
|
158
169
|
- - ">="
|
|
159
170
|
- !ruby/object:Gem::Version
|
|
160
171
|
version: '0'
|
|
161
172
|
requirements: []
|
|
162
|
-
rubygems_version:
|
|
163
|
-
signing_key:
|
|
173
|
+
rubygems_version: 4.0.10
|
|
164
174
|
specification_version: 4
|
|
165
|
-
summary: Quantitative and statistical tools written for Ruby
|
|
166
|
-
finance.
|
|
175
|
+
summary: Quantitative and statistical tools written for Ruby for trading and finance.
|
|
167
176
|
test_files: []
|