Project

tafunc

0.0
No commit activity in last 3 years
No release in over 3 years
Useful methods are added to TaLib, TaLib::Function, and TaLib::TAFunc.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 1.8.7
~> 3.12
>= 1.0.5
 Project Readme

TAFunc - another talib_ruby wrapper and extension README.

TAFunc provides utility extensions for talib_ruby.

Requirements

Installation

Description

According to ta_abstract.h of TA-Lib, there are some ways of wrapping library. Mlamby-san's indicator, which contains useful extension, takes static code generation approach using XML at SourceForge to get TA method information.

On the contrary, the approach of TAFunc is more dynamic and meta-programming. No xml is needed. No static code generation.

Usage

ma = TaLib::TAFunc.new( :MA ) do |taf|
  taf.param_in_real = ARRAY_OF_HISTORICAL_DATA
  taf.param_opt_in_period = 2
end

ma.call

result = [1.0, 2.0, 3.0, 4.0].tafunc( :MA ) do |taf|
  taf.param_in_real = ARRAY_OF_HISTORICAL_DATA
  taf.param_opt_in_time_period = 2
end
TaLib::TAFunc.new( :MACDEXT ).hints
==== Momentum Indicators ====
<MACDEXT>
inputs:
param_in_real

options:
param_opt_in_fast_period
param_opt_in_fast_ma_type
param_opt_in_slow_period
param_opt_in_slow_ma_type
param_opt_in_signal_period
param_opt_in_signal_ma_type

outputs:
param_out_macd
param_out_macd_signal
param_out_macd_hist


=> ["Momentum Indicators"]
>> TaLib::TAFunc.groups
=> ["Math Operators", "Math Transform", "Overlap Studies", "Volatility Indicators", "Momentum Indicators", "Cycle Indicators", "Volume Indicators", "Pattern Recognition", "Statistic Functions", "Price Transform"]
>> TaLib::TAFunc.function
TaLib::TAFunc.function_exists?  TaLib::TAFunc.functions
TaLib::TAFunc.function_find

>> TaLib::TAFunc.group_of_function( :MA )
=> "Overlap Studies"
>> TaLib::TAFunc.new( :MA ).hints
==== Overlap Studies ====
<MA>
inputs:
param_in_real

options:
param_opt_in_time_period
param_opt_in_ma_type

outputs:
param_out_real


=> ["Overlap Studies"]

See in examples directory and test code for details.

References

  • TA-Lib
  • TACODE.org is also nice documentation which discribes many of TA methods.

Contributing to TAFunc

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

Copyright (c) 2013 YAMAMOTO, Masayuki. License is MIT. See LICENSE.txt for further details.