roi_calculator 0.1.3 → 0.3.0

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
- SHA1:
3
- metadata.gz: e73b59656bf600db2b639605f42b694918fca169
4
- data.tar.gz: d78e7e9aa58647501726b443ce99100b465e29c2
2
+ SHA256:
3
+ metadata.gz: 6a7a0e73a94faee6f8d2baec965a619a1d662d50e86309b2a0bbb033d1e3b894
4
+ data.tar.gz: 87dae151a9665f8bb89e0072c0c78ce3eb5ec131edf2c4eb0542d7748e099985
5
5
  SHA512:
6
- metadata.gz: 026adbada9d8225891cf493f8b0f76da51d84d09a22eeda126264759c6a7fedfec5791cd4c6cfdb45d0f7dc68c0881b74f790196a066b64e9722c05188248b6e
7
- data.tar.gz: 280becd770e1e37fa76641dd42d3a639e3c61d550c8aab02603da944a0440aab44e0c889e0e350534f667aff624fac978aa94e81a0b5840f4df4f8a71469a712
6
+ metadata.gz: '009d852e1d6ac38aa486eba44a6751ecbd5cfec106bc5c829be44e9d7ee82fc2ab443cfd88c07f9a6c0a3be299fc8f66ff88f3d7712a3bd33be43f350ca9dbd5'
7
+ data.tar.gz: 8355d8b7edc808d6d5d674ce54500139897b7bd94bcd23c8fdc8c99f5a411e4522e24acfb4d9203f7fd40c9a74bd36cbeeb94b54f850eb31b81b056f89751a23
@@ -0,0 +1 @@
1
+ bigbang_services
@@ -13,7 +13,7 @@ module ROI
13
13
  attr_reader :id, :start_date, :end_date, :skip_on_gap
14
14
 
15
15
  def initialize(options)
16
- @id = options[:id]
16
+ @id = options[:id].try(:to_i)
17
17
  @start_date = options[:start_date]
18
18
  @end_date = options[:end_date] || Date.today - 1
19
19
  @skip_on_gap = false
@@ -64,7 +64,7 @@ module ROI
64
64
  series = filtered.slice(low, days + 1)
65
65
  vol = MathUtil.volatility(series)
66
66
  date = dates_with_position.fetch(low + days) { dates_with_position.last }
67
- [date.to_s(:db), vol] if date
67
+ [date, vol] if date
68
68
  end
69
69
  end
70
70
 
@@ -13,8 +13,8 @@ module ROI
13
13
  end
14
14
 
15
15
  def months(amount, date = end_date)
16
- scoped_start = WorkDay.last_until((date - amount.month).end_of_month)
17
- scoped_end = adjust_end_date(date)
16
+ scoped_start = WorkDay.last_until((date - (amount+1).month).end_of_month)
17
+ scoped_end = adjust_end_date((date - 1.month).end_of_month)
18
18
  check_gaps_and_format(scoped_start, scoped_end)
19
19
  end
20
20
 
@@ -1,3 +1,3 @@
1
1
  module ROI
2
- VERSION = "0.1.3"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roi_calculator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adriano Bacha
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-29 00:00:00.000000000 Z
11
+ date: 2020-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -89,6 +89,7 @@ extra_rdoc_files: []
89
89
  files:
90
90
  - ".gitignore"
91
91
  - ".rspec"
92
+ - ".ruby-gemset"
92
93
  - ".ruby-version"
93
94
  - ".travis.yml"
94
95
  - Gemfile
@@ -122,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
123
  - !ruby/object:Gem::Version
123
124
  version: '0'
124
125
  requirements: []
125
- rubyforge_project:
126
- rubygems_version: 2.6.10
126
+ rubygems_version: 3.0.8
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Rentability and financial calculations