talib_ruby 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.textile +32 -4
  2. data/ext/talib/talib.c +2 -2
  3. metadata +3 -3
@@ -5,8 +5,18 @@ Ruby Wrapper for "ta-lib":http://ta-lib.org/
5
5
  This project has been started by Timur Adigamov on "Rubyforge":http://rubyforge.org/projects/talib-ruby/,
6
6
  but since it didn't build on my machine and wasn't complete i modified it slightly, et voila.
7
7
 
8
+ h4. Important note for commit id "11277315208a8bfcfd2a3211e10b5732d6705fc7":https://github.com/rivella50/talib-ruby/commit/11277315208a8bfcfd2a3211e10b5732d6705fc7 and gem version 1.0.6
9
+
10
+ From now on all returned lists from talib_ruby now correspond to what ta-lib returns, i.e. there will be no longer leading nil values in any outXYZ lists.
11
+ The nil values will now be trailing nil values if your inserted outXYZ lists are too large (let's say you always insert out arrays with the same length as the inXYZ lists).
12
+ Therefore the returned value outBegIdx is no more relevant for the outXYZ lists, since the first calculated value can be found right at index 0 in the outXYZ lists.
13
+ All calculated values are still the same, it's only a shifting issue which has been corrected now.
14
+ Thanks go to Masayuki Yamamoto who showed me this.
15
+
8
16
  h3. Install and build instructions
9
17
 
18
+ h4. Install ta-lib:
19
+
10
20
  Install ta-lib from "MacPorts":http://www.macports.org/ports.php?by=name&substr=ta-lib:
11
21
 
12
22
  bc. sudo port install ta-lib
@@ -15,20 +25,27 @@ Or install ta-lib from "Homebrew":https://github.com/mxcl/homebrew/blob/master/L
15
25
 
16
26
  bc. sudo brew install ta-lib
17
27
 
18
- Install the ruby wrapper talib_ruby:
28
+ If you want to compile ta-lib from the sources ("ta-lib.org":http://www.ta-lib.org/hdr_dw.html) you have to use the following statements (thanks to rmldj):
29
+
30
+ bc. ./configure LDFLAGS="-lm"
31
+ make
32
+ sudo make install
33
+
34
+ h4. Install the ruby wrapper talib_ruby:
19
35
 
20
36
  bc. sudo env ARCHFLAGS="-arch PLATFORM" gem install talib_ruby -- --with-talib-include=ABSOLUTE_PATH_TO_TALIB_HEADERS --with-talib-lib=ABSOLUTE_PATH_TO_TALIB_LIBS
21
37
 
22
38
  * PLATFORM = [i386 | x86_64 | ...]
23
39
  * ABSOLUTE_PATH_TO_TALIB_HEADERS = The path to the ta-lib header files
24
- ** e.g. for Port: /opt/local/var/macports/software/ta-lib/0.4.0_0/opt/local/include/ta-lib
25
- ** e.g. for Homebrew: /usr/local/Cellar/ta-lib/0.4.0/include/ta-lib
40
+ ** e.g. for Port: /opt/local/var/macports/software/ta-lib/0.4.0_0/opt/local/include
41
+ ** e.g. for Homebrew: /usr/local/Cellar/ta-lib/0.4.0/include
26
42
  * ABSOLUTE_PATH_TO_TALIB_LIBS = The path to the ta-lib lib files
27
- ** e.g. fo Port: /opt/local/var/macports/software/ta-lib/0.4.0_0/opt/local/lib)
43
+ ** e.g. fo Port: /opt/local/var/macports/software/ta-lib/0.4.0_0/opt/local/lib
28
44
  ** e.g. fo Homebrew: /usr/local/Cellar/ta-lib/0.4.0/lib
29
45
 
30
46
  Now ta-lib can be used by using _require 'talib_ruby'_
31
47
  Needs at least Mac OSX 10.5. Has not been tested on Windows, but works there too what i've heard.
48
+ Tested with Ruby 1.8.7, 1.9.3 and 2.0.0.
32
49
 
33
50
  h3. Example
34
51
 
@@ -61,3 +78,14 @@ h3. Useful links
61
78
  * "TA-Lib Forum":http://www.tadoc.org/forum/index.php?board=9.0
62
79
  * "XML explanation":http://ta-lib.svn.sourceforge.net/viewvc/ta-lib/trunk/ta-lib/ta_func_api.xml?view=markup of all supported Functions
63
80
  * "C/C++ API Documentation":http://ta-lib.org/d_api/d_api.html
81
+
82
+ h3. Donate
83
+
84
+ If you think this library is useful i would be grateful for a donation.
85
+ !https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif!:https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NCX9EKVWBTBBJ
86
+
87
+ h3. License
88
+
89
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
90
+
91
+ Copyright (c) 2013 by Valentin Treu, released under the MIT license.
@@ -450,7 +450,7 @@ static VALUE ta_func_call(VALUE self, VALUE in_start, VALUE in_end)
450
450
  for (j=0; j<out_num; j++)
451
451
  {
452
452
  double el = ((double*)param_holder->out[i])[j];
453
- rb_ary_store(sub_ary, j+out_start, rb_float_new(el));
453
+ rb_ary_store(sub_ary, j, rb_float_new(el));
454
454
  }
455
455
  }
456
456
  return rb_ary_new3(2, INT2FIX(out_start), INT2FIX(out_num));
@@ -529,7 +529,7 @@ void Init_talib()
529
529
  rb_struct_define("TA_IntegerList", "data", "nb_element", NULL );
530
530
 
531
531
  rb_sInParamInfo = rb_struct_define("TA_InputParameterInfo", "type", "param_name", "flags", NULL );
532
- rb_sOptInParamInfo = rb_struct_define("TA_OutInputParameterInfo", "type", "param_name", "flags", "display_name", "data_set", "default_value", "hint", "help_file", NULL );
532
+ rb_sOptInParamInfo = rb_struct_define("TA_OptInputParameterInfo", "type", "param_name", "flags", "display_name", "data_set", "default_value", "hint", "help_file", NULL );
533
533
  rb_sOutParamInfo = rb_struct_define("TA_OutputParameterInfo", "type", "param_name", "flags", NULL );
534
534
 
535
535
  /*
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 5
9
- version: 1.0.5
8
+ - 6
9
+ version: 1.0.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Valentin Treu
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2013-04-07 00:00:00 +02:00
17
+ date: 2014-01-01 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies: []
20
20