Skip to content

Commit 1127731

Browse files
committed
the returned out lists now correspond to what ta-lib returns, i.e. no more leading nil values, but trailing nil values.
1 parent 836c009 commit 1127731

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ begin
88
gemspec.homepage = "http://github.com/rivella50/talib-ruby"
99
gemspec.authors = ["Valentin Treu"]
1010
gemspec.extensions << 'ext/talib/extconf.rb'
11-
gemspec.version = '1.0.5'
11+
gemspec.version = '1.0.6'
1212
gemspec.files = FileList['example/ma.rb','ext/talib/talib.c', 'README.rdoc','lib/**/*.rb']
1313
gemspec.test_files = []
1414
end

example/adx.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
5.times do |k|
1313

1414
b = Array.new(10)
15-
l = TaLib::Function.new("ADX")
15+
ta = TaLib::Function.new("ADX")
1616
# setup input price
1717
# open = nil, volume = nil, open_interest = nil
18-
l.in_price(0, nil, h, l, c, nil, nil);
18+
ta.in_price(0, nil, h, l, c, nil, nil);
1919
# setup optional parameter
20-
l.opt_int(0,k+2);
20+
ta.opt_int(0,k+2);
2121
# setup output parameter
22-
l.out_real(0,b);
23-
l.call(0,9)
22+
ta.out_real(0,b);
23+
ta.call(0,9)
2424
p "k=#{k+2}"
2525
p b
2626
end

ext/talib/talib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ static VALUE ta_func_call(VALUE self, VALUE in_start, VALUE in_end)
450450
for (j=0; j<out_num; j++)
451451
{
452452
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));
454454
}
455455
}
456456
return rb_ary_new3(2, INT2FIX(out_start), INT2FIX(out_num));

0 commit comments

Comments
 (0)