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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5980a746b36ba0ee44bbd6117df75040a94969c5f00e1129d0f74aa1772b5013
4
- data.tar.gz: 88fff74e34d1c446d252f9750bb5363828a448b9b326904fefa41499318fdb20
3
+ metadata.gz: e3d3c818bd142e017de0c61523ac0dfb14ec104fab94e073336892829128d87a
4
+ data.tar.gz: 642e8f7c285556847597a4a046443144d9a2fc394448af6ed95fc6d34f90dfd6
5
5
  SHA512:
6
- metadata.gz: 57dd5832cf3aceaac7fda15fe2cec89fb615387205fcbbfd2dcb20ed2241bde58648aaa5b87f6bf605e2f827086613e7309d4e71bffdf60d786e2d71038a146f
7
- data.tar.gz: f80357622cd7cbcee2d13d5439b0423aa0aab9006d3a1aedfd215d8690cf5cc158a9c10990b5ecb933322d5784709c258daa26ccaa0c51ea4808e36ee35554a2
6
+ metadata.gz: db5a09bfe7dab83b4697726e1ea52a487231c02b3d57498c5a7a6e8cc152b3baf80c701cc7c01cd5a20732746f5be6d17dfe9d5425a1396f2a08adaba3e091a4
7
+ data.tar.gz: 566493343ff4c6986573072b5c6309c4ad3088b13b2c1b518d9cd6cae60d81c4c081bb60dfde54f684e245c347586c1a5ed1efa2b6f5c30708c39d61a278e8bc
data/.rubocop.yml CHANGED
@@ -2,7 +2,7 @@ inherit_gem:
2
2
  relaxed-rubocop: .rubocop.yml
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 3.2
5
+ TargetRubyVersion: 3.3
6
6
  Exclude:
7
7
  - 'spec/performance/*.rb'
8
8
 
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.0
1
+ 4.0.4
data/Gemfile.lock CHANGED
@@ -1,27 +1,35 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- quantitative (0.3.3)
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.2)
12
- benchmark-ips (2.13.0)
13
- bigdecimal (3.1.6)
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
- debug (1.8.0)
16
- irb (>= 1.5.0)
17
- reline (>= 0.3.1)
18
- diff-lcs (1.5.0)
19
- docile (1.4.0)
20
- ffi (1.16.3)
21
- formatador (1.1.0)
22
- guard (2.18.1)
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.6.0)
37
- irb (1.9.1)
38
- rdoc
39
- reline (>= 0.3.8)
40
- json (2.7.1)
41
- language_server-protocol (3.17.0.3)
42
- listen (3.8.0)
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
- lumberjack (1.2.9)
46
- method_source (1.0.0)
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.16.3)
64
+ oj (3.17.0)
52
65
  bigdecimal (>= 3.0)
53
- parallel (1.24.0)
54
- parser (3.3.0.4)
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
- pry (0.14.2)
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
- psych (5.1.2)
79
+ reline (>= 0.6.0)
80
+ psych (5.3.1)
81
+ date
61
82
  stringio
62
- racc (1.7.3)
83
+ racc (1.8.1)
63
84
  rainbow (3.1.1)
64
- rake (13.1.0)
85
+ rake (13.4.2)
65
86
  rb-fsevent (0.11.2)
66
- rb-inotify (0.10.1)
87
+ rb-inotify (0.11.1)
67
88
  ffi (~> 1.0)
68
- rdoc (6.6.2)
89
+ rdoc (7.2.0)
90
+ erb
69
91
  psych (>= 4.0.0)
70
- regexp_parser (2.9.0)
92
+ tsort
93
+ regexp_parser (2.12.0)
71
94
  relaxed-rubocop (2.5)
72
- reline (0.4.1)
95
+ reline (0.6.3)
73
96
  io-console (~> 0.5)
74
- rexml (3.2.6)
75
- rspec (3.12.0)
76
- rspec-core (~> 3.12.0)
77
- rspec-expectations (~> 3.12.0)
78
- rspec-mocks (~> 3.12.0)
79
- rspec-core (3.12.2)
80
- rspec-support (~> 3.12.0)
81
- rspec-expectations (3.12.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.12.0)
84
- rspec-github (2.4.0)
106
+ rspec-support (~> 3.13.0)
107
+ rspec-github (3.0.0)
85
108
  rspec-core (~> 3.0)
86
- rspec-mocks (3.12.6)
109
+ rspec-mocks (3.13.8)
87
110
  diff-lcs (>= 1.2.0, < 2.0)
88
- rspec-support (~> 3.12.0)
89
- rspec-support (3.12.1)
90
- rubocop (1.60.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 (>= 3.17.0)
93
- parallel (~> 1.10)
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 (>= 1.8, < 3.0)
97
- rexml (>= 3.2.5, < 4.0)
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, < 3.0)
101
- rubocop-ast (1.30.0)
102
- parser (>= 3.2.1.0)
103
- rubocop-capybara (2.20.0)
104
- rubocop (~> 1.41)
105
- rubocop-factory_bot (2.25.1)
106
- rubocop (~> 1.41)
107
- rubocop-rspec (2.26.1)
108
- rubocop (~> 1.40)
109
- rubocop-capybara (~> 2.17)
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 (2.1.0)
139
+ simplecov-cobertura (3.1.0)
119
140
  rexml
120
141
  simplecov (~> 0.19)
121
- simplecov-html (0.12.3)
142
+ simplecov-html (0.13.2)
122
143
  simplecov_json_formatter (0.1.4)
123
- stackprof (0.2.26)
124
- stringio (3.1.0)
125
- test-prof (1.3.2)
126
- thor (1.3.0)
127
- unicode-display_width (2.5.0)
128
- vernier (0.5.1)
129
- yard (0.9.34)
130
- zeitwerk (2.6.15)
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
- 2.3.13
181
+ 4.0.10
@@ -22,7 +22,7 @@ module Quant
22
22
 
23
23
  Experimental.tracker[caller.first] = message
24
24
 
25
- calling_method = caller.first.scan(/`([^']*)/)[0][0]
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
@@ -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
- @base_volume = (volume || base_volume).to_i
49
- @target_volume = (target_volume || @base_volume).to_i
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
@@ -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
- @base_volume = (volume || base_volume).to_i
43
- @target_volume = (target_volume || @base_volume).to_i
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Quant
4
- VERSION = "0.3.3"
4
+ VERSION = "0.4.1"
5
5
  end
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.3.3
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: 2024-06-08 00:00:00.000000000 Z
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 3.2+ for trading
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.2'
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: 3.5.11
163
- signing_key:
173
+ rubygems_version: 4.0.10
164
174
  specification_version: 4
165
- summary: Quantitative and statistical tools written for Ruby 3.2+ for trading and
166
- finance.
175
+ summary: Quantitative and statistical tools written for Ruby for trading and finance.
167
176
  test_files: []