quantitative 0.4.0 → 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: d6730ed9b986e266555841b22c4b0850e5faab7200e8e9a1ba9aadf2c285e39c
4
- data.tar.gz: 4000b1b078dcf483092ac7215c96f8eb1400c095053d43e434b5375ca2aa8400
3
+ metadata.gz: e3d3c818bd142e017de0c61523ac0dfb14ec104fab94e073336892829128d87a
4
+ data.tar.gz: 642e8f7c285556847597a4a046443144d9a2fc394448af6ed95fc6d34f90dfd6
5
5
  SHA512:
6
- metadata.gz: 1824dc31f57b53162ca63008adcc3d863738641821622b7c166121b3ff4766d9a7994f677857c4b8d9b71200479254c52b299868b7312922149daccf172d9b70
7
- data.tar.gz: c92e33aaab91f5c5ed58932742842c8e248e61d26725a771cb787853d6d5130991a31f3f1ab15cfec489c888f0be7d1a41d7881420fad5117375ca6c5d456a4a
6
+ metadata.gz: db5a09bfe7dab83b4697726e1ea52a487231c02b3d57498c5a7a6e8cc152b3baf80c701cc7c01cd5a20732746f5be6d17dfe9d5425a1396f2a08adaba3e091a4
7
+ data.tar.gz: 566493343ff4c6986573072b5c6309c4ad3088b13b2c1b518d9cd6cae60d81c4c081bb60dfde54f684e245c347586c1a5ed1efa2b6f5c30708c39d61a278e8bc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- quantitative (0.4.0)
4
+ quantitative (0.4.1)
5
5
  csv
6
6
  oj (~> 3.10)
7
7
  zeitwerk (~> 2.6)
@@ -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.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quantitative
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Lang
@@ -155,7 +155,7 @@ metadata:
155
155
  allowed_push_host: https://rubygems.org
156
156
  homepage_uri: https://github.com/mwlang/quantitative
157
157
  source_code_uri: https://github.com/mwlang/quantitative
158
- changelog_uri: https://github.com/mwlang/quantitative
158
+ changelog_uri: https://github.com/mwlang/quantitative/blob/main/CHANGELOG.md
159
159
  rdoc_options: []
160
160
  require_paths:
161
161
  - lib