tulirb 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -0
- data/CHANGELOG.md +6 -0
- data/README.md +8 -3
- data/code_generator.rb +29 -0
- data/ext/tulirb/tulirb.c +104 -104
- data/lib/tulirb/version.rb +1 -1
- data/lib/tulirb.rb +910 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbe761a5276117baa268d4c3ada16a57afe6a0b993a1a689225320336c4c7a89
|
4
|
+
data.tar.gz: adfd35e0f4de82b8d3cdf70d5bbc4188f5e1b312381b18ef65ea254dbfd914bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ac704550f29551b68d3681b359dbe5029f08a1a0ae57d2c6f049fbaac4d8581591d87f2431aa4253169008948704f2479cd6dc43ae48c7e92daa28f30624b81
|
7
|
+
data.tar.gz: f951e71336d9c3a42d370d801bdedb3846c13a40d9a5ae1a009bff7415b3ed7011a966a3596a00b4cbfa8bd675e9c5f9e4460e83cb1560c39cd9b02391576c0d
|
data/.rubocop.yml
CHANGED
@@ -16,6 +16,12 @@ Style/StringLiteralsInInterpolation:
|
|
16
16
|
EnforcedStyle: double_quotes
|
17
17
|
Style/Documentation:
|
18
18
|
Enabled: false
|
19
|
+
Metrics/ModuleLength:
|
20
|
+
Enabled: false
|
21
|
+
Metrics/ClassLength:
|
22
|
+
Enabled: false
|
23
|
+
Metrics/MethodLength:
|
24
|
+
CountAsOne: ['array', 'heredoc', 'method_call']
|
19
25
|
|
20
26
|
|
21
27
|
Layout/LineLength:
|
data/CHANGELOG.md
CHANGED
@@ -3,3 +3,9 @@
|
|
3
3
|
## [0.1.0] - 2023-12-31
|
4
4
|
|
5
5
|
- Initial release
|
6
|
+
|
7
|
+
## [0.1.1] - 2023-01-22
|
8
|
+
|
9
|
+
- Fixed ArgumentError messages in C extension.
|
10
|
+
- [interna] Replace metaprogrammed Ruby wrapper methods with explicitly defined methods.
|
11
|
+
- [internal] Added tests for wrapper methods.
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Tulirb
|
2
|
-
Ruby bindings for the Tulip indicators technical analysis indicator library (https://tulipindicators.org/). This can be used to build tools for financial trading and
|
2
|
+
Ruby bindings for the Tulip indicators technical analysis indicator library (https://tulipindicators.org/). This can be used to build tools for financial markets trading and analytics in Ruby.
|
3
3
|
|
4
4
|
## Installation
|
5
5
|
|
@@ -18,6 +18,8 @@ This library consists of a single module: `Tulirb`. All indicator functions are
|
|
18
18
|
Example:
|
19
19
|
|
20
20
|
```ruby
|
21
|
+
require("tulirb")
|
22
|
+
|
21
23
|
# Exponential Moving Average
|
22
24
|
Tulirb.ema([[1.2, 1.5, 1, 1.8]], period: 5) # => [[1.2, 1.35, 1.175, 1.4875]]
|
23
25
|
|
@@ -34,6 +36,9 @@ Example:
|
|
34
36
|
) # => [[650, 720.2020202020201, 120.20202020202017], [480.80808080808083, 690.0673400673401, 496.80134680134677]]
|
35
37
|
```
|
36
38
|
|
39
|
+
## Documentation
|
40
|
+
Find documentation for all indicator functions [here](https://www.rubydoc.info/github/ozone4real/tulirb/main/Tulirb). Information about the input and option parameters for each indicator method are also available in the `Tulirb::INDICATORS_INFO` hash.
|
41
|
+
|
37
42
|
## Development
|
38
43
|
|
39
44
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -42,7 +47,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
42
47
|
|
43
48
|
## Contributing
|
44
49
|
|
45
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
50
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ozone4real/tulirb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ozone4real/tulirb/blob/main/CODE_OF_CONDUCT.md).
|
46
51
|
|
47
52
|
## License
|
48
53
|
|
@@ -50,4 +55,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
50
55
|
|
51
56
|
## Code of Conduct
|
52
57
|
|
53
|
-
Everyone interacting in the Tulirb project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
58
|
+
Everyone interacting in the Tulirb project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ozone4real/tulirb/blob/main/CODE_OF_CONDUCT.md).
|
data/code_generator.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require("tulirb")
|
4
|
+
require("active_support/core_ext/string")
|
5
|
+
|
6
|
+
file = File.open("code_output.rb", "a+")
|
7
|
+
|
8
|
+
file.write("class << self\n")
|
9
|
+
|
10
|
+
Tulirb::INDICATORS_INFO.each do |k, v|
|
11
|
+
kwargs = v[:options].map { |o| "#{o}:" }.join(", ")
|
12
|
+
kwargs = kwargs.empty? ? "" : ", #{kwargs}"
|
13
|
+
options_doc = v[:options].map { |o| "# @param #{o} [Numeric] #{o.titleize}" }
|
14
|
+
options_doc = options_doc.empty? ? "" : "\n#{options_doc.join(".\n")}."
|
15
|
+
func = <<~RUBY
|
16
|
+
# #{v[:full_name]}.
|
17
|
+
# @param inputs [Array<Array<Numeric>>] 2d array of inputs. #{options_doc}
|
18
|
+
# @return [Array<Array<Numeric>>] 2d array of results.
|
19
|
+
# @see Official TulipIndicators docs for detailed explanation and formular for this indicator function: (https://tulipindicators.org/#{k})
|
20
|
+
def #{k}(inputs#{kwargs})
|
21
|
+
super(inputs, [#{v[:options].join(", ")}])
|
22
|
+
end
|
23
|
+
|
24
|
+
RUBY
|
25
|
+
file.write(func)
|
26
|
+
end
|
27
|
+
|
28
|
+
file.write("end")
|
29
|
+
file.close
|