├── .gitignore ├── .gitmodules ├── Cargo.toml ├── README.md ├── rustfmt.toml ├── ta-lib-sys ├── .gitignore ├── Cargo.toml ├── LICENSE ├── README.md ├── build.rs ├── src │ └── lib.rs ├── ta-lib-0.4.0 │ ├── CHANGELOG.TXT │ ├── HISTORY.TXT │ ├── Makefile.am │ ├── Makefile.in │ ├── aclocal.m4 │ ├── autogen.sh │ ├── autom4te.cache │ │ ├── output.0 │ │ ├── output.1 │ │ ├── requests │ │ ├── traces.0 │ │ └── traces.1 │ ├── config.guess │ ├── config.sub │ ├── configure │ ├── configure.in │ ├── depcomp │ ├── include │ │ ├── Makefile.am │ │ ├── ta_abstract.h │ │ ├── ta_common.h │ │ ├── ta_config.h.in │ │ ├── ta_defs.h │ │ ├── ta_func.h │ │ └── ta_libc.h │ ├── install-sh │ ├── ltmain.sh │ ├── missing │ ├── src │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── ta_abstract │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── excel_glue.c │ │ │ ├── frames │ │ │ │ ├── ta_frame.c │ │ │ │ └── ta_frame.h │ │ │ ├── ta_abstract.c │ │ │ ├── ta_def_ui.c │ │ │ ├── ta_def_ui.h │ │ │ ├── ta_frame_priv.h │ │ │ ├── ta_func_api.c │ │ │ ├── ta_group_idx.c │ │ │ ├── ta_java_defs.h │ │ │ ├── tables │ │ │ │ ├── table_a.c │ │ │ │ ├── table_b.c │ │ │ │ ├── table_c.c │ │ │ │ ├── table_d.c │ │ │ │ ├── table_e.c │ │ │ │ ├── table_f.c │ │ │ │ ├── table_g.c │ │ │ │ ├── table_h.c │ │ │ │ ├── table_i.c │ │ │ │ ├── table_j.c │ │ │ │ ├── table_k.c │ │ │ │ ├── table_l.c │ │ │ │ ├── table_m.c │ │ │ │ ├── table_n.c │ │ │ │ ├── table_o.c │ │ │ │ ├── table_p.c │ │ │ │ ├── table_q.c │ │ │ │ ├── table_r.c │ │ │ │ ├── table_s.c │ │ │ │ ├── table_t.c │ │ │ │ ├── table_u.c │ │ │ │ ├── table_v.c │ │ │ │ ├── table_w.c │ │ │ │ ├── table_x.c │ │ │ │ ├── table_y.c │ │ │ │ └── table_z.c │ │ │ └── templates │ │ │ │ ├── CoreAnnotated.java.template │ │ │ │ ├── Makefile.am.template │ │ │ │ ├── excel_glue.c.template │ │ │ │ ├── ta_frame.c.template │ │ │ │ ├── ta_frame.h.template │ │ │ │ ├── ta_func.h.template │ │ │ │ ├── ta_func.swg.template │ │ │ │ ├── ta_func_api.c.template │ │ │ │ ├── ta_group_idx.c.template │ │ │ │ ├── ta_java_defs.h.template │ │ │ │ ├── ta_retcode.c.template │ │ │ │ └── ta_x.c.template │ │ ├── ta_common │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── ta_global.c │ │ │ ├── ta_global.h │ │ │ ├── ta_magic_nb.h │ │ │ ├── ta_memory.h │ │ │ ├── ta_pragma.h │ │ │ ├── ta_retcode.c │ │ │ ├── ta_retcode.csv │ │ │ └── ta_version.c │ │ ├── ta_func │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── ta_ACOS.c │ │ │ ├── ta_AD.c │ │ │ ├── ta_ADD.c │ │ │ ├── ta_ADOSC.c │ │ │ ├── ta_ADX.c │ │ │ ├── ta_ADXR.c │ │ │ ├── ta_APO.c │ │ │ ├── ta_AROON.c │ │ │ ├── ta_AROONOSC.c │ │ │ ├── ta_ASIN.c │ │ │ ├── ta_ATAN.c │ │ │ ├── ta_ATR.c │ │ │ ├── ta_AVGPRICE.c │ │ │ ├── ta_BBANDS.c │ │ │ ├── ta_BETA.c │ │ │ ├── ta_BOP.c │ │ │ ├── ta_CCI.c │ │ │ ├── ta_CDL2CROWS.c │ │ │ ├── ta_CDL3BLACKCROWS.c │ │ │ ├── ta_CDL3INSIDE.c │ │ │ ├── ta_CDL3LINESTRIKE.c │ │ │ ├── ta_CDL3OUTSIDE.c │ │ │ ├── ta_CDL3STARSINSOUTH.c │ │ │ ├── ta_CDL3WHITESOLDIERS.c │ │ │ ├── ta_CDLABANDONEDBABY.c │ │ │ ├── ta_CDLADVANCEBLOCK.c │ │ │ ├── ta_CDLBELTHOLD.c │ │ │ ├── ta_CDLBREAKAWAY.c │ │ │ ├── ta_CDLCLOSINGMARUBOZU.c │ │ │ ├── ta_CDLCONCEALBABYSWALL.c │ │ │ ├── ta_CDLCOUNTERATTACK.c │ │ │ ├── ta_CDLDARKCLOUDCOVER.c │ │ │ ├── ta_CDLDOJI.c │ │ │ ├── ta_CDLDOJISTAR.c │ │ │ ├── ta_CDLDRAGONFLYDOJI.c │ │ │ ├── ta_CDLENGULFING.c │ │ │ ├── ta_CDLEVENINGDOJISTAR.c │ │ │ ├── ta_CDLEVENINGSTAR.c │ │ │ ├── ta_CDLGAPSIDESIDEWHITE.c │ │ │ ├── ta_CDLGRAVESTONEDOJI.c │ │ │ ├── ta_CDLHAMMER.c │ │ │ ├── ta_CDLHANGINGMAN.c │ │ │ ├── ta_CDLHARAMI.c │ │ │ ├── ta_CDLHARAMICROSS.c │ │ │ ├── ta_CDLHIGHWAVE.c │ │ │ ├── ta_CDLHIKKAKE.c │ │ │ ├── ta_CDLHIKKAKEMOD.c │ │ │ ├── ta_CDLHOMINGPIGEON.c │ │ │ ├── ta_CDLIDENTICAL3CROWS.c │ │ │ ├── ta_CDLINNECK.c │ │ │ ├── ta_CDLINVERTEDHAMMER.c │ │ │ ├── ta_CDLKICKING.c │ │ │ ├── ta_CDLKICKINGBYLENGTH.c │ │ │ ├── ta_CDLLADDERBOTTOM.c │ │ │ ├── ta_CDLLONGLEGGEDDOJI.c │ │ │ ├── ta_CDLLONGLINE.c │ │ │ ├── ta_CDLMARUBOZU.c │ │ │ ├── ta_CDLMATCHINGLOW.c │ │ │ ├── ta_CDLMATHOLD.c │ │ │ ├── ta_CDLMORNINGDOJISTAR.c │ │ │ ├── ta_CDLMORNINGSTAR.c │ │ │ ├── ta_CDLONNECK.c │ │ │ ├── ta_CDLPIERCING.c │ │ │ ├── ta_CDLRICKSHAWMAN.c │ │ │ ├── ta_CDLRISEFALL3METHODS.c │ │ │ ├── ta_CDLSEPARATINGLINES.c │ │ │ ├── ta_CDLSHOOTINGSTAR.c │ │ │ ├── ta_CDLSHORTLINE.c │ │ │ ├── ta_CDLSPINNINGTOP.c │ │ │ ├── ta_CDLSTALLEDPATTERN.c │ │ │ ├── ta_CDLSTICKSANDWICH.c │ │ │ ├── ta_CDLTAKURI.c │ │ │ ├── ta_CDLTASUKIGAP.c │ │ │ ├── ta_CDLTHRUSTING.c │ │ │ ├── ta_CDLTRISTAR.c │ │ │ ├── ta_CDLUNIQUE3RIVER.c │ │ │ ├── ta_CDLUPSIDEGAP2CROWS.c │ │ │ ├── ta_CDLXSIDEGAP3METHODS.c │ │ │ ├── ta_CEIL.c │ │ │ ├── ta_CMO.c │ │ │ ├── ta_CORREL.c │ │ │ ├── ta_COS.c │ │ │ ├── ta_COSH.c │ │ │ ├── ta_DEMA.c │ │ │ ├── ta_DIV.c │ │ │ ├── ta_DX.c │ │ │ ├── ta_EMA.c │ │ │ ├── ta_EXP.c │ │ │ ├── ta_FLOOR.c │ │ │ ├── ta_HT_DCPERIOD.c │ │ │ ├── ta_HT_DCPHASE.c │ │ │ ├── ta_HT_PHASOR.c │ │ │ ├── ta_HT_SINE.c │ │ │ ├── ta_HT_TRENDLINE.c │ │ │ ├── ta_HT_TRENDMODE.c │ │ │ ├── ta_KAMA.c │ │ │ ├── ta_LINEARREG.c │ │ │ ├── ta_LINEARREG_ANGLE.c │ │ │ ├── ta_LINEARREG_INTERCEPT.c │ │ │ ├── ta_LINEARREG_SLOPE.c │ │ │ ├── ta_LN.c │ │ │ ├── ta_LOG10.c │ │ │ ├── ta_MA.c │ │ │ ├── ta_MACD.c │ │ │ ├── ta_MACDEXT.c │ │ │ ├── ta_MACDFIX.c │ │ │ ├── ta_MAMA.c │ │ │ ├── ta_MAVP.c │ │ │ ├── ta_MAX.c │ │ │ ├── ta_MAXINDEX.c │ │ │ ├── ta_MEDPRICE.c │ │ │ ├── ta_MFI.c │ │ │ ├── ta_MIDPOINT.c │ │ │ ├── ta_MIDPRICE.c │ │ │ ├── ta_MIN.c │ │ │ ├── ta_MININDEX.c │ │ │ ├── ta_MINMAX.c │ │ │ ├── ta_MINMAXINDEX.c │ │ │ ├── ta_MINUS_DI.c │ │ │ ├── ta_MINUS_DM.c │ │ │ ├── ta_MOM.c │ │ │ ├── ta_MULT.c │ │ │ ├── ta_NATR.c │ │ │ ├── ta_NVI.c │ │ │ ├── ta_OBV.c │ │ │ ├── ta_PLUS_DI.c │ │ │ ├── ta_PLUS_DM.c │ │ │ ├── ta_PPO.c │ │ │ ├── ta_PVI.c │ │ │ ├── ta_ROC.c │ │ │ ├── ta_ROCP.c │ │ │ ├── ta_ROCR.c │ │ │ ├── ta_ROCR100.c │ │ │ ├── ta_RSI.c │ │ │ ├── ta_SAR.c │ │ │ ├── ta_SAREXT.c │ │ │ ├── ta_SIN.c │ │ │ ├── ta_SINH.c │ │ │ ├── ta_SMA.c │ │ │ ├── ta_SQRT.c │ │ │ ├── ta_STDDEV.c │ │ │ ├── ta_STOCH.c │ │ │ ├── ta_STOCHF.c │ │ │ ├── ta_STOCHRSI.c │ │ │ ├── ta_SUB.c │ │ │ ├── ta_SUM.c │ │ │ ├── ta_T3.c │ │ │ ├── ta_TAN.c │ │ │ ├── ta_TANH.c │ │ │ ├── ta_TEMA.c │ │ │ ├── ta_TRANGE.c │ │ │ ├── ta_TRIMA.c │ │ │ ├── ta_TRIX.c │ │ │ ├── ta_TSF.c │ │ │ ├── ta_TYPPRICE.c │ │ │ ├── ta_ULTOSC.c │ │ │ ├── ta_VAR.c │ │ │ ├── ta_WCLPRICE.c │ │ │ ├── ta_WILLR.c │ │ │ ├── ta_WMA.c │ │ │ ├── ta_utility.c │ │ │ └── ta_utility.h │ │ └── tools │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── gen_code │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── gen_code.c │ │ │ ├── java │ │ │ │ ├── Main.java │ │ │ │ └── PrettyCode.java │ │ │ └── mcpp.exe │ │ │ └── ta_regtest │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── ReadMe.txt │ │ │ ├── ta_error_number.h │ │ │ ├── ta_gDataClose.c │ │ │ ├── ta_gDataHigh.c │ │ │ ├── ta_gDataLow.c │ │ │ ├── ta_gDataOpen.c │ │ │ ├── ta_regtest.c │ │ │ ├── ta_test_func.h │ │ │ ├── ta_test_func │ │ │ ├── test_1in_1out.c │ │ │ ├── test_1in_2out.c │ │ │ ├── test_adx.c │ │ │ ├── test_bbands.c │ │ │ ├── test_candlestick.c │ │ │ ├── test_ma.c │ │ │ ├── test_macd.c │ │ │ ├── test_minmax.c │ │ │ ├── test_mom.c │ │ │ ├── test_per_ema.c │ │ │ ├── test_per_hl.c │ │ │ ├── test_per_hlc.c │ │ │ ├── test_per_hlcv.c │ │ │ ├── test_per_ohlc.c │ │ │ ├── test_po.c │ │ │ ├── test_rsi.c │ │ │ ├── test_sar.c │ │ │ ├── test_stddev.c │ │ │ ├── test_stoch.c │ │ │ └── test_trange.c │ │ │ ├── ta_test_priv.h │ │ │ ├── test_abstract.c │ │ │ ├── test_data.c │ │ │ ├── test_internals.c │ │ │ └── test_util.c │ ├── ta-lib-config.in │ ├── ta-lib.dpkg.in │ └── ta-lib.spec.in └── wrapper.h └── ta-lib ├── Cargo.toml ├── README.md └── src ├── lib.rs └── macros.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualritz/ta-lib-rs/62d24c6900887f70edbc139e3a4e565df5ac74ef/.gitmodules -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | 'ta-lib-sys', 4 | 'ta-lib' 5 | ] 6 | resolver = "2" 7 | 8 | [profile.dev] 9 | split-debuginfo = "unpacked" 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `ta-lib` 2 | 3 | Rust wrapper around the Technical Analysis library. 4 | 5 | The autogenerated (`bindgen`) wrapper is in the `ta-lib-sys` folder. The high 6 | level wrapper is in `ta-lib`. 7 | 8 | The `ta-lib` crate only exposes the functions I need myself from the original 9 | TA lib. Which has around 200 of them. Feel free to expose more (easy via the 10 | included macros) and open a PR. 11 | 12 | I sugget using the [`ta`](https://crates.io/crates/ta/) crate instead, which is 13 | a rewrite in Rust of *some* parts of TA but with better ergonomics than this 14 | crate here. 15 | 16 | However, if you quickly need to use an indicator missing from `ta`, this crate 17 | may get you there quickly, as a workaround. 18 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | edition = "2021" 2 | unstable_features = true 3 | use_field_init_shorthand = true 4 | reorder_impl_items = true 5 | wrap_comments = true 6 | format_code_in_doc_comments = true 7 | -------------------------------------------------------------------------------- /ta-lib-sys/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 6 | # More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock 7 | Cargo.lock 8 | 9 | # These are backup files generated by rustfmt 10 | **/*.rs.bk 11 | -------------------------------------------------------------------------------- /ta-lib-sys/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ta-lib-sys" 3 | version = "0.1.2" 4 | edition = "2021" 5 | authors = ["Moritz Moeller "] 6 | description = "Autogenerated Rust wrapper for TA-lib" 7 | keywords = ["ta-lib", "technical-analysis", "indicator", "trading", "financial-market"] 8 | categories = ["api-bindings"] 9 | license = "BSD-3-Clause" 10 | readme = "README.md" 11 | homepage = "https://ta-lib.org/" 12 | repository = "https://github.com/virtualritz/ta-lib-rs/" 13 | documentation = "https://docs.rs/ta-lib-sys/" 14 | 15 | [features] 16 | use_system_lib = [] 17 | 18 | [build-dependencies] 19 | bindgen = "0.63.0" 20 | -------------------------------------------------------------------------------- /ta-lib-sys/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Carl Levasseur 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ta-lib-sys/README.md: -------------------------------------------------------------------------------- 1 | # `ta-lib-sys` 2 | [![Build Status](https://travis-ci.org/virtualritz/ta-lib-rs.svg?branch=master)](https://travis-ci.org/virtualritz/ta-lib-rs) 3 | 4 | The Technical Analysis library includes 200 financial indicators such as ADX, 5 | MACD, RSI, Stochastic, Bollinger Bands, as well as Candlestick pattern 6 | recognition. 7 | 8 | This crate includes the C source code the TA-Lib v0.4.0. This is built from 9 | source and Rust-wrapped by default. Alternatively, the system’s TA-Lib may be 10 | used. See Cargo features below. 11 | 12 | ## Cargo Features 13 | * `use_system_lib` – Use the system's installed C TA lib instead of building 14 | from source. 15 | -------------------------------------------------------------------------------- /ta-lib-sys/build.rs: -------------------------------------------------------------------------------- 1 | use bindgen::{ 2 | callbacks::{EnumVariantValue, ParseCallbacks}, 3 | Builder, 4 | }; 5 | use std::{env, path::PathBuf, process::Command}; 6 | 7 | #[derive(Debug)] 8 | struct CleanTaNamingCallbacks {} 9 | 10 | impl ParseCallbacks for CleanTaNamingCallbacks { 11 | fn item_name(&self, original_item_name: &str) -> Option { 12 | if original_item_name.starts_with("TA_") { 13 | Some(original_item_name.trim_start_matches("TA_").to_string()) 14 | } else { 15 | None 16 | } 17 | } 18 | 19 | fn enum_variant_name( 20 | &self, 21 | enum_name: Option<&str>, 22 | original_variant_name: &str, 23 | _variant_value: EnumVariantValue, 24 | ) -> Option { 25 | if enum_name.is_some() { 26 | Some(original_variant_name.trim_start_matches("TA_").to_string()) 27 | } else { 28 | None 29 | } 30 | } 31 | } 32 | 33 | const TA_LIB_PATH: &str = "ta-lib-0.4.0"; 34 | 35 | fn main() { 36 | let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); 37 | 38 | println!("cargo:rustc-link-lib=static=ta_lib"); 39 | 40 | if !cfg!(feature = "use_system_lib") { 41 | println!( 42 | "cargo:rustc-link-search=native={}", 43 | out_path.join("lib").display() 44 | ); 45 | 46 | /* 47 | let ta_lib = autotools::Config::new(TA_LIB_PATH) 48 | .enable_static() 49 | .insource(true) 50 | .build(); 51 | 52 | // Simply link the library without using pkg-config 53 | println!("cargo:rustc-link-search=native={}", ta_lib.display()); 54 | println!("cargo:rustc-link-lib=static=ta-lib"); 55 | 56 | eprintln!("{}", ta_lib.display()); 57 | */ 58 | 59 | Command::new("./configure") 60 | .current_dir(TA_LIB_PATH) 61 | .arg(format!("--prefix={}", out_path.display())) 62 | .output() 63 | .expect("Failed to execute TA C library configure script."); 64 | 65 | Command::new("make") 66 | .current_dir(TA_LIB_PATH) 67 | .arg("install") 68 | .output() 69 | .expect("Failed to build TA C library."); 70 | } 71 | 72 | let bindings = Builder::default() 73 | .header("wrapper.h") 74 | .clang_arg(format!("-I{}", out_path.join("include").display())) 75 | .allowlist_function("TA_.*") 76 | .allowlist_type("TA_.*") 77 | .allowlist_var("TA_.*") 78 | .rustified_enum("TA_.*") 79 | .prepend_enum_name(false) 80 | .parse_callbacks(Box::new(bindgen::CargoCallbacks)) 81 | .parse_callbacks(Box::new(CleanTaNamingCallbacks {})) 82 | .generate() 83 | .expect("Unable to generate bindings."); 84 | 85 | bindings 86 | .write_to_file(out_path.join("bindings.rs")) 87 | .expect("Could not write bindings."); 88 | } 89 | -------------------------------------------------------------------------------- /ta-lib-sys/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(non_upper_case_globals)] 2 | #![allow(non_camel_case_types)] 3 | #![allow(non_snake_case)] 4 | //! The Technical Analysis library includes 200 financial indicators such as 5 | //! ADX, MACD, RSI, Stochastic, Bollinger Bands, as well as Candlestick pattern 6 | //! recognition. 7 | //! 8 | //! This crate includes the C source code the TA-Lib v0.4.0. This is built 9 | //! from source and Rust-wrapped by default. Alternatively, the system’s TA-Lib 10 | //! may be used. See *Cargo Features* below. 11 | //! 12 | //! ## Cargo Features 13 | //! 14 | //! * `use_system_lib` – Use the system's installed C TA lib instead of building 15 | //! from source. 16 | 17 | include!(concat!(env!("OUT_DIR"), "/bindings.rs")); 18 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/CHANGELOG.TXT: -------------------------------------------------------------------------------- 1 | Version 0.4 (September 2007) 2 | 3 | New Features 4 | ============ 5 | - Java TA-Abstract interface 6 | - Moving Average with Variable Periods (MAVP) 7 | - UpperLimit/LowerLimit flags for BBANDS. 8 | - Vector Trigonometric Functions: COS, SIN, TAN, 9 | COSH, SINH, TANH, ACOS, ASIN, ATAN 10 | - Vector Arithmetic Functions: ADD, DIV, SUB, MULT 11 | - Other Vector Functions: CEIL, FLOOR, EXP, SQRT, LN, LOG10 12 | 13 | Fixes 14 | ===== 15 | #1656623 : TA_FUNC_FLG_OVERLAP on MININDEX, MAXINDEX and MINMAXINDEX 16 | #1660327 : "A parameter is out of range" problem with Excel 17 | #1727704 : MFI logic bug when no price movement 18 | 19 | Other Changes 20 | ============= 21 | - Comment clean-up for parameter ranges of internal functions. 22 | - Mac OS X : xcode and makefiles fixes. 23 | - Linux: Better Perl library detection 24 | - Solve warnings for Intel C++ compiler. 25 | - Automatic benchmarking by ta_regtest (WIN32 only). 26 | 27 | Thanks to all contributors. 28 | 29 | See HISTORY.TXT for summary of previous versions. 30 | 31 | Info: http://ta-lib.org 32 | 33 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/HISTORY.TXT: -------------------------------------------------------------------------------- 1 | V0.4 (September 2007) 2 | - Java TA-Abstract interface. 3 | - MAVP, COS, SIN, TAN, COSH, SINH, TANH, ACOS, ASIN, ATAN. 4 | - ADD, DIV, SUB, MULT, CEIL, FLOOR, EXP, SQRT, LN, LOG10. 5 | - UpperLimit/LowerLimit flags for BBANDS. 6 | - Automatic benchmarking by ta_regtest (WIN32 only). 7 | - Fix #1656623,1660327,1727704 8 | 9 | V0.3 (January 2007) 10 | - New .NET and Java naming convention. 11 | - XML interface description (See TA_FunctionDescription). 12 | - Volume amd open interest now of double type. 13 | - Add: BETA, MINMAX, MINMAXINDEX, MININDEX, MAXINDEX. 14 | - New RPM, Debian, JAR and unmanaged library with VS2005. 15 | - Fix #1526632,1544555 16 | 17 | V0.2 (June 2006) 18 | - Many bug fix for Java. 19 | - New ULTOSC and NATR functions. 20 | - Major clean-up. Removal of TA-PM and TA-Data. 21 | - Fix #1434450 22 | 23 | V0.1.5 (January 2006) 24 | - Java ports of all TA functions. 25 | - New BOP, CMO and Hikkake functions. 26 | - .NET assembly now verifiable. 27 | - Support for end-of-period. 28 | - Portable random generator. 29 | - Fix #1117656,1117866,1199526,1200995,1229243,1238365,1241498 30 | - Fix #1293953,1359452,1365319,1367155,1367269 31 | 32 | V0.1.4 (April 2005) 33 | - 64 bits support. 34 | - Partial Python support. 35 | - New TA_DISABLE_PRICE_VALIDATION flag. 36 | - 26 new candlestick functions. 37 | - Fix #1117866,1117656 38 | 39 | V0.1.3 (January 2005) 40 | - 12 new candlestick functions. 41 | - Excel now handles default values. 42 | - Add Visual Studio 2005 support. 43 | - Fix #1090231,1089506,1072276,1023151 44 | 45 | V0.1.2 (November 2004) 46 | - New: Perl interface, candlestick functions. 47 | - New: price bar validation and intraday conversion. 48 | - Add TA_YAHOO_ONE_SYMBOL, CSI and CSIM data source. 49 | - Add MacOS X and FreeBSD support. 50 | - Fix #927808,917085,888470,881950,873879,960230,965557,978056 51 | - Fix #1039601,1042729 52 | 53 | V0.1.1 (January 2004) 54 | - New SQL/ODBC and MySQL data source. 55 | - Add: TA_CORREL, TA_STOCHRSI, TA_SAREXT 56 | - Add split/dividend adjustment for Yahoo! 57 | - Add CygWin support 58 | 59 | V0.1.0 (September 2003) 60 | - New .NET/Mono interface (Core namespace) 61 | - TA functions now accept single precision inputs. 62 | - Add: TSF, LINEARREG, LINEARREG_INTERCEPT 63 | - Add: LINEARREG_ANGLE, LINEARREG_SLOPE 64 | - Now do intra-day conversion to daily, weekly etc... 65 | - Add TA-PM trade-by-trade report. 66 | - Fix #724662,731857,736095,736196,748163,767653,792298 67 | 68 | V0.0.8 (April 2003) 69 | - Add: AD,ADOSC,AROON,AROONOSC,KAMA,T3,HT_TRENDLINE,MAMA 70 | - Add: HT_DCPHASE,HT_PHASOR,HT_SINE,HT_TRENDMODE,HT_DCPERIOD 71 | - Fix #701060 72 | 73 | V0.0.7 (January 2003) 74 | - Excel Add-In implemented. 75 | - Add: MFI,MIDPRICE,MIDPOINT,TRIMA,MACDEXT,ROCP,STOCHF,AVGPRICE 76 | - Fix #660248,660250,660449,644512 77 | 78 | V0.0.6 (October 2002) 79 | - Add Functions: SAR,ADX,ADXR,DX,+DI,-DI,+DM,-DM 80 | - Add many european Yahoo! data source. 81 | - Fix#609753 for Yahoo! data source. 82 | - STDDEV,VAR,BBANDS speed optimization 83 | 84 | V0.0.5 (June 2002) 85 | - Add: OBV + performance measurement infrastructure. 86 | - Fix #537806 + some Yahoo! data source fix. 87 | 88 | V0.0.4 (March 2002) 89 | - Add: TEMA, DEMA, TRIX 90 | - Interface changes to all the TA functions: 91 | 1) nbInputElement has been removed. 92 | 2) startIdx and endIdx cannot be -1 anymore. 93 | 3) only one outBegIdx and outNbElement output per function. 94 | - A "Lookback" function is now provided for each TA function. 95 | - Improve ta_regtest + Make better HTML parsing in gen_rdata. 96 | 97 | V0.0.3 (December 2001) 98 | - Port to Linux/g++ completed. 99 | - Add: BBANDS,WMA,MOM,ROC,ROCR,STDDEV,VAR,STOCH 100 | - Add TA_SetUnstablePeriod. 101 | - Code and MSVC project clean-up. 102 | 103 | V0.0.2 (October 2001) 104 | - Add: EMA,SMA,APO,MACD,PPO,RSI,ATR,TRANGE,WCLPRICE 105 | - Add: MEDPRICE,TYPPRICE 106 | - Add compatibility flag + some Win32 binaries. 107 | - Add support for US/CAN indices to the Yahoo! data source. 108 | 109 | V0.0.1 (September 2001) 110 | - Alpha Release on Windows. 111 | - Include ta_yahoo.exe demo application. 112 | 113 | Info: http://ta-lib.org 114 | Forum: http://tadoc.org/forum 115 | 116 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = foreign 1.4 2 | SUBDIRS = src src/tools 3 | bin_SCRIPTS = ta-lib-config 4 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo aclocal 3 | aclocal || exit 4 | echo autoheader 5 | autoheader || exit 6 | echo libtoolize --copy --force 7 | libtoolize --copy --force || exit 8 | echo automake -a -c 9 | automake -a -c || exit 10 | echo autoconf 11 | autoconf || exit 12 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/configure.in: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | AC_PREREQ(2.59) 5 | AC_COPYRIGHT([(c) TicTacTec 2005, 2006]) 6 | AC_INIT([ta-lib], [0.4.0], [http://sourceforge.net/tracker/?group_id=8903&atid=108903]) 7 | AC_CONFIG_SRCDIR([src/ta_func/ta_AD.c]) 8 | AC_CONFIG_HEADER([include/ta_config.h]) 9 | AM_INIT_AUTOMAKE([ta-lib], [0.4.0]) 10 | 11 | # Checks for programs. 12 | AC_PROG_CC 13 | AC_PROG_LIBTOOL 14 | 15 | # Checks for libraries. 16 | AC_CHECK_LIB([dl], [dlopen]) 17 | AC_CHECK_LIB([pthread], [pthread_create]) 18 | 19 | # Checks for header files. 20 | AC_HEADER_STDC 21 | AC_CHECK_HEADERS([float.h inttypes.h limits.h locale.h stddef.h stdint.h stdlib.h string.h unistd.h wchar.h wctype.h]) 22 | 23 | # Checks for typedefs, structures, and compiler characteristics. 24 | AC_C_CONST 25 | AC_TYPE_SIZE_T 26 | AC_STRUCT_TM 27 | AC_C_VOLATILE 28 | AC_CHECK_TYPES([ptrdiff_t]) 29 | 30 | # Checks for library functions. 31 | AC_TYPE_SIGNAL 32 | AC_FUNC_STRCOLL 33 | AC_FUNC_STRFTIME 34 | AC_FUNC_STRTOD 35 | AC_FUNC_VPRINTF 36 | AC_CHECK_FUNCS([floor isascii localeconv mblen memmove memset modf pow sqrt strcasecmp strchr strerror strncasecmp strrchr strstr strtol strtoul]) 37 | 38 | # Versioning: 39 | # Only change this if library is no longer 40 | # ABI compatible with previous version 41 | # (e.g. function declaration changed) 42 | TALIB_LIBRARY_VERSION=0:0:0 43 | 44 | AC_SUBST(TALIB_LIBRARY_VERSION) 45 | 46 | AC_CONFIG_FILES([Makefile src/Makefile src/ta_abstract/Makefile src/ta_common/Makefile src/ta_func/Makefile src/tools/Makefile src/tools/gen_code/Makefile src/tools/ta_regtest/Makefile ta-lib-config ta-lib.spec ta-lib.dpkg]) 47 | AC_OUTPUT 48 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/include/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | bin_PRORAMS = libta_include 3 | 4 | libta_includedir=$(includedir)/ta-lib/ 5 | 6 | libta_include_HEADERS = ta_abstract.h 7 | ta_defs.h \ 8 | ta_libc.h \ 9 | ta_common.h \ 10 | ta_func.h \ 11 | func_list.txt 12 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/include/ta_common.h: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | #ifndef TA_COMMON_H 34 | #define TA_COMMON_H 35 | 36 | /* The following macros are used to return internal errors. 37 | * The Id can be from 1 to 999 and translate to the user 38 | * as the return code 5000 to 5999. 39 | * 40 | * Everytime you wish to add a new fatal error code, 41 | * use the "NEXT AVAILABLE NUMBER" and increment the 42 | * number in this file. 43 | * 44 | * NEXT AVAILABLE NUMBER: 181 45 | */ 46 | #define TA_INTERNAL_ERROR(Id) ((TA_RetCode)(TA_INTERNAL_ERROR+Id)) 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | #include 53 | #include 54 | #include 55 | 56 | #ifndef TA_DEFS_H 57 | #include "ta_defs.h" 58 | #endif 59 | 60 | /* Some functions to get the version of TA-Lib. 61 | * 62 | * Format is "Major.Minor.Patch (Month Day Year Hour:Min:Sec)" 63 | * 64 | * Example: "1.2.0 (Jan 17 2004 23:59:59)" 65 | * 66 | * Major increments indicates an "Highly Recommended" update. 67 | * 68 | * Minor increments indicates arbitrary milestones in the 69 | * development of the next major version. 70 | * 71 | * Patch are fixes to a "Major.Minor" release. 72 | */ 73 | const char *TA_GetVersionString( void ); 74 | 75 | /* Get individual component of the Version string */ 76 | const char *TA_GetVersionMajor ( void ); 77 | const char *TA_GetVersionMinor ( void ); 78 | const char *TA_GetVersionBuild ( void ); 79 | const char *TA_GetVersionDate ( void ); 80 | const char *TA_GetVersionTime ( void ); 81 | 82 | /* Misc. declaration used throughout the library code. */ 83 | typedef double TA_Real; 84 | typedef int TA_Integer; 85 | 86 | /* General purpose structure containing an array of string. 87 | * 88 | * Example of usage: 89 | * void printStringTable( TA_StringTable *table ) 90 | * { 91 | * int i; 92 | * for( i=0; i < table->size; i++ ) 93 | * cout << table->string[i] << endl; 94 | * } 95 | * 96 | */ 97 | typedef struct TA_StringTable 98 | { 99 | unsigned int size; /* Number of string. */ 100 | const char **string; /* Pointer to the strings. */ 101 | 102 | /* Hidden data for internal use by TA-Lib. Do not modify. */ 103 | void *hiddenData; 104 | } TA_StringTable; 105 | /* End-user can get additional information related to a TA_RetCode. 106 | * 107 | * Example: 108 | * TA_RetCodeInfo info; 109 | * 110 | * retCode = TA_Initialize( ... ); 111 | * 112 | * if( retCode != TA_SUCCESS ) 113 | * { 114 | * TA_SetRetCodeInfo( retCode, &info ); 115 | * printf( "Error %d(%s): %s\n", 116 | * retCode, 117 | * info.enumStr, 118 | * info.infoStr ); 119 | * } 120 | * 121 | * Would display: 122 | * "Error 1(TA_LIB_NOT_INITIALIZE): TA_Initialize was not sucessfully called" 123 | */ 124 | typedef struct TA_RetCodeInfo 125 | { 126 | const char *enumStr; /* Like "TA_IP_SOCKETERROR" */ 127 | const char *infoStr; /* Like "Error creating socket" */ 128 | } TA_RetCodeInfo; 129 | 130 | /* Info is always returned, even when 'theRetCode' is invalid. */ 131 | void TA_SetRetCodeInfo( TA_RetCode theRetCode, TA_RetCodeInfo *retCodeInfo ); 132 | 133 | /* TA_Initialize() initialize the ressources used by TA-Lib. This 134 | * function must be called once prior to any other functions declared in 135 | * this file. 136 | * 137 | * TA_Shutdown() allows to free all ressources used by TA-Lib. Following 138 | * a shutdown, TA_Initialize() must be called again for re-using TA-Lib. 139 | * 140 | * TA_Shutdown() should be called prior to exiting the application code. 141 | */ 142 | TA_RetCode TA_Initialize( void ); 143 | TA_RetCode TA_Shutdown( void ); 144 | 145 | #ifdef __cplusplus 146 | } 147 | #endif 148 | 149 | #endif 150 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/include/ta_config.h.in: -------------------------------------------------------------------------------- 1 | /* include/ta_config.h.in. Generated from configure.in by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ 7 | #undef HAVE_DOPRNT 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_FLOAT_H 11 | 12 | /* Define to 1 if you have the `floor' function. */ 13 | #undef HAVE_FLOOR 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_INTTYPES_H 17 | 18 | /* Define to 1 if you have the `isascii' function. */ 19 | #undef HAVE_ISASCII 20 | 21 | /* Define to 1 if you have the `dl' library (-ldl). */ 22 | #undef HAVE_LIBDL 23 | 24 | /* Define to 1 if you have the `pthread' library (-lpthread). */ 25 | #undef HAVE_LIBPTHREAD 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_LIMITS_H 29 | 30 | /* Define to 1 if you have the `localeconv' function. */ 31 | #undef HAVE_LOCALECONV 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_LOCALE_H 35 | 36 | /* Define to 1 if you have the `mblen' function. */ 37 | #undef HAVE_MBLEN 38 | 39 | /* Define to 1 if you have the `memmove' function. */ 40 | #undef HAVE_MEMMOVE 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_MEMORY_H 44 | 45 | /* Define to 1 if you have the `memset' function. */ 46 | #undef HAVE_MEMSET 47 | 48 | /* Define to 1 if you have the `modf' function. */ 49 | #undef HAVE_MODF 50 | 51 | /* Define to 1 if you have the `pow' function. */ 52 | #undef HAVE_POW 53 | 54 | /* Define to 1 if the system has the type `ptrdiff_t'. */ 55 | #undef HAVE_PTRDIFF_T 56 | 57 | /* Define to 1 if you have the `sqrt' function. */ 58 | #undef HAVE_SQRT 59 | 60 | /* Define to 1 if you have the header file. */ 61 | #undef HAVE_STDDEF_H 62 | 63 | /* Define to 1 if you have the header file. */ 64 | #undef HAVE_STDINT_H 65 | 66 | /* Define to 1 if you have the header file. */ 67 | #undef HAVE_STDLIB_H 68 | 69 | /* Define to 1 if you have the `strcasecmp' function. */ 70 | #undef HAVE_STRCASECMP 71 | 72 | /* Define to 1 if you have the `strchr' function. */ 73 | #undef HAVE_STRCHR 74 | 75 | /* Define to 1 if you have the `strcoll' function and it is properly defined. 76 | */ 77 | #undef HAVE_STRCOLL 78 | 79 | /* Define to 1 if you have the `strerror' function. */ 80 | #undef HAVE_STRERROR 81 | 82 | /* Define to 1 if you have the `strftime' function. */ 83 | #undef HAVE_STRFTIME 84 | 85 | /* Define to 1 if you have the header file. */ 86 | #undef HAVE_STRINGS_H 87 | 88 | /* Define to 1 if you have the header file. */ 89 | #undef HAVE_STRING_H 90 | 91 | /* Define to 1 if you have the `strncasecmp' function. */ 92 | #undef HAVE_STRNCASECMP 93 | 94 | /* Define to 1 if you have the `strrchr' function. */ 95 | #undef HAVE_STRRCHR 96 | 97 | /* Define to 1 if you have the `strstr' function. */ 98 | #undef HAVE_STRSTR 99 | 100 | /* Define to 1 if you have the `strtol' function. */ 101 | #undef HAVE_STRTOL 102 | 103 | /* Define to 1 if you have the `strtoul' function. */ 104 | #undef HAVE_STRTOUL 105 | 106 | /* Define to 1 if you have the header file. */ 107 | #undef HAVE_SYS_STAT_H 108 | 109 | /* Define to 1 if you have the header file. */ 110 | #undef HAVE_SYS_TYPES_H 111 | 112 | /* Define to 1 if you have the header file. */ 113 | #undef HAVE_UNISTD_H 114 | 115 | /* Define to 1 if you have the `vprintf' function. */ 116 | #undef HAVE_VPRINTF 117 | 118 | /* Define to 1 if you have the header file. */ 119 | #undef HAVE_WCHAR_H 120 | 121 | /* Define to 1 if you have the header file. */ 122 | #undef HAVE_WCTYPE_H 123 | 124 | /* Name of package */ 125 | #undef PACKAGE 126 | 127 | /* Define to the address where bug reports for this package should be sent. */ 128 | #undef PACKAGE_BUGREPORT 129 | 130 | /* Define to the full name of this package. */ 131 | #undef PACKAGE_NAME 132 | 133 | /* Define to the full name and version of this package. */ 134 | #undef PACKAGE_STRING 135 | 136 | /* Define to the one symbol short name of this package. */ 137 | #undef PACKAGE_TARNAME 138 | 139 | /* Define to the version of this package. */ 140 | #undef PACKAGE_VERSION 141 | 142 | /* Define as the return type of signal handlers (`int' or `void'). */ 143 | #undef RETSIGTYPE 144 | 145 | /* Define to 1 if you have the ANSI C header files. */ 146 | #undef STDC_HEADERS 147 | 148 | /* Define to 1 if your declares `struct tm'. */ 149 | #undef TM_IN_SYS_TIME 150 | 151 | /* Version number of package */ 152 | #undef VERSION 153 | 154 | /* Define to empty if `const' does not conform to ANSI C. */ 155 | #undef const 156 | 157 | /* Define to `unsigned int' if does not define. */ 158 | #undef size_t 159 | 160 | /* Define to empty if the keyword `volatile' does not work. Warning: valid 161 | code using `volatile' can become incorrect without. Disable with care. */ 162 | #undef volatile 163 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/include/ta_libc.h: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | #ifndef TA_LIBC_H 34 | #define TA_LIBC_H 35 | 36 | /* Includes all headers needed for using the ta-lib 'C' library. */ 37 | 38 | #ifndef TA_COMMON_H 39 | #include "ta_common.h" 40 | #endif 41 | 42 | #ifndef TA_FUNC_H 43 | #include "ta_func.h" 44 | #endif 45 | 46 | #ifndef TA_ABSTRACT_H 47 | #include "ta_abstract.h" 48 | #endif 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = foreign 1.4 2 | SUBDIRS = ta_abstract ta_common ta_func 3 | 4 | lib_LTLIBRARIES = libta_lib.la 5 | 6 | libta_lib_la_SOURCES = 7 | 8 | libta_lib_la_LIBADD = \ 9 | ta_abstract/libta_abstract.la \ 10 | ta_func/libta_func.la \ 11 | ta_common/libta_common.la 12 | 13 | libta_lib_la_LDFLAGS = -version-info $(TALIB_LIBRARY_VERSION) 14 | 15 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | noinst_LTLIBRARIES = libta_abstract.la libta_abstract_gc.la 3 | 4 | libta_abstract_la_SOURCES = ta_group_idx.c \ 5 | ta_def_ui.c \ 6 | ta_abstract.c \ 7 | ta_func_api.c \ 8 | frames/ta_frame.c \ 9 | tables/table_a.c \ 10 | tables/table_b.c \ 11 | tables/table_c.c \ 12 | tables/table_d.c \ 13 | tables/table_e.c \ 14 | tables/table_f.c \ 15 | tables/table_g.c \ 16 | tables/table_h.c \ 17 | tables/table_i.c \ 18 | tables/table_j.c \ 19 | tables/table_k.c \ 20 | tables/table_l.c \ 21 | tables/table_m.c \ 22 | tables/table_n.c \ 23 | tables/table_o.c \ 24 | tables/table_p.c \ 25 | tables/table_q.c \ 26 | tables/table_r.c \ 27 | tables/table_s.c \ 28 | tables/table_t.c \ 29 | tables/table_u.c \ 30 | tables/table_v.c \ 31 | tables/table_w.c \ 32 | tables/table_x.c \ 33 | tables/table_y.c \ 34 | tables/table_z.c 35 | 36 | libta_abstract_gc_la_SOURCES = $(libta_abstract_la_SOURCES) 37 | 38 | libta_abstract_la_LDFLAGS = -version-info $(TALIB_LIBRARY_VERSION) 39 | libta_abstract_gc_la_LDFLAGS = $(libta_abstract_la_LDFLAGS) 40 | 41 | libta_abstract_la_CPPFLAGS = -I../ta_common/ -Iframes/ 42 | 43 | # The 'gc' version is a minimal version used to just to compile gen_code 44 | libta_abstract_gc_la_CPPFLAGS = -DTA_GEN_CODE $(libta_abstract_la_CPPFLAGS) 45 | 46 | libta_abstractdir=$(includedir)/ta-lib/ 47 | libta_abstract_HEADERS = ../../include/ta_defs.h \ 48 | ../../include/ta_libc.h \ 49 | ../../include/ta_abstract.h 50 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/ta_frame_priv.h: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | 35 | /* TA_ParamHolderPriv is the private implementation of a TA_ParamHolder. */ 36 | 37 | /* Definition in this header shall be used only internaly by the 38 | * ta_abstract module. 39 | * End-user of the TA-LIB shall never attempt to access these 40 | * structure directly. 41 | */ 42 | 43 | #ifndef TA_FRAME_PRIV_H 44 | #define TA_FRAME_PRIV_H 45 | 46 | #ifndef TA_ABSTRACT_H 47 | #include "ta_abstract.h" 48 | #endif 49 | 50 | #ifndef TA_MAGIC_NB_H 51 | #include "ta_magic_nb.h" 52 | #endif 53 | 54 | typedef struct 55 | { 56 | const TA_Real *open; 57 | const TA_Real *high; 58 | const TA_Real *low; 59 | const TA_Real *close; 60 | const TA_Real *volume; 61 | const TA_Real *openInterest; 62 | } TA_PricePtrs; 63 | 64 | typedef struct 65 | { 66 | union TA_ParamHolderInputData 67 | { 68 | const TA_Real *inReal; 69 | const TA_Integer *inInteger; 70 | TA_PricePtrs inPrice; 71 | } data; 72 | 73 | const TA_InputParameterInfo *inputInfo; 74 | 75 | } TA_ParamHolderInput; 76 | 77 | typedef struct 78 | { 79 | union TA_ParamHolderOptInData 80 | { 81 | TA_Integer optInInteger; 82 | TA_Real optInReal; 83 | } data; 84 | 85 | const TA_OptInputParameterInfo *optInputInfo; 86 | 87 | } TA_ParamHolderOptInput; 88 | 89 | typedef struct 90 | { 91 | union TA_ParamHolderOutputData 92 | { 93 | TA_Real *outReal; 94 | TA_Integer *outInteger; 95 | } data; 96 | 97 | const TA_OutputParameterInfo *outputInfo; 98 | } TA_ParamHolderOutput; 99 | 100 | typedef struct 101 | { 102 | /* Magic number is used to detect internal error. */ 103 | unsigned int magicNumber; 104 | 105 | TA_ParamHolderInput *in; 106 | TA_ParamHolderOptInput *optIn; 107 | TA_ParamHolderOutput *out; 108 | 109 | /* Indicate which parameter have been initialized. 110 | * The LSB (Less Significant Bit) is the first parameter 111 | * and a bit equal to '1' indicate that the parameter is 112 | * not initialized. 113 | */ 114 | unsigned int inBitmap; 115 | unsigned int outBitmap; 116 | 117 | const TA_FuncInfo *funcInfo; 118 | } TA_ParamHolderPriv; 119 | 120 | typedef TA_RetCode (*TA_FrameFunction)( const TA_ParamHolderPriv *params, 121 | TA_Integer startIdx, 122 | TA_Integer endIdx, 123 | TA_Integer *outBegIdx, 124 | TA_Integer *outNbElement ); 125 | 126 | typedef unsigned int (*TA_FrameLookback)( const TA_ParamHolderPriv *params ); 127 | 128 | #endif 129 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_b.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'B' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | 46 | /**************************************************************************** 47 | * Step 1 - Define here the interface to your TA functions with 48 | * the macro DEF_FUNCTION. 49 | * 50 | ****************************************************************************/ 51 | 52 | /* BBANDS BEGIN */ 53 | 54 | /* Nb Deviation up/down is used for bollinger bands. */ 55 | const TA_OptInputParameterInfo TA_DEF_UI_NbDeviationUp = 56 | { 57 | TA_OptInput_RealRange, /* type */ 58 | "optInNbDevUp", /* paramName */ 59 | 0, /* flags */ 60 | 61 | "Deviations up", /* displayName */ 62 | (const void *)&TA_DEF_NbDeviation, /* dataSet */ 63 | 2.0, /* defaultValue */ 64 | "Deviation multiplier for upper band", /* hint */ 65 | 66 | NULL /* CamelCase name */ 67 | }; 68 | 69 | const TA_OptInputParameterInfo TA_DEF_UI_NbDeviationDn = 70 | { 71 | TA_OptInput_RealRange, /* type */ 72 | "optInNbDevDn", /* paramName */ 73 | 0, /* flags */ 74 | 75 | "Deviations down", /* displayName */ 76 | (const void *)&TA_DEF_NbDeviation, /* dataSet */ 77 | 2.0, /* defaultValue */ 78 | "Deviation multiplier for lower band", /* hint */ 79 | 80 | NULL /* CamelCase name */ 81 | }; 82 | 83 | const TA_OutputParameterInfo TA_DEF_UI_Output_Real_BBANDS_Middle = 84 | { TA_Output_Real, "outRealMiddleBand", TA_OUT_LINE }; 85 | 86 | const TA_OutputParameterInfo TA_DEF_UI_Output_Real_BBANDS_Upper = 87 | { TA_Output_Real, "outRealUpperBand", TA_OUT_UPPER_LIMIT }; 88 | 89 | const TA_OutputParameterInfo TA_DEF_UI_Output_Real_BBANDS_Lower = 90 | { TA_Output_Real, "outRealLowerBand", TA_OUT_LOWER_LIMIT }; 91 | 92 | static const TA_InputParameterInfo *TA_BBANDS_Inputs[] = 93 | { 94 | &TA_DEF_UI_Input_Real, 95 | NULL 96 | }; 97 | 98 | static const TA_OutputParameterInfo *TA_BBANDS_Outputs[] = 99 | { 100 | &TA_DEF_UI_Output_Real_BBANDS_Upper, 101 | &TA_DEF_UI_Output_Real_BBANDS_Middle, 102 | &TA_DEF_UI_Output_Real_BBANDS_Lower, 103 | NULL 104 | }; 105 | 106 | static const TA_OptInputParameterInfo *TA_BBANDS_OptInputs[] = 107 | { &TA_DEF_UI_TimePeriod_5_MINIMUM2, 108 | &TA_DEF_UI_NbDeviationUp, 109 | &TA_DEF_UI_NbDeviationDn, 110 | &TA_DEF_UI_MA_Method, 111 | NULL 112 | }; 113 | 114 | DEF_FUNCTION( BBANDS, /* name */ 115 | TA_GroupId_OverlapStudies, /* groupId */ 116 | "Bollinger Bands", /* hint */ 117 | "Bbands", /* CamelCase name */ 118 | TA_FUNC_FLG_OVERLAP /* flags */ 119 | ); 120 | /* BBANDS END */ 121 | 122 | 123 | /* BOP BEGIN */ 124 | static const TA_InputParameterInfo *TA_BOP_Inputs[] = 125 | { 126 | &TA_DEF_UI_Input_Price_OHLC, 127 | NULL 128 | }; 129 | 130 | static const TA_OutputParameterInfo *TA_BOP_Outputs[] = 131 | { 132 | &TA_DEF_UI_Output_Real, 133 | NULL 134 | }; 135 | 136 | static const TA_OptInputParameterInfo *TA_BOP_OptInputs[] = { NULL }; 137 | 138 | DEF_FUNCTION( BOP, /* name */ 139 | TA_GroupId_MomentumIndicators, /* groupId */ 140 | "Balance Of Power", /* hint */ 141 | "Bop", /* CamelCase name */ 142 | 0 /* flags */ 143 | ); 144 | /* BOP END */ 145 | 146 | /* BETA BEGIN */ 147 | static const TA_InputParameterInfo *TA_BETA_Inputs[] = 148 | { 149 | &TA_DEF_UI_Input_Real0, 150 | &TA_DEF_UI_Input_Real1, 151 | NULL 152 | }; 153 | 154 | static const TA_OutputParameterInfo *TA_BETA_Outputs[] = 155 | { 156 | &TA_DEF_UI_Output_Real, 157 | NULL 158 | }; 159 | 160 | static const TA_OptInputParameterInfo *TA_BETA_OptInputs[] = 161 | { 162 | &TA_DEF_UI_TimePeriod_5, 163 | NULL 164 | }; 165 | 166 | DEF_FUNCTION( BETA, /* name */ 167 | TA_GroupId_Statistic, /* groupId */ 168 | "Beta", /* hint */ 169 | "Beta", /* CamelCase name */ 170 | 0 /* flags */ 171 | ); 172 | /* BETA END */ 173 | 174 | /**************************************************************************** 175 | * Step 2 - Add your TA function to the table. 176 | * Keep in alphabetical order. Must be NULL terminated. 177 | ****************************************************************************/ 178 | const TA_FuncDef *TA_DEF_TableB[] = 179 | { 180 | ADD_TO_TABLE(BBANDS), 181 | ADD_TO_TABLE(BETA), 182 | ADD_TO_TABLE(BOP), 183 | NULL 184 | }; 185 | 186 | 187 | /* Do not modify the following line. */ 188 | const unsigned int TA_DEF_TableBSize = 189 | ((sizeof(TA_DEF_TableB)/sizeof(TA_FuncDef *))-1); 190 | 191 | 192 | /**************************************************************************** 193 | * Step 3 - Make sure "gen_code" is executed for generating all other 194 | * source files derived from this one. 195 | * You can then re-compile the library as usual and you are done! 196 | ****************************************************************************/ 197 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_d.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'D' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* DEMA BEGIN */ 52 | static const TA_InputParameterInfo *TA_DEMA_Inputs[] = 53 | { 54 | &TA_DEF_UI_Input_Real, 55 | NULL 56 | }; 57 | 58 | static const TA_OutputParameterInfo *TA_DEMA_Outputs[] = 59 | { 60 | &TA_DEF_UI_Output_Real, 61 | NULL 62 | }; 63 | 64 | static const TA_OptInputParameterInfo *TA_DEMA_OptInputs[] = 65 | { &TA_DEF_UI_TimePeriod_30_MINIMUM2, 66 | NULL 67 | }; 68 | 69 | DEF_FUNCTION( DEMA, /* name */ 70 | TA_GroupId_OverlapStudies, /* groupId */ 71 | "Double Exponential Moving Average", /* hint */ 72 | "Dema", /* CamelCase name */ 73 | TA_FUNC_FLG_OVERLAP /* flags */ 74 | ); 75 | /* DEMA END */ 76 | 77 | /* DIV BEGIN */ 78 | DEF_MATH_BINARY_OPERATOR( DIV, "Vector Arithmetic Div", "Div" ) 79 | /* DIV END */ 80 | 81 | /* DX BEGIN */ 82 | static const TA_InputParameterInfo *TA_DX_Inputs[] = 83 | { 84 | &TA_DEF_UI_Input_Price_HLC, 85 | NULL 86 | }; 87 | 88 | static const TA_OutputParameterInfo *TA_DX_Outputs[] = 89 | { 90 | &TA_DEF_UI_Output_Real, 91 | NULL 92 | }; 93 | 94 | static const TA_OptInputParameterInfo *TA_DX_OptInputs[] = 95 | { &TA_DEF_UI_TimePeriod_14_MINIMUM2, 96 | NULL 97 | }; 98 | 99 | DEF_FUNCTION( DX, /* name */ 100 | TA_GroupId_MomentumIndicators, /* groupId */ 101 | "Directional Movement Index", /* hint */ 102 | "Dx", /* CamelCase name */ 103 | TA_FUNC_FLG_UNST_PER /* flags */ 104 | ); 105 | /* DX END */ 106 | 107 | /**************************************************************************** 108 | * Step 2 - Add your TA function to the table. 109 | * Keep in alphabetical order. Must be NULL terminated. 110 | ****************************************************************************/ 111 | const TA_FuncDef *TA_DEF_TableD[] = 112 | { 113 | ADD_TO_TABLE(DEMA), 114 | ADD_TO_TABLE(DIV), 115 | ADD_TO_TABLE(DX), 116 | NULL 117 | }; 118 | 119 | 120 | /* Do not modify the following line. */ 121 | const unsigned int TA_DEF_TableDSize = 122 | ((sizeof(TA_DEF_TableD)/sizeof(TA_FuncDef *))-1); 123 | 124 | 125 | /**************************************************************************** 126 | * Step 3 - Make sure "gen_code" is executed for generating all other 127 | * source files derived from this one. 128 | * You can then re-compile the library as usual and you are done! 129 | ****************************************************************************/ 130 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_e.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'E' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* EMA BEGIN */ 52 | static const TA_InputParameterInfo *TA_EMA_Inputs[] = 53 | { 54 | &TA_DEF_UI_Input_Real, 55 | NULL 56 | }; 57 | 58 | static const TA_OutputParameterInfo *TA_EMA_Outputs[] = 59 | { 60 | &TA_DEF_UI_Output_Real, 61 | NULL 62 | }; 63 | 64 | static const TA_OptInputParameterInfo *TA_EMA_OptInputs[] = 65 | { &TA_DEF_UI_TimePeriod_30_MINIMUM2, 66 | NULL 67 | }; 68 | 69 | DEF_FUNCTION( EMA, /* name */ 70 | TA_GroupId_OverlapStudies, /* groupId */ 71 | "Exponential Moving Average", /* hint */ 72 | "Ema", /* CamelCase name */ 73 | TA_FUNC_FLG_OVERLAP|TA_FUNC_FLG_UNST_PER /* flags */ 74 | ); 75 | /* EMA END */ 76 | 77 | /* EXP BEGIN */ 78 | DEF_MATH_UNARY_OPERATOR( EXP, "Vector Arithmetic Exp", "Exp" ) 79 | /* EXP END */ 80 | 81 | /**************************************************************************** 82 | * Step 2 - Add your TA function to the table. 83 | * Keep in alphabetical order. Must be NULL terminated. 84 | ****************************************************************************/ 85 | const TA_FuncDef *TA_DEF_TableE[] = 86 | { 87 | ADD_TO_TABLE(EMA), 88 | ADD_TO_TABLE(EXP), 89 | NULL 90 | }; 91 | 92 | 93 | /* Do not modify the following line. */ 94 | const unsigned int TA_DEF_TableESize = 95 | ((sizeof(TA_DEF_TableE)/sizeof(TA_FuncDef *))-1); 96 | 97 | 98 | /**************************************************************************** 99 | * Step 3 - Make sure "gen_code" is executed for generating all other 100 | * source files derived from this one. 101 | * You can then re-compile the library as usual and you are done! 102 | ****************************************************************************/ 103 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_f.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'F' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* Floor BEGIN */ 52 | DEF_MATH_UNARY_OPERATOR( FLOOR, "Vector Floor", "Floor" ) 53 | /* Floor END */ 54 | 55 | 56 | /**************************************************************************** 57 | * Step 2 - Add your TA function to the table. 58 | * Keep in alphabetical order. Must be NULL terminated. 59 | ****************************************************************************/ 60 | const TA_FuncDef *TA_DEF_TableF[] = 61 | { 62 | ADD_TO_TABLE(FLOOR), 63 | NULL 64 | }; 65 | 66 | 67 | /* Do not modify the following line. */ 68 | const unsigned int TA_DEF_TableFSize = 69 | ((sizeof(TA_DEF_TableF)/sizeof(TA_FuncDef *))-1); 70 | 71 | 72 | /**************************************************************************** 73 | * Step 3 - Make sure "gen_code" is executed for generating all other 74 | * source files derived from this one. 75 | * You can then re-compile the library as usual and you are done! 76 | ****************************************************************************/ 77 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_g.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'G' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* None */ 52 | 53 | /**************************************************************************** 54 | * Step 2 - Add your TA function to the table. 55 | * Keep in alphabetical order. Must be NULL terminated. 56 | ****************************************************************************/ 57 | const TA_FuncDef *TA_DEF_TableG[] = 58 | { 59 | NULL 60 | }; 61 | 62 | 63 | /* Do not modify the following line. */ 64 | const unsigned int TA_DEF_TableGSize = 65 | ((sizeof(TA_DEF_TableG)/sizeof(TA_FuncDef *))-1); 66 | 67 | 68 | /**************************************************************************** 69 | * Step 3 - Make sure "gen_code" is executed for generating all other 70 | * source files derived from this one. 71 | * You can then re-compile the library as usual and you are done! 72 | ****************************************************************************/ 73 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_i.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'I' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* None */ 52 | 53 | /**************************************************************************** 54 | * Step 2 - Add your TA function to the table. 55 | * Keep in alphabetical order. Must be NULL terminated. 56 | ****************************************************************************/ 57 | const TA_FuncDef *TA_DEF_TableI[] = 58 | { 59 | NULL 60 | }; 61 | 62 | 63 | /* Do not modify the following line. */ 64 | const unsigned int TA_DEF_TableISize = 65 | ((sizeof(TA_DEF_TableI)/sizeof(TA_FuncDef *))-1); 66 | 67 | 68 | /**************************************************************************** 69 | * Step 3 - Make sure "gen_code" is executed for generating all other 70 | * source files derived from this one. 71 | * You can then re-compile the library as usual and you are done! 72 | ****************************************************************************/ 73 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_j.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'J' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* None */ 52 | 53 | /**************************************************************************** 54 | * Step 2 - Add your TA function to the table. 55 | * Keep in alphabetical order. Must be NULL terminated. 56 | ****************************************************************************/ 57 | const TA_FuncDef *TA_DEF_TableJ[] = 58 | { 59 | NULL 60 | }; 61 | 62 | 63 | /* Do not modify the following line. */ 64 | const unsigned int TA_DEF_TableJSize = 65 | ((sizeof(TA_DEF_TableJ)/sizeof(TA_FuncDef *))-1); 66 | 67 | 68 | /**************************************************************************** 69 | * Step 3 - Make sure "gen_code" is executed for generating all other 70 | * source files derived from this one. 71 | * You can then re-compile the library as usual and you are done! 72 | ****************************************************************************/ 73 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_k.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'K' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* KAMA BEGIN */ 52 | static const TA_InputParameterInfo *TA_KAMA_Inputs[] = 53 | { 54 | &TA_DEF_UI_Input_Real, 55 | NULL 56 | }; 57 | 58 | static const TA_OutputParameterInfo *TA_KAMA_Outputs[] = 59 | { 60 | &TA_DEF_UI_Output_Real, 61 | NULL 62 | }; 63 | 64 | static const TA_OptInputParameterInfo *TA_KAMA_OptInputs[] = 65 | { &TA_DEF_UI_TimePeriod_30_MINIMUM2, 66 | NULL 67 | }; 68 | 69 | DEF_FUNCTION( KAMA, /* name */ 70 | TA_GroupId_OverlapStudies, /* groupId */ 71 | "Kaufman Adaptive Moving Average", /* hint */ 72 | "Kama", /* CamelCase name */ 73 | TA_FUNC_FLG_OVERLAP|TA_FUNC_FLG_UNST_PER /* flags */ 74 | ); 75 | /* KAMA END */ 76 | 77 | 78 | /**************************************************************************** 79 | * Step 2 - Add your TA function to the table. 80 | * Keep in alphabetical order. Must be NULL terminated. 81 | ****************************************************************************/ 82 | const TA_FuncDef *TA_DEF_TableK[] = 83 | { 84 | ADD_TO_TABLE(KAMA), 85 | NULL 86 | }; 87 | 88 | 89 | /* Do not modify the following line. */ 90 | const unsigned int TA_DEF_TableKSize = 91 | ((sizeof(TA_DEF_TableK)/sizeof(TA_FuncDef *))-1); 92 | 93 | 94 | /**************************************************************************** 95 | * Step 3 - Make sure "gen_code" is executed for generating all other 96 | * source files derived from this one. 97 | * You can then re-compile the library as usual and you are done! 98 | ****************************************************************************/ 99 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_l.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'L' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* LINEARREG BEGIN */ 52 | static const TA_InputParameterInfo *TA_LINEARREG_Inputs[] = 53 | { 54 | &TA_DEF_UI_Input_Real, 55 | NULL 56 | }; 57 | 58 | static const TA_OutputParameterInfo *TA_LINEARREG_Outputs[] = 59 | { 60 | &TA_DEF_UI_Output_Real, 61 | NULL 62 | }; 63 | 64 | static const TA_OptInputParameterInfo *TA_LINEARREG_OptInputs[] = 65 | { &TA_DEF_UI_TimePeriod_14_MINIMUM2, 66 | NULL 67 | }; 68 | 69 | DEF_FUNCTION( LINEARREG, /* name */ 70 | TA_GroupId_Statistic,/* groupId */ 71 | "Linear Regression", /* hint */ 72 | "LinearReg", /* CamelCase name */ 73 | TA_FUNC_FLG_OVERLAP /* flags */ 74 | ); 75 | /* LINEARREG END */ 76 | 77 | /* LINEARREG_SLOPE BEGIN */ 78 | static const TA_InputParameterInfo *TA_LINEARREG_SLOPE_Inputs[] = 79 | { 80 | &TA_DEF_UI_Input_Real, 81 | NULL 82 | }; 83 | 84 | static const TA_OutputParameterInfo *TA_LINEARREG_SLOPE_Outputs[] = 85 | { 86 | &TA_DEF_UI_Output_Real, 87 | NULL 88 | }; 89 | 90 | static const TA_OptInputParameterInfo *TA_LINEARREG_SLOPE_OptInputs[] = 91 | { &TA_DEF_UI_TimePeriod_14_MINIMUM2, 92 | NULL 93 | }; 94 | 95 | DEF_FUNCTION( LINEARREG_SLOPE, /* name */ 96 | TA_GroupId_Statistic,/* groupId */ 97 | "Linear Regression Slope", /* hint */ 98 | "LinearRegSlope", /* CamelCase name */ 99 | 0 /* flags */ 100 | ); 101 | /* LINEARREG_SLOPE END */ 102 | 103 | /* LINEARREG_ANGLE BEGIN */ 104 | static const TA_InputParameterInfo *TA_LINEARREG_ANGLE_Inputs[] = 105 | { 106 | &TA_DEF_UI_Input_Real, 107 | NULL 108 | }; 109 | 110 | static const TA_OutputParameterInfo *TA_LINEARREG_ANGLE_Outputs[] = 111 | { 112 | &TA_DEF_UI_Output_Real, 113 | NULL 114 | }; 115 | 116 | static const TA_OptInputParameterInfo *TA_LINEARREG_ANGLE_OptInputs[] = 117 | { &TA_DEF_UI_TimePeriod_14_MINIMUM2, 118 | NULL 119 | }; 120 | 121 | DEF_FUNCTION( LINEARREG_ANGLE, /* name */ 122 | TA_GroupId_Statistic,/* groupId */ 123 | "Linear Regression Angle", /* hint */ 124 | "LinearRegAngle", /* CamelCase name */ 125 | 0 /* flags */ 126 | ); 127 | /* LINEARREG_ANGLE END */ 128 | 129 | /* LINEARREG_INTERCEPT BEGIN */ 130 | static const TA_InputParameterInfo *TA_LINEARREG_INTERCEPT_Inputs[] = 131 | { 132 | &TA_DEF_UI_Input_Real, 133 | NULL 134 | }; 135 | 136 | static const TA_OutputParameterInfo *TA_LINEARREG_INTERCEPT_Outputs[] = 137 | { 138 | &TA_DEF_UI_Output_Real, 139 | NULL 140 | }; 141 | 142 | static const TA_OptInputParameterInfo *TA_LINEARREG_INTERCEPT_OptInputs[] = 143 | { &TA_DEF_UI_TimePeriod_14_MINIMUM2, 144 | NULL 145 | }; 146 | 147 | DEF_FUNCTION( LINEARREG_INTERCEPT, /* name */ 148 | TA_GroupId_Statistic,/* groupId */ 149 | "Linear Regression Intercept", /* hint */ 150 | "LinearRegIntercept", /* CamelCase name */ 151 | TA_FUNC_FLG_OVERLAP /* flags */ 152 | ); 153 | /* LINEARREG_INTERCEPT END */ 154 | 155 | /* LN BEGIN */ 156 | DEF_MATH_UNARY_OPERATOR( LN, "Vector Log Natural", "Ln" ) 157 | /* LN END */ 158 | 159 | /* LOG10 BEGIN */ 160 | DEF_MATH_UNARY_OPERATOR( LOG10, "Vector Log10", "Log10" ) 161 | /* LOG10 END */ 162 | 163 | /**************************************************************************** 164 | * Step 2 - Add your TA function to the table. 165 | * Keep in alphabetical order. Must be NULL terminated. 166 | ****************************************************************************/ 167 | const TA_FuncDef *TA_DEF_TableL[] = 168 | { 169 | ADD_TO_TABLE(LINEARREG), 170 | ADD_TO_TABLE(LINEARREG_ANGLE), 171 | ADD_TO_TABLE(LINEARREG_INTERCEPT), 172 | ADD_TO_TABLE(LINEARREG_SLOPE), 173 | ADD_TO_TABLE(LN), 174 | ADD_TO_TABLE(LOG10), 175 | NULL 176 | }; 177 | 178 | 179 | /* Do not modify the following line. */ 180 | const unsigned int TA_DEF_TableLSize = 181 | ((sizeof(TA_DEF_TableL)/sizeof(TA_FuncDef *))-1); 182 | 183 | 184 | /**************************************************************************** 185 | * Step 3 - Make sure "gen_code" is executed for generating all other 186 | * source files derived from this one. 187 | * You can then re-compile the library as usual and you are done! 188 | ****************************************************************************/ 189 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_n.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'N' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* NATR BEGIN */ 52 | static const TA_InputParameterInfo *TA_NATR_Inputs[] = 53 | { 54 | &TA_DEF_UI_Input_Price_HLC, 55 | NULL 56 | }; 57 | 58 | static const TA_OutputParameterInfo *TA_NATR_Outputs[] = 59 | { 60 | &TA_DEF_UI_Output_Real, 61 | NULL 62 | }; 63 | 64 | static const TA_OptInputParameterInfo *TA_NATR_OptInputs[] = 65 | { &TA_DEF_UI_TimePeriod_14, 66 | NULL 67 | }; 68 | 69 | DEF_FUNCTION( NATR, /* name */ 70 | TA_GroupId_VolatilityIndicators, /* groupId */ 71 | "Normalized Average True Range", /* hint */ 72 | "Natr", /* CamelCase name */ 73 | TA_FUNC_FLG_UNST_PER /* flags */ 74 | ); 75 | /* NATR END */ 76 | 77 | #if 0 78 | Will be implemented later 79 | /* NVI BEGIN */ 80 | static const TA_InputParameterInfo *TA_NVI_Inputs[] = 81 | { 82 | &TA_DEF_UI_Input_Price_CV, 83 | NULL 84 | }; 85 | 86 | static const TA_OutputParameterInfo *TA_NVI_Outputs[] = 87 | { 88 | &TA_DEF_UI_Output_Real, 89 | NULL 90 | }; 91 | 92 | static const TA_OptInputParameterInfo *TA_NVI_OptInputs[] = 93 | { 94 | NULL 95 | }; 96 | 97 | DEF_FUNCTION( NVI, /* name */ 98 | TA_GroupId_VolumeIndicators, /* groupId */ 99 | "Negative Volume Index", /* hint */ 100 | "Nvi", /* CamelCase name */ 101 | 0 /* flags */ 102 | ); 103 | 104 | /* NVI END */ 105 | #endif 106 | 107 | /**************************************************************************** 108 | * Step 2 - Add your TA function to the table. 109 | * Keep in alphabetical order. Must be NULL terminated. 110 | ****************************************************************************/ 111 | const TA_FuncDef *TA_DEF_TableN[] = 112 | { 113 | ADD_TO_TABLE(NATR), 114 | NULL 115 | }; 116 | 117 | 118 | /* Do not modify the following line. */ 119 | const unsigned int TA_DEF_TableNSize = 120 | ((sizeof(TA_DEF_TableN)/sizeof(TA_FuncDef *))-1); 121 | 122 | 123 | /**************************************************************************** 124 | * Step 3 - Make sure "gen_code" is executed for generating all other 125 | * source files derived from this one. 126 | * You can then re-compile the library as usual and you are done! 127 | ****************************************************************************/ 128 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_o.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'O' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* OBV BEGIN */ 52 | static const TA_InputParameterInfo *TA_OBV_Inputs[] = 53 | { 54 | &TA_DEF_UI_Input_Real, 55 | &TA_DEF_UI_Input_Price_V, 56 | NULL 57 | }; 58 | 59 | static const TA_OutputParameterInfo *TA_OBV_Outputs[] = 60 | { 61 | &TA_DEF_UI_Output_Real, 62 | NULL 63 | }; 64 | 65 | static const TA_OptInputParameterInfo *TA_OBV_OptInputs[] = 66 | { NULL }; 67 | 68 | DEF_FUNCTION( OBV, /* name */ 69 | TA_GroupId_VolumeIndicators, /* groupId */ 70 | "On Balance Volume", /* hint */ 71 | "Obv", /* CamelCase name */ 72 | 0 /* flags */ 73 | ); 74 | /* OBV END */ 75 | 76 | /**************************************************************************** 77 | * Step 2 - Add your TA function to the table. 78 | * Keep in alphabetical order. Must be NULL terminated. 79 | ****************************************************************************/ 80 | const TA_FuncDef *TA_DEF_TableO[] = 81 | { 82 | ADD_TO_TABLE(OBV), 83 | NULL 84 | }; 85 | 86 | 87 | /* Do not modify the following line. */ 88 | const unsigned int TA_DEF_TableOSize = 89 | ((sizeof(TA_DEF_TableO)/sizeof(TA_FuncDef *))-1); 90 | 91 | 92 | /**************************************************************************** 93 | * Step 3 - Make sure "gen_code" is executed for generating all other 94 | * source files derived from this one. 95 | * You can then re-compile the library as usual and you are done! 96 | ****************************************************************************/ 97 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_p.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'P' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* PLUS_DI BEGIN */ 52 | static const TA_InputParameterInfo *TA_PLUS_DI_Inputs[] = 53 | { 54 | &TA_DEF_UI_Input_Price_HLC, 55 | NULL 56 | }; 57 | 58 | static const TA_OutputParameterInfo *TA_PLUS_DI_Outputs[] = 59 | { 60 | &TA_DEF_UI_Output_Real, 61 | NULL 62 | }; 63 | 64 | static const TA_OptInputParameterInfo *TA_PLUS_DI_OptInputs[] = 65 | { &TA_DEF_UI_TimePeriod_14, 66 | NULL 67 | }; 68 | 69 | DEF_FUNCTION( PLUS_DI, /* name */ 70 | TA_GroupId_MomentumIndicators, /* groupId */ 71 | "Plus Directional Indicator", /* hint */ 72 | "PlusDI", /* CamelCase name */ 73 | TA_FUNC_FLG_UNST_PER /* flags */ 74 | ); 75 | 76 | /* PLUS_DI END */ 77 | 78 | /* PLUS_DM BEGIN */ 79 | static const TA_InputParameterInfo *TA_PLUS_DM_Inputs[] = 80 | { 81 | &TA_DEF_UI_Input_Price_HL, 82 | NULL 83 | }; 84 | 85 | static const TA_OutputParameterInfo *TA_PLUS_DM_Outputs[] = 86 | { 87 | &TA_DEF_UI_Output_Real, 88 | NULL 89 | }; 90 | 91 | static const TA_OptInputParameterInfo *TA_PLUS_DM_OptInputs[] = 92 | { &TA_DEF_UI_TimePeriod_14, 93 | NULL 94 | }; 95 | 96 | DEF_FUNCTION( PLUS_DM, /* name */ 97 | TA_GroupId_MomentumIndicators, /* groupId */ 98 | "Plus Directional Movement", /* hint */ 99 | "PlusDM", /* CamelCase name */ 100 | TA_FUNC_FLG_UNST_PER /* flags */ 101 | ); 102 | 103 | /* PLUS_DM END */ 104 | 105 | /* PPO BEGIN */ 106 | static const TA_InputParameterInfo *TA_PPO_Inputs[] = 107 | { 108 | &TA_DEF_UI_Input_Real, 109 | NULL 110 | }; 111 | 112 | static const TA_OutputParameterInfo *TA_PPO_Outputs[] = 113 | { 114 | &TA_DEF_UI_Output_Real, 115 | NULL 116 | }; 117 | 118 | static const TA_OptInputParameterInfo *TA_PPO_OptInputs[] = 119 | { &TA_DEF_UI_Fast_Period, 120 | &TA_DEF_UI_Slow_Period, 121 | &TA_DEF_UI_MA_Method, 122 | NULL 123 | }; 124 | 125 | DEF_FUNCTION( PPO, /* name */ 126 | TA_GroupId_MomentumIndicators, /* groupId */ 127 | "Percentage Price Oscillator", /* hint */ 128 | "Ppo", /* CamelCase name */ 129 | 0 /* flags */ 130 | ); 131 | /* PPO END */ 132 | 133 | #if 0 134 | Will be implemented later 135 | /* PVI BEGIN */ 136 | static const TA_InputParameterInfo *TA_PVI_Inputs[] = 137 | { 138 | &TA_DEF_UI_Input_Price_CV, 139 | NULL 140 | }; 141 | 142 | static const TA_OutputParameterInfo *TA_PVI_Outputs[] = 143 | { 144 | &TA_DEF_UI_Output_Real, 145 | NULL 146 | }; 147 | 148 | static const TA_OptInputParameterInfo *TA_PVI_OptInputs[] = 149 | { 150 | NULL 151 | }; 152 | 153 | DEF_FUNCTION( PVI, /* name */ 154 | TA_GroupId_VolumeIndicators, /* groupId */ 155 | "Positive Volume Index", /* hint */ 156 | "Pvi", /* CamelCase name */ 157 | 0 /* flags */ 158 | ); 159 | 160 | /* PVI END */ 161 | #endif 162 | 163 | /**************************************************************************** 164 | * Step 2 - Add your TA function to the table. 165 | * Keep in alphabetical order. Must be NULL terminated. 166 | ****************************************************************************/ 167 | const TA_FuncDef *TA_DEF_TableP[] = 168 | { 169 | ADD_TO_TABLE(PLUS_DI), 170 | ADD_TO_TABLE(PLUS_DM), 171 | ADD_TO_TABLE(PPO), 172 | /* ADD_TO_TABLE(PVI),*/ 173 | NULL 174 | }; 175 | 176 | 177 | /* Do not modify the following line. */ 178 | const unsigned int TA_DEF_TablePSize = 179 | ((sizeof(TA_DEF_TableP)/sizeof(TA_FuncDef *))-1); 180 | 181 | 182 | /**************************************************************************** 183 | * Step 3 - Make sure "gen_code" is executed for generating all other 184 | * source files derived from this one. 185 | * You can then re-compile the library as usual and you are done! 186 | ****************************************************************************/ 187 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_q.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'Q' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* None */ 52 | 53 | /**************************************************************************** 54 | * Step 2 - Add your TA function to the table. 55 | * Keep in alphabetical order. Must be NULL terminated. 56 | ****************************************************************************/ 57 | const TA_FuncDef *TA_DEF_TableQ[] = 58 | { 59 | NULL 60 | }; 61 | 62 | 63 | /* Do not modify the following line. */ 64 | const unsigned int TA_DEF_TableQSize = 65 | ((sizeof(TA_DEF_TableQ)/sizeof(TA_FuncDef *))-1); 66 | 67 | 68 | /**************************************************************************** 69 | * Step 3 - Make sure "gen_code" is executed for generating all other 70 | * source files derived from this one. 71 | * You can then re-compile the library as usual and you are done! 72 | ****************************************************************************/ 73 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_r.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'R' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* ROC BEGIN */ 52 | static const TA_InputParameterInfo *TA_ROC_Inputs[] = 53 | { 54 | &TA_DEF_UI_Input_Real, 55 | NULL 56 | }; 57 | 58 | static const TA_OutputParameterInfo *TA_ROC_Outputs[] = 59 | { 60 | &TA_DEF_UI_Output_Real, 61 | NULL 62 | }; 63 | 64 | static const TA_OptInputParameterInfo *TA_ROC_OptInputs[] = 65 | { &TA_DEF_UI_TimePeriod_10, 66 | NULL 67 | }; 68 | 69 | DEF_FUNCTION( ROC, /* name */ 70 | TA_GroupId_MomentumIndicators, /* groupId */ 71 | "Rate of change : ((price/prevPrice)-1)*100", /* hint */ 72 | "Roc", /* CamelCase name */ 73 | 0 /* flags */ 74 | ); 75 | /* ROC END */ 76 | 77 | /* ROCP BEGIN */ 78 | static const TA_InputParameterInfo *TA_ROCP_Inputs[] = 79 | { 80 | &TA_DEF_UI_Input_Real, 81 | NULL 82 | }; 83 | 84 | static const TA_OutputParameterInfo *TA_ROCP_Outputs[] = 85 | { 86 | &TA_DEF_UI_Output_Real, 87 | NULL 88 | }; 89 | 90 | static const TA_OptInputParameterInfo *TA_ROCP_OptInputs[] = 91 | { &TA_DEF_UI_TimePeriod_10, 92 | NULL 93 | }; 94 | 95 | DEF_FUNCTION( ROCP, /* name */ 96 | TA_GroupId_MomentumIndicators, /* groupId */ 97 | "Rate of change Percentage: (price-prevPrice)/prevPrice", /* hint */ 98 | "RocP", /* CamelCase name */ 99 | 0 /* flags */ 100 | ); 101 | /* ROCP END */ 102 | 103 | /* ROCR BEGIN */ 104 | static const TA_InputParameterInfo *TA_ROCR_Inputs[] = 105 | { 106 | &TA_DEF_UI_Input_Real, 107 | NULL 108 | }; 109 | 110 | static const TA_OutputParameterInfo *TA_ROCR_Outputs[] = 111 | { 112 | &TA_DEF_UI_Output_Real, 113 | NULL 114 | }; 115 | 116 | static const TA_OptInputParameterInfo *TA_ROCR_OptInputs[] = 117 | { &TA_DEF_UI_TimePeriod_10, 118 | NULL 119 | }; 120 | 121 | DEF_FUNCTION( ROCR, /* name */ 122 | TA_GroupId_MomentumIndicators, /* groupId */ 123 | "Rate of change ratio: (price/prevPrice)", /* hint */ 124 | "RocR", /* CamelCase name */ 125 | 0 /* flags */ 126 | ); 127 | /* ROCR END */ 128 | 129 | /* ROCR100 BEGIN */ 130 | static const TA_InputParameterInfo *TA_ROCR100_Inputs[] = 131 | { 132 | &TA_DEF_UI_Input_Real, 133 | NULL 134 | }; 135 | 136 | static const TA_OutputParameterInfo *TA_ROCR100_Outputs[] = 137 | { 138 | &TA_DEF_UI_Output_Real, 139 | NULL 140 | }; 141 | 142 | static const TA_OptInputParameterInfo *TA_ROCR100_OptInputs[] = 143 | { &TA_DEF_UI_TimePeriod_10, 144 | NULL 145 | }; 146 | 147 | DEF_FUNCTION( ROCR100, /* name */ 148 | TA_GroupId_MomentumIndicators, /* groupId */ 149 | "Rate of change ratio 100 scale: (price/prevPrice)*100", /* hint */ 150 | "RocR100", /* CamelCase name */ 151 | 0 /* flags */ 152 | ); 153 | /* ROCR100 END */ 154 | 155 | /* RSI BEGIN */ 156 | static const TA_InputParameterInfo *TA_RSI_Inputs[] = 157 | { 158 | &TA_DEF_UI_Input_Real, 159 | NULL 160 | }; 161 | 162 | static const TA_OutputParameterInfo *TA_RSI_Outputs[] = 163 | { 164 | &TA_DEF_UI_Output_Real, 165 | NULL 166 | }; 167 | 168 | static const TA_OptInputParameterInfo *TA_RSI_OptInputs[] = 169 | { 170 | &TA_DEF_UI_TimePeriod_14_MINIMUM2, 171 | NULL 172 | }; 173 | 174 | DEF_FUNCTION( RSI, /* name */ 175 | TA_GroupId_MomentumIndicators, /* groupId */ 176 | "Relative Strength Index", /* hint */ 177 | "Rsi", /* CamelCase name */ 178 | TA_FUNC_FLG_UNST_PER /* flags */ 179 | ); 180 | /* RSI END */ 181 | 182 | /**************************************************************************** 183 | * Step 2 - Add your TA function to the table. 184 | * Keep in alphabetical order. Must be NULL terminated. 185 | ****************************************************************************/ 186 | const TA_FuncDef *TA_DEF_TableR[] = 187 | { 188 | ADD_TO_TABLE(ROC), 189 | ADD_TO_TABLE(ROCP), 190 | ADD_TO_TABLE(ROCR), 191 | ADD_TO_TABLE(ROCR100), 192 | ADD_TO_TABLE(RSI), 193 | NULL 194 | }; 195 | 196 | 197 | /* Do not modify the following line. */ 198 | const unsigned int TA_DEF_TableRSize = 199 | ((sizeof(TA_DEF_TableR)/sizeof(TA_FuncDef *))-1); 200 | 201 | 202 | /**************************************************************************** 203 | * Step 3 - Make sure "gen_code" is executed for generating all other 204 | * source files derived from this one. 205 | * You can then re-compile the library as usual and you are done! 206 | ****************************************************************************/ 207 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_u.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'U' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* ULTOSC BEGIN */ 52 | const TA_OptInputParameterInfo TA_DEF_UI_TimePeriod_7_PER1 = 53 | { 54 | TA_OptInput_IntegerRange, /* type */ 55 | "optInTimePeriod1", /* paramName */ 56 | 0, /* flags */ 57 | 58 | "First Period", /* displayName */ 59 | (const void *)&TA_DEF_TimePeriod_Positive, /* dataSet */ 60 | 7, /* defaultValue */ 61 | "Number of bars for 1st period.", /* hint */ 62 | 63 | NULL /* CamelCase name */ 64 | }; 65 | 66 | const TA_OptInputParameterInfo TA_DEF_UI_TimePeriod_14_PER2 = 67 | { 68 | TA_OptInput_IntegerRange, /* type */ 69 | "optInTimePeriod2", /* paramName */ 70 | 0, /* flags */ 71 | 72 | "Second Period", /* displayName */ 73 | (const void *)&TA_DEF_TimePeriod_Positive, /* dataSet */ 74 | 14, /* defaultValue */ 75 | "Number of bars fro 2nd period", /* hint */ 76 | 77 | NULL /* CamelCase name */ 78 | }; 79 | 80 | const TA_OptInputParameterInfo TA_DEF_UI_TimePeriod_28_PER3 = 81 | { 82 | TA_OptInput_IntegerRange, /* type */ 83 | "optInTimePeriod3", /* paramName */ 84 | 0, /* flags */ 85 | 86 | "Third Period", /* displayName */ 87 | (const void *)&TA_DEF_TimePeriod_Positive, /* dataSet */ 88 | 28, /* defaultValue */ 89 | "Number of bars for 3rd period", /* hint */ 90 | 91 | NULL /* CamelCase name */ 92 | }; 93 | 94 | static const TA_InputParameterInfo *TA_ULTOSC_Inputs[] = 95 | { 96 | &TA_DEF_UI_Input_Price_HLC, 97 | NULL 98 | }; 99 | 100 | static const TA_OutputParameterInfo *TA_ULTOSC_Outputs[] = 101 | { 102 | &TA_DEF_UI_Output_Real, 103 | NULL 104 | }; 105 | 106 | static const TA_OptInputParameterInfo *TA_ULTOSC_OptInputs[] = 107 | { 108 | &TA_DEF_UI_TimePeriod_7_PER1, 109 | &TA_DEF_UI_TimePeriod_14_PER2, 110 | &TA_DEF_UI_TimePeriod_28_PER3, 111 | NULL 112 | }; 113 | 114 | DEF_FUNCTION( ULTOSC, /* name */ 115 | TA_GroupId_MomentumIndicators, /* groupId */ 116 | "Ultimate Oscillator", /* hint */ 117 | "UltOsc", /* CamelCase name */ 118 | 0 /* flags */ 119 | ); 120 | /* ULTOSC END */ 121 | 122 | /**************************************************************************** 123 | * Step 2 - Add your TA function to the table. 124 | * Keep in alphabetical order. Must be NULL terminated. 125 | ****************************************************************************/ 126 | const TA_FuncDef *TA_DEF_TableU[] = 127 | { 128 | ADD_TO_TABLE(ULTOSC), 129 | NULL 130 | }; 131 | 132 | 133 | /* Do not modify the following line. */ 134 | const unsigned int TA_DEF_TableUSize = 135 | ((sizeof(TA_DEF_TableU)/sizeof(TA_FuncDef *))-1); 136 | 137 | 138 | /**************************************************************************** 139 | * Step 3 - Make sure "gen_code" is executed for generating all other 140 | * source files derived from this one. 141 | * You can then re-compile the library as usual and you are done! 142 | ****************************************************************************/ 143 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_v.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'V' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* VAR BEGIN */ 52 | static const TA_InputParameterInfo *TA_VAR_Inputs[] = 53 | { 54 | &TA_DEF_UI_Input_Real, 55 | NULL 56 | }; 57 | 58 | static const TA_OutputParameterInfo *TA_VAR_Outputs[] = 59 | { 60 | &TA_DEF_UI_Output_Real, 61 | NULL 62 | }; 63 | 64 | static const TA_OptInputParameterInfo *TA_VAR_OptInputs[] = 65 | { &TA_DEF_UI_TimePeriod_5, 66 | &TA_DEF_UI_NbDeviation, 67 | NULL 68 | }; 69 | 70 | DEF_FUNCTION( VAR, /* name */ 71 | TA_GroupId_Statistic, /* groupId */ 72 | "Variance", /* hint */ 73 | "Variance", /* CamelCase name */ 74 | 0 /* flags */ 75 | ); 76 | /* VAR END */ 77 | 78 | /**************************************************************************** 79 | * Step 2 - Add your TA function to the table. 80 | * Keep in alphabetical order. Must be NULL terminated. 81 | ****************************************************************************/ 82 | const TA_FuncDef *TA_DEF_TableV[] = 83 | { 84 | ADD_TO_TABLE(VAR), 85 | NULL 86 | }; 87 | 88 | 89 | /* Do not modify the following line. */ 90 | const unsigned int TA_DEF_TableVSize = 91 | ((sizeof(TA_DEF_TableV)/sizeof(TA_FuncDef *))-1); 92 | 93 | 94 | /**************************************************************************** 95 | * Step 3 - Make sure "gen_code" is executed for generating all other 96 | * source files derived from this one. 97 | * You can then re-compile the library as usual and you are done! 98 | ****************************************************************************/ 99 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_w.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'W' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* WCL BEGIN */ 52 | static const TA_InputParameterInfo *TA_WCLPRICE_Inputs[] = 53 | { 54 | &TA_DEF_UI_Input_Price_HLC, 55 | NULL 56 | }; 57 | 58 | static const TA_OutputParameterInfo *TA_WCLPRICE_Outputs[] = 59 | { 60 | &TA_DEF_UI_Output_Real, 61 | NULL 62 | }; 63 | 64 | static const TA_OptInputParameterInfo *TA_WCLPRICE_OptInputs[] = { NULL }; 65 | 66 | DEF_FUNCTION( WCLPRICE, /* name */ 67 | TA_GroupId_PriceTransform, /* groupId */ 68 | "Weighted Close Price", /* hint */ 69 | "WclPrice", /* CamelCase name */ 70 | TA_FUNC_FLG_OVERLAP /* flags */ 71 | ); 72 | /* WCL END */ 73 | 74 | /* WILLR BEGIN */ 75 | static const TA_InputParameterInfo *TA_WILLR_Inputs[] = 76 | { 77 | &TA_DEF_UI_Input_Price_HLC, 78 | NULL 79 | }; 80 | 81 | static const TA_OutputParameterInfo *TA_WILLR_Outputs[] = 82 | { 83 | &TA_DEF_UI_Output_Real, 84 | NULL 85 | }; 86 | 87 | static const TA_OptInputParameterInfo *TA_WILLR_OptInputs[] = 88 | { &TA_DEF_UI_TimePeriod_14_MINIMUM2, 89 | NULL 90 | }; 91 | 92 | DEF_FUNCTION( WILLR, /* name */ 93 | TA_GroupId_MomentumIndicators, /* groupId */ 94 | "Williams' %R", /* hint */ 95 | "WillR", /* CamelCase name */ 96 | 0 /* flags */ 97 | ); 98 | /* WILLR END */ 99 | 100 | /* WMA BEGIN */ 101 | static const TA_InputParameterInfo *TA_WMA_Inputs[] = 102 | { 103 | &TA_DEF_UI_Input_Real, 104 | NULL 105 | }; 106 | 107 | static const TA_OutputParameterInfo *TA_WMA_Outputs[] = 108 | { 109 | &TA_DEF_UI_Output_Real, 110 | NULL 111 | }; 112 | 113 | static const TA_OptInputParameterInfo *TA_WMA_OptInputs[] = 114 | { &TA_DEF_UI_TimePeriod_30_MINIMUM2, 115 | NULL 116 | }; 117 | 118 | DEF_FUNCTION( WMA, /* name */ 119 | TA_GroupId_OverlapStudies, /* groupId */ 120 | "Weighted Moving Average", /* hint */ 121 | "Wma", /* CamelCase name */ 122 | TA_FUNC_FLG_OVERLAP /* flags */ 123 | ); 124 | 125 | /* WMA END */ 126 | 127 | /**************************************************************************** 128 | * Step 2 - Add your TA function to the table. 129 | * Keep in alphabetical order. Must be NULL terminated. 130 | ****************************************************************************/ 131 | const TA_FuncDef *TA_DEF_TableW[] = 132 | { 133 | ADD_TO_TABLE(WCLPRICE), 134 | ADD_TO_TABLE(WILLR), 135 | ADD_TO_TABLE(WMA), 136 | NULL 137 | }; 138 | 139 | 140 | /* Do not modify the following line. */ 141 | const unsigned int TA_DEF_TableWSize = 142 | ((sizeof(TA_DEF_TableW)/sizeof(TA_FuncDef *))-1); 143 | 144 | 145 | /**************************************************************************** 146 | * Step 3 - Make sure "gen_code" is executed for generating all other 147 | * source files derived from this one. 148 | * You can then re-compile the library as usual and you are done! 149 | ****************************************************************************/ 150 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_x.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'X' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* None */ 52 | 53 | /**************************************************************************** 54 | * Step 2 - Add your TA function to the table. 55 | * Keep in alphabetical order. Must be NULL terminated. 56 | ****************************************************************************/ 57 | const TA_FuncDef *TA_DEF_TableX[] = 58 | { 59 | NULL 60 | }; 61 | 62 | 63 | /* Do not modify the following line. */ 64 | const unsigned int TA_DEF_TableXSize = 65 | ((sizeof(TA_DEF_TableX)/sizeof(TA_FuncDef *))-1); 66 | 67 | 68 | /**************************************************************************** 69 | * Step 3 - Make sure "gen_code" is executed for generating all other 70 | * source files derived from this one. 71 | * You can then re-compile the library as usual and you are done! 72 | ****************************************************************************/ 73 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_y.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'Y' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* None */ 52 | 53 | /**************************************************************************** 54 | * Step 2 - Add your TA function to the table. 55 | * Keep in alphabetical order. Must be NULL terminated. 56 | ****************************************************************************/ 57 | const TA_FuncDef *TA_DEF_TableY[] = 58 | { 59 | NULL 60 | }; 61 | 62 | 63 | /* Do not modify the following line. */ 64 | const unsigned int TA_DEF_TableYSize = 65 | ((sizeof(TA_DEF_TableY)/sizeof(TA_FuncDef *))-1); 66 | 67 | 68 | /**************************************************************************** 69 | * Step 3 - Make sure "gen_code" is executed for generating all other 70 | * source files derived from this one. 71 | * You can then re-compile the library as usual and you are done! 72 | ****************************************************************************/ 73 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/tables/table_z.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /********************************************************************* 35 | * This file contains only TA functions starting with the letter 'Z' * 36 | *********************************************************************/ 37 | #include 38 | #include "ta_abstract.h" 39 | #include "ta_def_ui.h" 40 | 41 | /* Follow the 3 steps defined below for adding a new TA Function to this 42 | * file. 43 | */ 44 | 45 | /**************************************************************************** 46 | * Step 1 - Define here the interface to your TA functions with 47 | * the macro DEF_FUNCTION. 48 | * 49 | ****************************************************************************/ 50 | 51 | /* None */ 52 | 53 | /**************************************************************************** 54 | * Step 2 - Add your TA function to the table. 55 | * Keep in alphabetical order. Must be NULL terminated. 56 | ****************************************************************************/ 57 | const TA_FuncDef *TA_DEF_TableZ[] = 58 | { 59 | NULL 60 | }; 61 | 62 | 63 | /* Do not modify the following line. */ 64 | const unsigned int TA_DEF_TableZSize = 65 | ((sizeof(TA_DEF_TableZ)/sizeof(TA_FuncDef *))-1); 66 | 67 | 68 | /**************************************************************************** 69 | * Step 3 - Make sure "gen_code" is executed for generating all other 70 | * source files derived from this one. 71 | * You can then re-compile the library as usual and you are done! 72 | ****************************************************************************/ 73 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/templates/CoreAnnotated.java.template: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* DO NOT MODIFY this file. 35 | * This file is automatically generated by gen_code. 36 | * 37 | * If you are not re-generating the java code (which is most 38 | * likely the case), just ignore this file. 39 | */ 40 | 41 | package com.tictactec.ta.lib; 42 | 43 | import com.tictactec.ta.lib.MAType; 44 | import com.tictactec.ta.lib.MInteger; 45 | import com.tictactec.ta.lib.RetCode; 46 | import com.tictactec.ta.lib.Core; 47 | import com.tictactec.ta.lib.meta.annotation.FuncFlags; 48 | import com.tictactec.ta.lib.meta.annotation.FuncInfo; 49 | import com.tictactec.ta.lib.meta.annotation.InputFlags; 50 | import com.tictactec.ta.lib.meta.annotation.InputParameterInfo; 51 | import com.tictactec.ta.lib.meta.annotation.InputParameterType; 52 | import com.tictactec.ta.lib.meta.annotation.IntegerList; 53 | import com.tictactec.ta.lib.meta.annotation.IntegerRange; 54 | import com.tictactec.ta.lib.meta.annotation.OptInputParameterInfo; 55 | import com.tictactec.ta.lib.meta.annotation.OptInputParameterType; 56 | import com.tictactec.ta.lib.meta.annotation.OutputFlags; 57 | import com.tictactec.ta.lib.meta.annotation.OutputParameterInfo; 58 | import com.tictactec.ta.lib.meta.annotation.OutputParameterType; 59 | import com.tictactec.ta.lib.meta.annotation.RealRange; 60 | 61 | public class CoreAnnotated extends Core { 62 | 63 | %%%GENCODE%%% 64 | 65 | } 66 | 67 | /*************** 68 | * End of File * 69 | ***************/ 70 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/templates/Makefile.am.template: -------------------------------------------------------------------------------- 1 | 2 | noinst_LTLIBRARIES = libta_func.la 3 | AM_CPPFLAGS = -I../ta_common/ 4 | 5 | libta_func_la_SOURCES = ta_utility.c \ 6 | %%%GENCODE%%% 7 | 8 | libta_func_la_LDFLAGS = -version-info $(TALIB_LIBRARY_VERSION) 9 | 10 | libta_funcdir=$(includedir)/ta-lib/ 11 | libta_func_HEADERS = ../../include/ta_defs.h \ 12 | ../../include/ta_libc.h \ 13 | ../../include/ta_func.h 14 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/templates/excel_glue.c.template: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* DO NOT MODIFY this file. 35 | * This file is automatically generated by gen_code. 36 | * 37 | * If you are not re-building the excel library (which is most 38 | * likely the case), just ignore this file. 39 | */ 40 | 41 | %%%GENCODE%%% 42 | 43 | /*************** 44 | * End of File * 45 | ***************/ 46 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/templates/ta_frame.c.template: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* Note: This file is generated by gencode, do not 35 | * modify directly. 36 | */ 37 | 38 | /* The function define in this file allows to have a consistent 39 | * framework for calling all the TA function through 40 | * the TA_CallFunc mechanism. 41 | * 42 | * See "ta_abstract.h" 43 | */ 44 | 45 | #ifndef TA_FUNC_H 46 | #include "ta_func.h" 47 | #endif 48 | 49 | #ifndef TA_FRAME_PRIV_H 50 | #include "ta_frame_priv.h" 51 | #endif 52 | 53 | #ifndef TA_FRAME_H 54 | #include "ta_frame.h" 55 | #endif 56 | 57 | /* NEVER CALL directly these functions! Use TA_CallFunc. */ 58 | 59 | %%%GENCODE%%% 60 | 61 | /***************/ 62 | /* End of File */ 63 | /***************/ 64 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/templates/ta_frame.h.template: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #ifndef TA_FRAME_H 35 | #define TA_FRAME_H 36 | 37 | /* Note: This file is generated by gencode, do not 38 | * modify directly. 39 | */ 40 | 41 | /* The function define in this file allows to call a TA 42 | * function through the TA_CallFunc mechanism. 43 | */ 44 | 45 | #ifndef TA_COMMON_H 46 | #include "ta_common.h" 47 | #endif 48 | 49 | #ifndef TA_FRAME_PRIV_H 50 | #include "ta_frame_priv.h" 51 | #endif 52 | 53 | 54 | %%%GENCODE%%% 55 | 56 | #endif 57 | 58 | /***************/ 59 | /* End of File */ 60 | /***************/ 61 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/templates/ta_func.h.template: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | #ifndef TA_FUNC_H 34 | #define TA_FUNC_H 35 | 36 | #ifndef TA_COMMON_H 37 | #include "ta_common.h" 38 | #endif 39 | 40 | /* This header contains the prototype of all the Technical Analysis 41 | * function provided by TA-LIB. 42 | */ 43 | 44 | /* TA-LIB Developer Note: Do not modify this file, it is automaticaly 45 | * generated by gen_code. 46 | */ 47 | #ifdef __cplusplus 48 | extern "C" { 49 | #endif 50 | 51 | #ifndef TA_DEFS_H 52 | #include "ta_defs.h" 53 | #endif 54 | 55 | %%%GENCODE%%% 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif 62 | 63 | /***************/ 64 | /* End of File */ 65 | /***************/ 66 | 67 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/templates/ta_func.swg.template: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* DO NOT MODIFY this file. 35 | * This file is automatically generated by gen_code. 36 | * 37 | * If you are not re-building an interface with SWIG (which is most 38 | * likely the case), just ignore this file. 39 | */ 40 | 41 | %%%GENCODE%%% 42 | 43 | /*************** 44 | * End of File * 45 | ***************/ 46 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/templates/ta_func_api.c.template: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* Important: This file is automatically generated by gen_code. 35 | * Any modification will be lost on next execution 36 | * of gen_code. 37 | * 38 | * This file is a binary representation of the func_api.xml file. 39 | */ 40 | 41 | #include "ta_abstract.h" 42 | 43 | static const char TA_FunctionDescriptionXMLArray[] = 44 | { 45 | %%%GENCODE%%% 46 | }; 47 | 48 | const char *TA_FunctionDescriptionXML() 49 | { 50 | return TA_FunctionDescriptionXMLArray; 51 | } 52 | 53 | /***************/ 54 | /* End of File */ 55 | /***************/ 56 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/templates/ta_group_idx.c.template: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* Important: This file is automatically generated by gen_code. 35 | * Any modification will be lost on next execution 36 | * of gen_code. 37 | * 38 | * The goal of this file is to build the following global 39 | * constant: 40 | * TA_PerGroupFuncDef 41 | * TA_PerGroupSize 42 | * TA_TotalNbFunction 43 | * 44 | * These constant allows mainly to speed optimize functionality related to 45 | * sequential access to TA_DefFunc by TA_GroupId (see ta_abstract.c) 46 | */ 47 | #include 48 | #include "ta_def_ui.h" 49 | #include "ta_abstract.h" 50 | 51 | %%%GENCODE%%% 52 | 53 | 54 | /***************/ 55 | /* End of File */ 56 | /***************/ 57 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/templates/ta_java_defs.h.template: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* DO NOT MODIFY this file. 35 | * This file is automatically generated by gen_code. 36 | * 37 | * If you are not re-generating the java code (which is most 38 | * likely the case), just ignore this file. 39 | */ 40 | 41 | %%%GENCODE%%% 42 | 43 | /*************** 44 | * End of File * 45 | ***************/ 46 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/templates/ta_retcode.c.template: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* Important: This file is automatically generated by the utility gen_code. 35 | * Any modification will be lost on next execution of gen_code. 36 | * 37 | * The goal of this file is to provide the functionality TA_SetRetCodeInfo. 38 | * 39 | * This function is a convenient way for the user to translate a TA_RetCode into 40 | * a human readable string. 41 | */ 42 | #include 43 | 44 | typedef struct 45 | { 46 | TA_RetCode retCode; 47 | const char * const enumStr; 48 | const char * const infoStr; 49 | } TA_InternalRetCodeInfo; 50 | 51 | static TA_InternalRetCodeInfo retCodeInfoTable[] = { 52 | %%%GENCODE%%% 53 | {(TA_RetCode)0xFFFF,"TA_UNKNOWN_ERR","Unknown Error"} 54 | }; 55 | 56 | #define NB_RET_CODE_INFO (sizeof(retCodeInfoTable)/sizeof(TA_InternalRetCodeInfo)) 57 | 58 | void TA_SetRetCodeInfo( TA_RetCode theRetCode, TA_RetCodeInfo *retCodeInfo ) 59 | { 60 | unsigned int i; 61 | 62 | /* Trap internal error code */ 63 | if( (theRetCode >= 5000) && (theRetCode <= 5999) ) 64 | { 65 | retCodeInfo->enumStr = "TA_INTERNAL_ERROR"; 66 | retCodeInfo->infoStr = "Unexpected Internal Error - Contact TA-Lib.org"; 67 | return; 68 | } 69 | 70 | /* Check among all the error code defined in ta_common.h */ 71 | for( i=0; i < (NB_RET_CODE_INFO-1); i++ ) 72 | { 73 | if( theRetCode == retCodeInfoTable[i].retCode ) 74 | { 75 | /* Error code found. */ 76 | retCodeInfo->enumStr = retCodeInfoTable[i].enumStr; 77 | retCodeInfo->infoStr = retCodeInfoTable[i].infoStr; 78 | return; 79 | } 80 | } 81 | 82 | /* Error code not found. */ 83 | 84 | /* "TA_UNKNOWN_ERR" is ALWAYS the last entry in the table. */ 85 | retCodeInfo->enumStr = retCodeInfoTable[i].enumStr; 86 | retCodeInfo->infoStr = retCodeInfoTable[i].infoStr; 87 | } 88 | 89 | /***************/ 90 | /* End of File */ 91 | /***************/ 92 | 93 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_abstract/templates/ta_x.c.template: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* List of contributors: 35 | * 36 | * Initial Name/description 37 | * ------------------------------------------------------------------- 38 | * MF Mario Fortier (Replace when you are the original author) 39 | * 40 | * Change history: 41 | * 42 | * MMDDYY BY Description 43 | * ------------------------------------------------------------------- 44 | * XXXXXX MF Initial Version 45 | */ 46 | 47 | /**** START GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ 48 | %%%GENCODE%%% 49 | /**** END GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ 50 | { 51 | /* insert local variable here */ 52 | 53 | /**** START GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ 54 | %%%GENCODE%%% 55 | /**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ 56 | 57 | /* insert lookback code here. */ 58 | 59 | return 0; 60 | } 61 | 62 | /**** START GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ 63 | %%%GENCODE%%% 64 | /**** END GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ 65 | { 66 | /* insert local variable here */ 67 | 68 | /**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ 69 | %%%GENCODE%%% 70 | /**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ 71 | 72 | /* Insert TA function code here. */ 73 | 74 | /* Default return values */ 75 | VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx); 76 | VALUE_HANDLE_DEREF_TO_ZERO(outNbElement); 77 | 78 | return ENUM_VALUE(RetCode,TA_SUCCESS,Success); 79 | } 80 | 81 | /**** START GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ 82 | %%%GENCODE%%% 83 | /**** END GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ 84 | 85 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_common/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | noinst_LTLIBRARIES = libta_common.la 3 | AM_CPPFLAGS = -I../ta_common/ 4 | 5 | libta_common_la_SOURCES = ta_global.c \ 6 | ta_retcode.c \ 7 | ta_version.c 8 | 9 | libta_common_la_LDFLAGS = -version-info $(TALIB_LIBRARY_VERSION) 10 | 11 | libta_commondir=$(includedir)/ta-lib/ 12 | libta_common_HEADERS = ../../include/ta_defs.h \ 13 | ../../include/ta_libc.h \ 14 | ../../include/ta_common.h 15 | 16 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_common/ta_global.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* List of contributors: 35 | * 36 | * Initial Name/description 37 | * ------------------------------------------------------------------- 38 | * MF Mario Fortier 39 | * AC Angelo Ciceri 40 | * 41 | * 42 | * Change history: 43 | * 44 | * MMDDYY BY Description 45 | * ------------------------------------------------------------------- 46 | * 112400 MF First version. 47 | * 082004 AC Add TA_SetCandleSettings, TA_RestoreCandleDefaultSettings 48 | * and call to TA_RestoreCandleDefaultSettings in TA_Initialize 49 | * 041106 MF Add prefix to theGlobals to avoid clash with other libs. 50 | * 040707 MF Change global initialization to eliminate Mac OS X link error. 51 | */ 52 | 53 | /* Description: 54 | * Provides initialization / shutdown functionality for all modules. 55 | */ 56 | 57 | /**** Headers ****/ 58 | #include 59 | #include 60 | #include 61 | 62 | #include "ta_common.h" 63 | #include "ta_magic_nb.h" 64 | #include "ta_global.h" 65 | #include "ta_func.h" 66 | 67 | /**** External functions declarations. ****/ 68 | /* None */ 69 | 70 | /**** External variables declarations. ****/ 71 | /* None */ 72 | 73 | /**** Global variables definitions. ****/ 74 | 75 | /* The entry point for all globals */ 76 | TA_LibcPriv ta_theGlobals = {0,{{0,0,0}},0,0,0,0,(TA_Compatibility)0,{0},{{(TA_CandleSettingType)0,(TA_RangeType)0,0,0}}}; 77 | 78 | TA_LibcPriv *TA_Globals = &ta_theGlobals; 79 | 80 | /**** Local declarations. ****/ 81 | /* None */ 82 | 83 | /**** Local functions declarations. ****/ 84 | /* None */ 85 | 86 | /**** Local variables definitions. ****/ 87 | /* None */ 88 | 89 | /**** Global functions definitions. ****/ 90 | TA_RetCode TA_Initialize( void ) 91 | { 92 | /* Initialize the "global variable" used to manage the global 93 | * variables of all other modules... 94 | */ 95 | memset( TA_Globals, 0, sizeof( TA_LibcPriv ) ); 96 | TA_Globals->magicNb = TA_LIBC_PRIV_MAGIC_NB; 97 | 98 | /*** At this point, TA_Shutdown can be called to clean-up. ***/ 99 | 100 | /* Set the default value to global variables */ 101 | TA_RestoreCandleDefaultSettings( TA_AllCandleSettings ); 102 | 103 | return TA_SUCCESS; 104 | } 105 | 106 | TA_RetCode TA_Shutdown( void ) 107 | { 108 | if( TA_Globals->magicNb != TA_LIBC_PRIV_MAGIC_NB ) 109 | return TA_LIB_NOT_INITIALIZE; 110 | 111 | /* Initialize to all zero to make sure we invalidate that object. */ 112 | memset( TA_Globals, 0, sizeof( TA_LibcPriv ) ); 113 | 114 | return TA_SUCCESS; 115 | } 116 | 117 | TA_RetCode TA_SetCandleSettings( TA_CandleSettingType settingType, 118 | TA_RangeType rangeType, 119 | int avgPeriod, 120 | double factor ) 121 | { 122 | /*printf("setcdlset:%d ",settingType);*/ 123 | if( settingType >= TA_AllCandleSettings ) 124 | return TA_BAD_PARAM; 125 | TA_Globals->candleSettings[settingType].settingType = settingType; 126 | TA_Globals->candleSettings[settingType].rangeType = rangeType; 127 | TA_Globals->candleSettings[settingType].avgPeriod = avgPeriod; 128 | TA_Globals->candleSettings[settingType].factor = factor; 129 | /*printf("cdlset: %d %d %d %f\n",TA_Globals->candleSettings[settingType].settingType,TA_Globals->candleSettings[settingType].rangeType, 130 | TA_Globals->candleSettings[settingType].avgPeriod,TA_Globals->candleSettings[settingType].factor);*/ 131 | return TA_SUCCESS; 132 | } 133 | 134 | TA_RetCode TA_RestoreCandleDefaultSettings( TA_CandleSettingType settingType ) 135 | { 136 | const TA_CandleSetting TA_CandleDefaultSettings[] = { 137 | /* real body is long when it's longer than the average of the 10 previous candles' real body */ 138 | { TA_BodyLong, TA_RangeType_RealBody, 10, 1.0 }, 139 | /* real body is very long when it's longer than 3 times the average of the 10 previous candles' real body */ 140 | { TA_BodyVeryLong, TA_RangeType_RealBody, 10, 3.0 }, 141 | /* real body is short when it's shorter than the average of the 10 previous candles' real bodies */ 142 | { TA_BodyShort, TA_RangeType_RealBody, 10, 1.0 }, 143 | /* real body is like doji's body when it's shorter than 10% the average of the 10 previous candles' high-low range */ 144 | { TA_BodyDoji, TA_RangeType_HighLow, 10, 0.1 }, 145 | /* shadow is long when it's longer than the real body */ 146 | { TA_ShadowLong, TA_RangeType_RealBody, 0, 1.0 }, 147 | /* shadow is very long when it's longer than 2 times the real body */ 148 | { TA_ShadowVeryLong, TA_RangeType_RealBody, 0, 2.0 }, 149 | /* shadow is short when it's shorter than half the average of the 10 previous candles' sum of shadows */ 150 | { TA_ShadowShort, TA_RangeType_Shadows, 10, 1.0 }, 151 | /* shadow is very short when it's shorter than 10% the average of the 10 previous candles' high-low range */ 152 | { TA_ShadowVeryShort, TA_RangeType_HighLow, 10, 0.1 }, 153 | /* when measuring distance between parts of candles or width of gaps */ 154 | /* "near" means "<= 20% of the average of the 5 previous candles' high-low range" */ 155 | { TA_Near, TA_RangeType_HighLow, 5, 0.2 }, 156 | /* when measuring distance between parts of candles or width of gaps */ 157 | /* "far" means ">= 60% of the average of the 5 previous candles' high-low range" */ 158 | { TA_Far, TA_RangeType_HighLow, 5, 0.6 }, 159 | /* when measuring distance between parts of candles or width of gaps */ 160 | /* "equal" means "<= 5% of the average of the 5 previous candles' high-low range" */ 161 | { TA_Equal, TA_RangeType_HighLow, 5, 0.05 } 162 | }; 163 | 164 | int i; 165 | if( settingType > TA_AllCandleSettings ) 166 | return TA_BAD_PARAM; 167 | if( settingType == TA_AllCandleSettings ) 168 | for( i = 0; i < TA_AllCandleSettings; ++i ) 169 | TA_Globals->candleSettings[i] = TA_CandleDefaultSettings[i]; 170 | else 171 | TA_Globals->candleSettings[settingType] = TA_CandleDefaultSettings[settingType]; 172 | return TA_SUCCESS; 173 | } 174 | 175 | /**** Local functions definitions. ****/ 176 | /* None */ 177 | 178 | 179 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_common/ta_global.h: -------------------------------------------------------------------------------- 1 | #ifndef TA_GLOBAL_H 2 | #define TA_GLOBAL_H 3 | 4 | #ifndef TA_COMMON_H 5 | #include "ta_common.h" 6 | #endif 7 | 8 | #ifndef TA_FUNC_H 9 | #include "ta_func.h" 10 | #endif 11 | 12 | /* TA_CandleSetting is the one setting struct */ 13 | typedef struct { 14 | TA_CandleSettingType settingType; 15 | TA_RangeType rangeType; 16 | int avgPeriod; 17 | double factor; 18 | } TA_CandleSetting; 19 | 20 | /* This interface is used exclusively INTERNALY to the TA-LIB. 21 | * There is nothing for the end-user here ;-> 22 | */ 23 | 24 | /* Provides functionality for managing global ressource 25 | * throughout the TA-LIB. 26 | * 27 | * Since not all module are used/link in the application, 28 | * the ta_common simply provides the mechanism for the module 29 | * to optionnaly "register" its initialization/shutdown 30 | * function. 31 | * 32 | * A function shall access its global variable by calling 33 | * TA_GetGlobal. This function will appropriatly call the 34 | * initialization function if its global are not yet initialized. 35 | * 36 | * The call of the init and shutdown function are guaranteed 37 | * to be multithread protected. It is also guarantee that 38 | * these function will always get called in alternance (in 39 | * other word, following an initialization only a shutdown 40 | * can get called). 41 | */ 42 | 43 | typedef enum 44 | { 45 | /* Module will be shutdown in the order specified here. */ 46 | 47 | TA_ABSTRACTION_GLOBAL_ID, 48 | TA_FUNC_GLOBAL_ID, 49 | TA_MEMORY_GLOBAL_ID, /* Must be last. */ 50 | TA_NB_GLOBAL_ID 51 | } TA_GlobalModuleId; 52 | 53 | typedef TA_RetCode (*TA_GlobalInitFunc) ( void **globalToAlloc ); 54 | typedef TA_RetCode (*TA_GlobalShutdownFunc)( void *globalAllocated ); 55 | 56 | typedef struct 57 | { 58 | const TA_GlobalModuleId id; 59 | const TA_GlobalInitFunc init; 60 | const TA_GlobalShutdownFunc shutdown; 61 | } TA_GlobalControl; 62 | 63 | TA_RetCode TA_GetGlobal( const TA_GlobalControl * const control, 64 | void **global ); 65 | 66 | /* Occasionaly, code tracing must be disable. 67 | * Example: 68 | * - The memory module needs to know if the tracing is 69 | * still enabled or not when freeing memory on shutdown. 70 | * - We do not want to recursively trace while the tracing 71 | * function themselves gets called ;-> 72 | */ 73 | int TA_IsTraceEnabled( void ); 74 | void TA_TraceEnable ( void ); 75 | void TA_TraceDisable ( void ); 76 | 77 | /* If enabled by the user, use a local drive 78 | * for configuration and/or temporary file. 79 | * TA-LIB must NEVER assume such local drive 80 | * is available. 81 | */ 82 | const char *TA_GetLocalCachePath( void ); 83 | 84 | typedef struct 85 | { 86 | unsigned int initialize; 87 | const TA_GlobalControl * control; 88 | void *global; 89 | } TA_ModuleControl; 90 | 91 | /* This is the hidden implementation of TA_Libc. */ 92 | typedef struct 93 | { 94 | unsigned int magicNb; /* Unique identifier of this object. */ 95 | TA_ModuleControl moduleControl[TA_NB_GLOBAL_ID]; 96 | 97 | unsigned int traceEnabled; 98 | unsigned int stdioEnabled; 99 | FILE *stdioFile; 100 | 101 | const char *localCachePath; 102 | 103 | /* For handling the compatibility with other software */ 104 | TA_Compatibility compatibility; 105 | 106 | /* For handling the unstable period of some TA function. */ 107 | unsigned int unstablePeriod[TA_FUNC_UNST_ALL]; 108 | 109 | /* For handling the candlestick global settings */ 110 | TA_CandleSetting candleSettings[TA_AllCandleSettings]; 111 | 112 | } TA_LibcPriv; 113 | 114 | /* The following global is used all over the place 115 | * and is the entry point for all other globals. 116 | */ 117 | extern TA_LibcPriv *TA_Globals; 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_common/ta_magic_nb.h: -------------------------------------------------------------------------------- 1 | #ifndef TA_MAGIC_NB_H 2 | #define TA_MAGIC_NB_H 3 | 4 | /* Many allocated structures contains a magic number. 5 | * 6 | * These numbers are used solely to make sure that when a pointer is 7 | * provided, it is really pointing on the expected type of data. 8 | * It helps also for the detection of memory corruption. 9 | * This mechanism is simple, but add a non-negligeable level of 10 | * reliability at a very low cost (speed/memory wise). 11 | */ 12 | #define TA_FUNC_DEF_MAGIC_NB 0xA201B201 13 | #define TA_PARAM_HOLDER_PRIV_MAGIC_NB 0xA202B202 14 | #define TA_LIBC_PRIV_MAGIC_NB 0xA203B203 15 | #define TA_UDBASE_MAGIC_NB 0xA204B204 16 | #define TA_CATEGORY_TABLE_MAGIC_NB 0xA205B205 17 | #define TA_SYMBOL_TABLE_MAGIC_NB 0xA206B206 18 | #define TA_WEBPAGE_MAGIC_NB 0xA207B207 19 | #define TA_STREAM_MAGIC_NB 0xA208B208 20 | #define TA_STREAM_ACCESS_MAGIC_NB 0xA209B209 21 | #define TA_YAHOO_IDX_MAGIC_NB 0xA20AB20A 22 | #define TA_STRING_TABLE_GROUP_MAGIC_NB 0xA20BB20B 23 | #define TA_STRING_TABLE_FUNC_MAGIC_NB 0xA20CB20C 24 | #define TA_MARKET_PAGE_MAGIC_NB 0xA20DB20D 25 | #define TA_TRADELOGPRIV_MAGIC_NB 0xA20EB20E 26 | #define TA_PMPRIV_MAGIC_NB 0xA20FB20F 27 | #define TA_PMREPORT_MAGIC_NB 0xA210B210 28 | #define TA_TRADEREPORT_MAGIC_NB 0xA211B211 29 | #define TA_HISTORY_MAGIC_NB 0xA212B212 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_common/ta_pragma.h: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* List of contributors: 35 | * 36 | * Initial Name/description 37 | * ------------------------------------------------------------------- 38 | * CM Craig Miller (c-miller@users.sourceforge.net) 39 | * 40 | * Change history: 41 | * 42 | * MMDDYY BY Description 43 | * ------------------------------------------------------------------- 44 | * 011707 CM First version. 45 | */ 46 | 47 | /* Description: 48 | * 49 | * Visual Studio 2005 has extended the C Run-Time Library by including "secure" 50 | * runtime functions and deprecating the previous function prototypes. Since 51 | * we need to use the previous prototypes to maintain compatibility with other 52 | * platform compilers we are going to disable the deprecation warnings when 53 | * compiling with Visual Studio 2005. 54 | * 55 | * Note: this header must be the first inclusion referenced by the code file 56 | * needing these settings!!!!! 57 | * 58 | */ 59 | 60 | #ifndef TA_PRAGMA_H 61 | #define TA_PRAGMA_H 62 | 63 | #if (_MSC_VER >= 1400) // VC8+ nmake and VS2005 64 | 65 | #ifndef _CRT_SECURE_NO_DEPRECATE //turn off MS 'safe' CRT library routines 66 | #define _CRT_SECURE_NO_DEPRECATE 1 67 | #endif 68 | 69 | // There are additional macros that may be needed in the future, so we'll list them here 70 | //#ifndef _CRT_SECURE_NO_WARNINGS //turn off MS 'safe' CRT library routines 71 | // #define _CRT_SECURE_NO_WARNINGS 1 72 | //#endif 73 | // 74 | //#ifndef _SCL_SECURE_NO_DEPRECATE //turn off MS 'safe' C++RT library routines 75 | // #define _SCL_SECURE_NO_DEPRECATE 1 76 | //#endif 77 | //#ifndef _SCL_SECURE_NO_WARNINGS 78 | // #define _SCL_SECURE_NO_WARNINGS 1 79 | //#endif 80 | // 81 | //#ifndef _CRT_NONSTDC_NO_DEPRECATE //turn off MS POSIX replacements library routines 82 | // #define _CRT_NONSTDC_NO_DEPRECATE 1 83 | //#endif 84 | 85 | #endif // VC8+ 86 | 87 | #endif //TA_PRAGMA_H 88 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_common/ta_retcode.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* Important: This file is automatically generated by the utility gen_code. 35 | * Any modification will be lost on next execution of gen_code. 36 | * 37 | * The goal of this file is to provide the functionality TA_SetRetCodeInfo. 38 | * 39 | * This function is a convenient way for the user to translate a TA_RetCode into 40 | * a human readable string. 41 | */ 42 | #include 43 | 44 | typedef struct 45 | { 46 | TA_RetCode retCode; 47 | const char * const enumStr; 48 | const char * const infoStr; 49 | } TA_InternalRetCodeInfo; 50 | 51 | static TA_InternalRetCodeInfo retCodeInfoTable[] = { 52 | {(TA_RetCode)0,"TA_SUCCESS","No error"}, 53 | {(TA_RetCode)1,"TA_LIB_NOT_INITIALIZE","TA_Initialize was not sucessfully called"}, 54 | {(TA_RetCode)2,"TA_BAD_PARAM","A parameter is out of range"}, 55 | {(TA_RetCode)3,"TA_ALLOC_ERR","Possibly out-of-memory"}, 56 | {(TA_RetCode)4,"TA_GROUP_NOT_FOUND","No Info"}, 57 | {(TA_RetCode)5,"TA_FUNC_NOT_FOUND","No Info"}, 58 | {(TA_RetCode)6,"TA_INVALID_HANDLE","No Info"}, 59 | {(TA_RetCode)7,"TA_INVALID_PARAM_HOLDER","No Info"}, 60 | {(TA_RetCode)8,"TA_INVALID_PARAM_HOLDER_TYPE","No Info"}, 61 | {(TA_RetCode)9,"TA_INVALID_PARAM_FUNCTION","No Info"}, 62 | {(TA_RetCode)10,"TA_INPUT_NOT_ALL_INITIALIZE","No Info"}, 63 | {(TA_RetCode)11,"TA_OUTPUT_NOT_ALL_INITIALIZE","No Info"}, 64 | {(TA_RetCode)12,"TA_OUT_OF_RANGE_START_INDEX","No Info"}, 65 | {(TA_RetCode)13,"TA_OUT_OF_RANGE_END_INDEX","No Info"}, 66 | {(TA_RetCode)14,"TA_INVALID_LIST_TYPE","No Info"}, 67 | {(TA_RetCode)15,"TA_BAD_OBJECT","No Info"}, 68 | {(TA_RetCode)16,"TA_NOT_SUPPORTED","No Info"}, 69 | {(TA_RetCode)5000,"TA_INTERNAL_ERROR","No Info"}, 70 | {(TA_RetCode)0xFFFF,"TA_UNKNOWN_ERR","Unknown Error"} 71 | }; 72 | 73 | #define NB_RET_CODE_INFO (sizeof(retCodeInfoTable)/sizeof(TA_InternalRetCodeInfo)) 74 | 75 | void TA_SetRetCodeInfo( TA_RetCode theRetCode, TA_RetCodeInfo *retCodeInfo ) 76 | { 77 | unsigned int i; 78 | 79 | /* Trap internal error code */ 80 | if( (theRetCode >= 5000) && (theRetCode <= 5999) ) 81 | { 82 | retCodeInfo->enumStr = "TA_INTERNAL_ERROR"; 83 | retCodeInfo->infoStr = "Unexpected Internal Error - Contact TA-Lib.org"; 84 | return; 85 | } 86 | 87 | /* Check among all the error code defined in ta_common.h */ 88 | for( i=0; i < (NB_RET_CODE_INFO-1); i++ ) 89 | { 90 | if( theRetCode == retCodeInfoTable[i].retCode ) 91 | { 92 | /* Error code found. */ 93 | retCodeInfo->enumStr = retCodeInfoTable[i].enumStr; 94 | retCodeInfo->infoStr = retCodeInfoTable[i].infoStr; 95 | return; 96 | } 97 | } 98 | 99 | /* Error code not found. */ 100 | 101 | /* "TA_UNKNOWN_ERR" is ALWAYS the last entry in the table. */ 102 | retCodeInfo->enumStr = retCodeInfoTable[i].enumStr; 103 | retCodeInfo->infoStr = retCodeInfoTable[i].infoStr; 104 | } 105 | 106 | /***************/ 107 | /* End of File */ 108 | /***************/ 109 | 110 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_common/ta_retcode.csv: -------------------------------------------------------------------------------- 1 | 0,TA_SUCCESS,No error 2 | 1,TA_LIB_NOT_INITIALIZE,TA_Initialize was not sucessfully called 3 | 2,TA_BAD_PARAM,A parameter is out of range 4 | 3,TA_ALLOC_ERR,Possibly out-of-memory 5 | 4,TA_GROUP_NOT_FOUND,No Info 6 | 5,TA_FUNC_NOT_FOUND,No Info 7 | 6,TA_INVALID_HANDLE,No Info 8 | 7,TA_INVALID_PARAM_HOLDER,No Info 9 | 8,TA_INVALID_PARAM_HOLDER_TYPE,No Info 10 | 9,TA_INVALID_PARAM_FUNCTION,No Info 11 | 10,TA_INPUT_NOT_ALL_INITIALIZE,No Info 12 | 11,TA_OUTPUT_NOT_ALL_INITIALIZE,No Info 13 | 12,TA_OUT_OF_RANGE_START_INDEX,No Info 14 | 13,TA_OUT_OF_RANGE_END_INDEX,No Info 15 | 14,TA_INVALID_LIST_TYPE,No Info 16 | 15,TA_BAD_OBJECT,No Info 17 | 16,TA_NOT_SUPPORTED,No Info 18 | 5000,TA_INTERNAL_ERROR,No Info 19 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_common/ta_version.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #include 35 | #include 36 | 37 | /* Version number controlled manually. 38 | * 39 | * Should be modified only by TA-Lib.org 40 | */ 41 | #define MAJOR "0" 42 | #define MINOR "4" 43 | #define BUILD "0" 44 | 45 | /* Nothing to modify below this line. */ 46 | 47 | #define TA_VERSION_STRING(maj,min,build,date,time) maj"."min"."build" ("date" "time")" 48 | 49 | const char *TA_GetVersionString( void ) 50 | { 51 | return TA_VERSION_STRING(MAJOR,MINOR,BUILD,__DATE__,__TIME__); 52 | } 53 | 54 | const char *TA_GetVersionMajor( void ) 55 | { 56 | return MAJOR; 57 | } 58 | 59 | const char *TA_GetVersionMinor( void ) 60 | { 61 | return MINOR; 62 | } 63 | 64 | const char *TA_GetVersionBuild( void ) 65 | { 66 | return BUILD; 67 | } 68 | 69 | const char *TA_GetVersionDate( void ) 70 | { 71 | return __DATE__; 72 | } 73 | 74 | const char *TA_GetVersionTime( void ) 75 | { 76 | return __TIME__; 77 | } 78 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_func/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | noinst_LTLIBRARIES = libta_func.la 3 | AM_CPPFLAGS = -I../ta_common/ 4 | 5 | libta_func_la_SOURCES = ta_utility.c \ 6 | ta_ACOS.c \ 7 | ta_AD.c \ 8 | ta_ADD.c \ 9 | ta_ADOSC.c \ 10 | ta_ADX.c \ 11 | ta_ADXR.c \ 12 | ta_APO.c \ 13 | ta_AROON.c \ 14 | ta_AROONOSC.c \ 15 | ta_ASIN.c \ 16 | ta_ATAN.c \ 17 | ta_ATR.c \ 18 | ta_AVGPRICE.c \ 19 | ta_BBANDS.c \ 20 | ta_BETA.c \ 21 | ta_BOP.c \ 22 | ta_CCI.c \ 23 | ta_CDL2CROWS.c \ 24 | ta_CDL3BLACKCROWS.c \ 25 | ta_CDL3INSIDE.c \ 26 | ta_CDL3LINESTRIKE.c \ 27 | ta_CDL3OUTSIDE.c \ 28 | ta_CDL3STARSINSOUTH.c \ 29 | ta_CDL3WHITESOLDIERS.c \ 30 | ta_CDLABANDONEDBABY.c \ 31 | ta_CDLADVANCEBLOCK.c \ 32 | ta_CDLBELTHOLD.c \ 33 | ta_CDLBREAKAWAY.c \ 34 | ta_CDLCLOSINGMARUBOZU.c \ 35 | ta_CDLCONCEALBABYSWALL.c \ 36 | ta_CDLCOUNTERATTACK.c \ 37 | ta_CDLDARKCLOUDCOVER.c \ 38 | ta_CDLDOJI.c \ 39 | ta_CDLDOJISTAR.c \ 40 | ta_CDLDRAGONFLYDOJI.c \ 41 | ta_CDLENGULFING.c \ 42 | ta_CDLEVENINGDOJISTAR.c \ 43 | ta_CDLEVENINGSTAR.c \ 44 | ta_CDLGAPSIDESIDEWHITE.c \ 45 | ta_CDLGRAVESTONEDOJI.c \ 46 | ta_CDLHAMMER.c \ 47 | ta_CDLHANGINGMAN.c \ 48 | ta_CDLHARAMI.c \ 49 | ta_CDLHARAMICROSS.c \ 50 | ta_CDLHIGHWAVE.c \ 51 | ta_CDLHIKKAKE.c \ 52 | ta_CDLHIKKAKEMOD.c \ 53 | ta_CDLHOMINGPIGEON.c \ 54 | ta_CDLIDENTICAL3CROWS.c \ 55 | ta_CDLINNECK.c \ 56 | ta_CDLINVERTEDHAMMER.c \ 57 | ta_CDLKICKING.c \ 58 | ta_CDLKICKINGBYLENGTH.c \ 59 | ta_CDLLADDERBOTTOM.c \ 60 | ta_CDLLONGLEGGEDDOJI.c \ 61 | ta_CDLLONGLINE.c \ 62 | ta_CDLMARUBOZU.c \ 63 | ta_CDLMATCHINGLOW.c \ 64 | ta_CDLMATHOLD.c \ 65 | ta_CDLMORNINGDOJISTAR.c \ 66 | ta_CDLMORNINGSTAR.c \ 67 | ta_CDLONNECK.c \ 68 | ta_CDLPIERCING.c \ 69 | ta_CDLRICKSHAWMAN.c \ 70 | ta_CDLRISEFALL3METHODS.c \ 71 | ta_CDLSEPARATINGLINES.c \ 72 | ta_CDLSHOOTINGSTAR.c \ 73 | ta_CDLSHORTLINE.c \ 74 | ta_CDLSPINNINGTOP.c \ 75 | ta_CDLSTALLEDPATTERN.c \ 76 | ta_CDLSTICKSANDWICH.c \ 77 | ta_CDLTAKURI.c \ 78 | ta_CDLTASUKIGAP.c \ 79 | ta_CDLTHRUSTING.c \ 80 | ta_CDLTRISTAR.c \ 81 | ta_CDLUNIQUE3RIVER.c \ 82 | ta_CDLUPSIDEGAP2CROWS.c \ 83 | ta_CDLXSIDEGAP3METHODS.c \ 84 | ta_CEIL.c \ 85 | ta_CMO.c \ 86 | ta_CORREL.c \ 87 | ta_COS.c \ 88 | ta_COSH.c \ 89 | ta_DEMA.c \ 90 | ta_DIV.c \ 91 | ta_DX.c \ 92 | ta_EMA.c \ 93 | ta_EXP.c \ 94 | ta_FLOOR.c \ 95 | ta_HT_DCPERIOD.c \ 96 | ta_HT_DCPHASE.c \ 97 | ta_HT_PHASOR.c \ 98 | ta_HT_SINE.c \ 99 | ta_HT_TRENDLINE.c \ 100 | ta_HT_TRENDMODE.c \ 101 | ta_KAMA.c \ 102 | ta_LINEARREG.c \ 103 | ta_LINEARREG_ANGLE.c \ 104 | ta_LINEARREG_INTERCEPT.c \ 105 | ta_LINEARREG_SLOPE.c \ 106 | ta_LN.c \ 107 | ta_LOG10.c \ 108 | ta_MA.c \ 109 | ta_MACD.c \ 110 | ta_MACDEXT.c \ 111 | ta_MACDFIX.c \ 112 | ta_MAMA.c \ 113 | ta_MAVP.c \ 114 | ta_MAX.c \ 115 | ta_MAXINDEX.c \ 116 | ta_MEDPRICE.c \ 117 | ta_MFI.c \ 118 | ta_MIDPOINT.c \ 119 | ta_MIDPRICE.c \ 120 | ta_MIN.c \ 121 | ta_MININDEX.c \ 122 | ta_MINMAX.c \ 123 | ta_MINMAXINDEX.c \ 124 | ta_MINUS_DI.c \ 125 | ta_MINUS_DM.c \ 126 | ta_MOM.c \ 127 | ta_MULT.c \ 128 | ta_NATR.c \ 129 | ta_OBV.c \ 130 | ta_PLUS_DI.c \ 131 | ta_PLUS_DM.c \ 132 | ta_PPO.c \ 133 | ta_ROC.c \ 134 | ta_ROCP.c \ 135 | ta_ROCR.c \ 136 | ta_ROCR100.c \ 137 | ta_RSI.c \ 138 | ta_SAR.c \ 139 | ta_SAREXT.c \ 140 | ta_SIN.c \ 141 | ta_SINH.c \ 142 | ta_SMA.c \ 143 | ta_SQRT.c \ 144 | ta_STDDEV.c \ 145 | ta_STOCH.c \ 146 | ta_STOCHF.c \ 147 | ta_STOCHRSI.c \ 148 | ta_SUB.c \ 149 | ta_SUM.c \ 150 | ta_T3.c \ 151 | ta_TAN.c \ 152 | ta_TANH.c \ 153 | ta_TEMA.c \ 154 | ta_TRANGE.c \ 155 | ta_TRIMA.c \ 156 | ta_TRIX.c \ 157 | ta_TSF.c \ 158 | ta_TYPPRICE.c \ 159 | ta_ULTOSC.c \ 160 | ta_VAR.c \ 161 | ta_WCLPRICE.c \ 162 | ta_WILLR.c \ 163 | ta_WMA.c 164 | 165 | libta_func_la_LDFLAGS = -version-info $(TALIB_LIBRARY_VERSION) 166 | 167 | libta_funcdir=$(includedir)/ta-lib/ 168 | libta_func_HEADERS = ../../include/ta_defs.h \ 169 | ../../include/ta_libc.h \ 170 | ../../include/ta_func.h 171 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_func/ta_NVI.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* List of contributors: 35 | * 36 | * Initial Name/description 37 | * ------------------------------------------------------------------- 38 | * MF Mario Fortier 39 | * 40 | * 41 | * Change history: 42 | * 43 | * MMDDYY BY Description 44 | * ------------------------------------------------------------------- 45 | * 120802 MF Template creation. 46 | * 47 | */ 48 | 49 | /**** START GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ 50 | /* All code within this section is automatically 51 | * generated by gen_code. Any modification will be lost 52 | * next time gen_code is run. 53 | */ 54 | /* Generated */ 55 | /* Generated */ #if defined( _MANAGED ) 56 | /* Generated */ #using 57 | /* Generated */ #include "Core.h" 58 | /* Generated */ #define TA_INTERNAL_ERROR(Id) (TA_INTERNAL_ERROR) 59 | /* Generated */ namespace TA { namespace Library { 60 | /* Generated */ #else 61 | /* Generated */ #include 62 | /* Generated */ #include 63 | /* Generated */ #include "ta_func.h" 64 | /* Generated */ #endif 65 | /* Generated */ 66 | /* Generated */ #ifndef TA_UTILITY_H 67 | /* Generated */ #include "ta_utility.h" 68 | /* Generated */ #endif 69 | /* Generated */ 70 | /* Generated */ #ifndef TA_MEMORY_H 71 | /* Generated */ #include "ta_memory.h" 72 | /* Generated */ #endif 73 | /* Generated */ 74 | /* Generated */ #define TA_PREFIX(x) TA_##x 75 | /* Generated */ #define INPUT_TYPE double 76 | /* Generated */ 77 | /* Generated */ #if defined( _MANAGED ) 78 | /* Generated */ int Core::NVI_Lookback( /* Generated */ void ) 79 | /* Generated */ 80 | /* Generated */ #else 81 | /* Generated */ int TA_NVI_Lookback( /* Generated */ void ) 82 | /* Generated */ 83 | /* Generated */ #endif 84 | /**** END GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ 85 | { 86 | /* insert lookback code here. */ 87 | return 0; 88 | } 89 | 90 | /**** START GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ 91 | /* 92 | * TA_NVI - Negative Volume Index 93 | * 94 | * Input = Close, Volume 95 | * Output = double 96 | * 97 | */ 98 | /* Generated */ 99 | /* Generated */ #if defined( _MANAGED ) 100 | /* Generated */ enum Core::TA_RetCode Core::NVI( int startIdx, 101 | /* Generated */ int endIdx, 102 | /* Generated */ double inClose __gc [], 103 | /* Generated */ int inVolume __gc [], 104 | /* Generated */ [OutAttribute]Int32 REF(outBegIdx), 105 | /* Generated */ [OutAttribute]Int32 REF(outNBElement), 106 | /* Generated */ double outReal __gc [] ) 107 | /* Generated */ #else 108 | /* Generated */ TA_RetCode TA_NVI( int startIdx, 109 | /* Generated */ int endIdx, 110 | /* Generated */ const double inClose[], 111 | /* Generated */ const int inVolume[], 112 | /* Generated */ int *outBegIdx, 113 | /* Generated */ int *outNBElement, 114 | /* Generated */ double outReal[] ) 115 | /* Generated */ #endif 116 | /**** END GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ 117 | { 118 | /* insert local variable here */ 119 | 120 | /**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ 121 | /* Generated */ 122 | /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK 123 | /* Generated */ 124 | /* Generated */ /* Validate the requested output range. */ 125 | /* Generated */ if( startIdx < 0 ) 126 | /* Generated */ return TA_OUT_OF_RANGE_START_INDEX; 127 | /* Generated */ if( (endIdx < 0) || (endIdx < startIdx)) 128 | /* Generated */ return TA_OUT_OF_RANGE_END_INDEX; 129 | /* Generated */ 130 | /* Generated */ /* Validate the parameters. */ 131 | /* Generated */ /* Verify required price component. */ 132 | /* Generated */ if(!inClose||!inVolume) 133 | /* Generated */ return TA_BAD_PARAM; 134 | /* Generated */ 135 | /* Generated */ if( outReal == NULL ) 136 | /* Generated */ return TA_BAD_PARAM; 137 | /* Generated */ 138 | /* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */ 139 | /* Generated */ 140 | /**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ 141 | 142 | /* Insert TA function code here. */ 143 | 144 | /* Default return values */ 145 | *outBegIdx = 0; 146 | *outNBElement = 0; 147 | 148 | return TA_SUCCESS; 149 | } 150 | 151 | /**** START GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ 152 | /* Generated */ 153 | /* Generated */ #define USE_SINGLE_PRECISION_INPUT 154 | /* Generated */ #if !defined( _MANAGED ) 155 | /* Generated */ #undef TA_PREFIX 156 | /* Generated */ #define TA_PREFIX(x) TA_S_##x 157 | /* Generated */ #endif 158 | /* Generated */ #undef INPUT_TYPE 159 | /* Generated */ #define INPUT_TYPE float 160 | /* Generated */ #if defined( _MANAGED ) 161 | /* Generated */ enum Core::TA_RetCode Core::NVI( int startIdx, 162 | /* Generated */ int endIdx, 163 | /* Generated */ float inClose __gc [], 164 | /* Generated */ int inVolume __gc [], 165 | /* Generated */ [OutAttribute]Int32 REF(outBegIdx), 166 | /* Generated */ [OutAttribute]Int32 REF(outNBElement), 167 | /* Generated */ double outReal __gc [] ) 168 | /* Generated */ #else 169 | /* Generated */ TA_RetCode TA_S_NVI( int startIdx, 170 | /* Generated */ int endIdx, 171 | /* Generated */ const float inClose[], 172 | /* Generated */ const int inVolume[], 173 | /* Generated */ int *outBegIdx, 174 | /* Generated */ int *outNBElement, 175 | /* Generated */ double outReal[] ) 176 | /* Generated */ #endif 177 | /* Generated */ { 178 | /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK 179 | /* Generated */ if( startIdx < 0 ) 180 | /* Generated */ return TA_OUT_OF_RANGE_START_INDEX; 181 | /* Generated */ if( (endIdx < 0) || (endIdx < startIdx)) 182 | /* Generated */ return TA_OUT_OF_RANGE_END_INDEX; 183 | /* Generated */ if(!inClose||!inVolume) 184 | /* Generated */ return TA_BAD_PARAM; 185 | /* Generated */ if( outReal == NULL ) 186 | /* Generated */ return TA_BAD_PARAM; 187 | /* Generated */ #endif 188 | /* Generated */ *outBegIdx = 0; 189 | /* Generated */ *outNBElement = 0; 190 | /* Generated */ return TA_SUCCESS; 191 | /* Generated */ } 192 | /* Generated */ 193 | /* Generated */ #if defined( _MANAGED ) 194 | /* Generated */ }} // Close namespace TA.Lib 195 | /* Generated */ #endif 196 | /**** END GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ 197 | 198 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/ta_func/ta_utility.c: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2007, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* List of contributors: 35 | * 36 | * Initial Name/description 37 | * ------------------------------------------------------------------- 38 | * MF Mario Fortier 39 | * RM Robert Meier (talib@meierlim.com http://www.meierlim.com) 40 | * 41 | * Change history: 42 | * 43 | * MMDDYY BY Description 44 | * ------------------------------------------------------------------- 45 | * 052603 MF Adapt code to compile with .NET Managed C++ 46 | * 123004 RM,MF Adapt code to work with Visual Studio 2005 47 | * 48 | */ 49 | 50 | #if defined( _MANAGED ) 51 | #using 52 | #include "TA-Lib-Core.h" 53 | #include "ta_memory.h" 54 | namespace TicTacTec { namespace TA { namespace Library { 55 | #else 56 | #include "ta_utility.h" 57 | #include "ta_func.h" 58 | #include "ta_memory.h" 59 | #endif 60 | 61 | #if defined( _MANAGED ) 62 | enum class Core::RetCode Core::SetUnstablePeriod( enum class FuncUnstId id, 63 | unsigned int unstablePeriod ) 64 | #else 65 | TA_RetCode TA_SetUnstablePeriod( TA_FuncUnstId id, 66 | unsigned int unstablePeriod ) 67 | #endif 68 | { 69 | int i; 70 | 71 | if( id > ENUM_VALUE(FuncUnstId,TA_FUNC_UNST_ALL,FuncUnstAll) ) 72 | return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); 73 | 74 | if( id == ENUM_VALUE(FuncUnstId,TA_FUNC_UNST_ALL,FuncUnstAll) ) 75 | { 76 | for( i=0; i < (int)ENUM_VALUE(FuncUnstId,TA_FUNC_UNST_ALL,FuncUnstAll); i++ ) 77 | { 78 | #if defined( _MANAGED ) 79 | Globals->unstablePeriod[(int)i] = unstablePeriod; 80 | #else 81 | TA_Globals->unstablePeriod[i] = unstablePeriod; 82 | #endif 83 | } 84 | } 85 | else 86 | { 87 | #if defined( _MANAGED ) 88 | Globals->unstablePeriod[(int)id] = unstablePeriod; 89 | #else 90 | TA_Globals->unstablePeriod[id] = unstablePeriod; 91 | #endif 92 | } 93 | 94 | return ENUM_VALUE(RetCode,TA_SUCCESS,Success); 95 | } 96 | 97 | #if defined( _MANAGED ) 98 | unsigned int Core::GetUnstablePeriod( enum class FuncUnstId id ) 99 | #else 100 | unsigned int TA_GetUnstablePeriod( TA_FuncUnstId id ) 101 | #endif 102 | { 103 | if( id >= ENUM_VALUE(FuncUnstId,TA_FUNC_UNST_ALL,FuncUnstAll) ) 104 | return 0; 105 | 106 | #if defined( _MANAGED ) 107 | return Globals->unstablePeriod[(int)id]; 108 | #else 109 | return TA_Globals->unstablePeriod[id]; 110 | #endif 111 | } 112 | 113 | #if defined( _MANAGED ) 114 | enum class Core::RetCode Core::SetCompatibility( enum class Compatibility value ) 115 | #else 116 | TA_RetCode TA_SetCompatibility( TA_Compatibility value ) 117 | #endif 118 | { 119 | TA_GLOBALS_COMPATIBILITY = value; 120 | return ENUM_VALUE(RetCode,TA_SUCCESS,Success); 121 | } 122 | 123 | #if defined( _MANAGED ) 124 | enum class Core::Compatibility Core::GetCompatibility( void ) 125 | #else 126 | TA_Compatibility TA_GetCompatibility( void ) 127 | #endif 128 | { 129 | return TA_GLOBALS_COMPATIBILITY; 130 | } 131 | 132 | #if defined( _MANAGED ) 133 | }}} // Close namespace TicTacTec::TA::Lib 134 | #endif 135 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/tools/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = foreign 1.4 2 | SUBDIRS = gen_code ta_regtest 3 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/tools/gen_code/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | # ta_regrest is used for testing and should 3 | # not be installed. 4 | noinst_PROGRAMS = gen_code 5 | 6 | gen_code_SOURCES = gen_code.c 7 | 8 | gen_code_CPPFLAGS = -I../../ta_common 9 | gen_code_LDFLAGS = -L../../ta_common -L../../ta_abstract -L../../ta_func 10 | gen_code_LDADD = -lta_common -lta_abstract_gc -lta_func -lm 11 | 12 | all-local: 13 | $(MAKE) $(AM_MAKEFLAGS) gen_code 14 | cp gen_code ../../../bin 15 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/tools/gen_code/java/Main.java: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2006, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* List of contributors: 35 | * 36 | * Initial Name/description 37 | * ------------------------------------------------------------------- 38 | * BT Barry Tsung 39 | * 40 | * Change history: 41 | * 42 | * MMDDYY BY Description 43 | * ------------------------------------------------------------------- 44 | * 012706 BT First version. 45 | */ 46 | 47 | /* Description: 48 | * Perform text processing to the generated TA-Lib code. 49 | * 50 | * Action Performed: 51 | * - Do proper indentation of the Core.java file. 52 | * 53 | * This Java command line utility is expected to be 54 | * called only by the gen_code tool. 55 | * 56 | * Note: All directory in this code is relative to the 'bin' directory. 57 | * ta-lib/c/bin must be your working directory when launching this 58 | * utility, which is the also the expected directory when launching 59 | * gen_code. 60 | */ 61 | import java.io.BufferedReader; 62 | import java.io.FileNotFoundException; 63 | import java.io.FileReader; 64 | import java.io.IOException; 65 | import java.io.PrintWriter; 66 | 67 | class Main 68 | { 69 | public static void main(String[] args) { 70 | try { 71 | String inFile = "..\\temp\\CoreJavaUnformated.tmp"; 72 | String outFile = "..\\temp\\CoreJavaPretty.tmp"; 73 | new PrettyCode(inFile,outFile).process().close(); 74 | if( PrettyCode.verify(inFile,outFile) ){ 75 | /* Create a file when all done. The "caller" gen_code will 76 | * look for that file to confirm success. 77 | */ 78 | PrintWriter out = new PrintWriter("..\\temp\\java_success"); 79 | out.print("OK"); 80 | out.close(); 81 | } 82 | } catch (FileNotFoundException e) { 83 | e.printStackTrace(); 84 | } catch (IOException e) { 85 | e.printStackTrace(); 86 | } 87 | } 88 | } 89 | 90 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/tools/gen_code/java/PrettyCode.java: -------------------------------------------------------------------------------- 1 | /* TA-LIB Copyright (c) 1999-2006, Mario Fortier 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or 5 | * without modification, are permitted provided that the following 6 | * conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * - Neither name of author nor the names of its contributors 17 | * may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 30 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* List of contributors: 35 | * 36 | * Initial Name/description 37 | * ------------------------------------------------------------------- 38 | * BT Barry Tsung 39 | * 40 | * Change history: 41 | * 42 | * MMDDYY BY Description 43 | * ------------------------------------------------------------------- 44 | * 012706 BT First version. 45 | */ 46 | 47 | /* Description: 48 | * Do formating of Java source code files. 49 | */ 50 | 51 | import java.io.BufferedReader; 52 | import java.io.FileNotFoundException; 53 | import java.io.FileReader; 54 | import java.io.IOException; 55 | import java.io.PrintWriter; 56 | 57 | public class PrettyCode { 58 | int line; 59 | int level; 60 | BufferedReader in; 61 | PrintWriter out; 62 | 63 | String indentString = " "; 64 | 65 | boolean insideOfComment; 66 | 67 | boolean unfinishedStatement; 68 | 69 | String lineBuffer; 70 | 71 | public PrettyCode(String inFileName, String outFileName) throws FileNotFoundException{ 72 | this.in = new BufferedReader(new FileReader(inFileName)); 73 | this.out = new PrintWriter(outFileName); 74 | } 75 | 76 | public PrettyCode process() throws IOException{ 77 | while( (lineBuffer=in.readLine())!=null ){ 78 | processLine(lineBuffer); 79 | out.println(); 80 | line++; 81 | } 82 | out.flush(); 83 | return this; 84 | } 85 | 86 | public PrettyCode close() throws IOException{ 87 | in.close(); 88 | out.close(); 89 | return this; 90 | } 91 | 92 | void processLine(String buffer){ 93 | if( level > 0 ){ 94 | buffer=buffer.trim(); 95 | } 96 | if( insideOfComment ){ 97 | appendIndents(""); 98 | buffer = processComment(buffer); 99 | while((buffer=processBuffer(buffer))!=null); 100 | }else{ 101 | appendIndents(buffer); 102 | while((buffer=processBuffer(buffer))!=null); 103 | } 104 | } 105 | 106 | String processBuffer(String buffer){ 107 | if( buffer == null ){ return null; } 108 | if( buffer.startsWith("/*")){ 109 | if( insideOfComment ){ 110 | error("comment inside of comment"); 111 | } 112 | insideOfComment=true; 113 | out.print(buffer.substring(0,2)); 114 | buffer=processComment(substring(buffer,2)); 115 | }else if(buffer.startsWith( "//")){ 116 | out.print(buffer); 117 | }else if(buffer.startsWith("\"")){ 118 | unfinishedStatement=true; 119 | int i=buffer.indexOf("\""); 120 | if( i == -1 ){ 121 | error("no matching ending \""); 122 | }else{ 123 | out.print(buffer.substring(0,i+1)); 124 | return buffer.substring(i+1); 125 | } 126 | }else{ 127 | for(int i=0;i(s.length()-1)){return "";} 196 | return s.substring(i); 197 | } 198 | 199 | public static boolean verify(String fileName1, String fileName2) throws IOException{ 200 | BufferedReader f1 = new BufferedReader(new FileReader(fileName1)); 201 | BufferedReader f2 = new BufferedReader(new FileReader(fileName2)); 202 | int line=0; 203 | String buf1, buf2; 204 | while((buf1=f1.readLine())!= null){ 205 | if((buf2=f2.readLine())==null){ 206 | System.err.println(fileName2+" is shorter than "+fileName1); 207 | return false; 208 | } 209 | if( !buf1.trim().equals(buf2.trim()) ){ 210 | System.err.println("Error on line "+line); 211 | System.err.println(fileName1+"='"+buf1+"'"); 212 | System.err.println(fileName2+"='"+buf2+"'"); 213 | return false; 214 | } 215 | line++; 216 | } 217 | if( (buf2 = f2.readLine()) != null ){ 218 | System.err.println(fileName1+" is shorter than "+fileName2); 219 | return false; 220 | } 221 | return true; 222 | } 223 | } 224 | 225 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/tools/gen_code/mcpp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualritz/ta-lib-rs/62d24c6900887f70edbc139e3a4e565df5ac74ef/ta-lib-sys/ta-lib-0.4.0/src/tools/gen_code/mcpp.exe -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/tools/ta_regtest/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | # ta_regrest is used for testing and should 3 | # not be installed. 4 | noinst_PROGRAMS = ta_regtest 5 | 6 | ta_regtest_SOURCES = ta_regtest.c \ 7 | test_data.c \ 8 | test_util.c \ 9 | test_abstract.c \ 10 | ta_test_func/test_adx.c \ 11 | ta_test_func/test_mom.c \ 12 | ta_test_func/test_sar.c \ 13 | ta_test_func/test_rsi.c \ 14 | ta_test_func/test_candlestick.c \ 15 | ta_test_func/test_per_ema.c \ 16 | ta_test_func/test_per_hlc.c \ 17 | ta_test_func/test_stoch.c \ 18 | ta_test_func/test_macd.c \ 19 | ta_test_func/test_minmax.c \ 20 | ta_test_func/test_per_hlcv.c \ 21 | ta_test_func/test_1in_1out.c \ 22 | ta_test_func/test_1in_2out.c \ 23 | ta_test_func/test_per_ohlc.c \ 24 | ta_test_func/test_stddev.c \ 25 | ta_test_func/test_bbands.c \ 26 | ta_test_func/test_ma.c \ 27 | ta_test_func/test_po.c \ 28 | ta_test_func/test_per_hl.c \ 29 | ta_test_func/test_trange.c \ 30 | test_internals.c 31 | 32 | ta_regtest_CPPFLAGS = -I../../ta_func \ 33 | -I../../ta_common/trio \ 34 | -I../../ta_common/mt \ 35 | -I../../ta_common \ 36 | -I../../ta_abstract 37 | ta_regtest_LDFLAGS = -L../.. -lta_lib \ 38 | -lm 39 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/tools/ta_regtest/ReadMe.txt: -------------------------------------------------------------------------------- 1 | This directory contains the code for performing 2 | regression testing of the library. 3 | 4 | This will provide developpers a way to validate that 5 | a modificaiton to the code did not break the existing 6 | functionality. 7 | 8 | It will be helpful in particular for validating that the 9 | TA-LIB is performing as expected when ported to a new 10 | platform. 11 | 12 | Internet access is required for the test to succeed. 13 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/tools/ta_regtest/ta_test_func.h: -------------------------------------------------------------------------------- 1 | #ifndef TA_TEST_FUNC_H 2 | #define TA_TEST_FUNC_H 3 | 4 | ErrorNumber test_candlestick ( TA_History *history ); 5 | ErrorNumber test_func_adx ( TA_History *history ); 6 | ErrorNumber test_func_ma ( TA_History *history ); 7 | ErrorNumber test_func_trange ( TA_History *history ); 8 | ErrorNumber test_func_rsi ( TA_History *history ); 9 | ErrorNumber test_func_po ( TA_History *history ); 10 | ErrorNumber test_func_macd ( TA_History *history ); 11 | ErrorNumber test_func_stddev ( TA_History *history ); 12 | ErrorNumber test_func_bbands ( TA_History *history ); 13 | ErrorNumber test_func_mom_roc ( TA_History *history ); 14 | ErrorNumber test_func_stoch ( TA_History *history ); 15 | ErrorNumber test_func_minmax ( TA_History *history ); 16 | ErrorNumber test_func_per_ema ( TA_History *history ); 17 | ErrorNumber test_func_per_hl ( TA_History *history ); 18 | ErrorNumber test_func_per_hlc ( TA_History *history ); 19 | ErrorNumber test_func_per_hlcv( TA_History *history ); 20 | ErrorNumber test_func_per_ohlc( TA_History *history ); 21 | ErrorNumber test_func_per ( TA_History *history ); 22 | ErrorNumber test_func_sar ( TA_History *history ); 23 | ErrorNumber test_func_1in_1out( TA_History *history ); 24 | ErrorNumber test_func_1in_2out( TA_History *history ); 25 | 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/src/tools/ta_regtest/ta_test_priv.h: -------------------------------------------------------------------------------- 1 | #ifndef TA_TEST_PRIV_H 2 | #define TA_TEST_PRIV_H 3 | 4 | #ifndef TA_LIBC_H 5 | #include "ta_libc.h" 6 | #endif 7 | 8 | #ifndef TA_ERROR_NUMBER_H 9 | #include "ta_error_number.h" 10 | #endif 11 | 12 | typedef struct 13 | { 14 | unsigned int nbBars; /* Nb of element into the following arrays. */ 15 | 16 | /* The arrays containing data. Unused array are set to NULL. */ 17 | TA_Real *open; 18 | TA_Real *high; 19 | TA_Real *low; 20 | TA_Real *close; 21 | TA_Real *volume; 22 | TA_Real *openInterest; 23 | } TA_History; 24 | 25 | ErrorNumber test_internals( void ); 26 | ErrorNumber test_abstract( void ); 27 | 28 | ErrorNumber freeLib( void ); 29 | ErrorNumber allocLib( void ); 30 | 31 | void reportError( const char *str, TA_RetCode retCode ); 32 | 33 | /* Global Temporary Used by the ta_func_xxx function. */ 34 | 35 | 36 | typedef struct 37 | { 38 | TA_Real *in; 39 | 40 | TA_Real *out0; 41 | TA_Real *out1; 42 | TA_Real *out2; 43 | } TestBuffer; 44 | 45 | 46 | /* That's quite a lot of global data, but who cares for 47 | * regression testing... it simplify memory alloc/dealloc. 48 | */ 49 | #define NB_GLOBAL_BUFFER 5 50 | extern TestBuffer gBuffer[NB_GLOBAL_BUFFER]; 51 | 52 | /* Maximum number of element that can be written 53 | * at a gBuffer[n].ptr 54 | */ 55 | #define MAX_NB_TEST_ELEMENT 280 56 | 57 | /* Must be called once to initialize the gBuffer. */ 58 | void initGlobalBuffer( void ); 59 | 60 | /* Will set to NAN all elements of gBuffer. */ 61 | void clearAllBuffers( void ); 62 | 63 | /* Initialize the 'gBuffer[i].in' with the provided data. */ 64 | void setInputBuffer( unsigned int i, const TA_Real *data, unsigned int nbElement ); 65 | 66 | /* Same as setInputBuffer but fill with a single value. */ 67 | void setInputBufferValue( unsigned int i, const TA_Real data, unsigned int nbElement ); 68 | 69 | /* Check that a buffer (within a TestBuffer) is not containing 70 | * NAN within the specified range (it also checks that all value 71 | * outside the range are untouched). 72 | * 73 | * Return TA_TEST_PASS if all ok. 74 | */ 75 | ErrorNumber checkForNAN( const TA_Real *buffer, 76 | unsigned int nbElement ); 77 | 78 | /* Check that the 'data' is equal to the provided 79 | * originalInput. 80 | * 81 | * The data must be one of the 'gBuffer[n].buffer'. 82 | * 83 | * It is also checked that all value outside of the 84 | * nbElement range are not-a-number. 85 | * 86 | * Return TA_TEST_PASS if no difference are found. 87 | */ 88 | ErrorNumber checkDataSame( const TA_Real *data, 89 | const TA_Real *originalInput, 90 | unsigned int nbElement ); 91 | 92 | /* Check that the content of the first buffer 93 | * is found in the second buffer (when the elements 94 | * in the first buffer is NAN, no check is done for 95 | * this paricular element). 96 | * 97 | * Return TA_TEST_PASS if no difference are found. 98 | */ 99 | ErrorNumber checkSameContent( TA_Real *buffer1, 100 | TA_Real *buffer2 ); 101 | 102 | ErrorNumber checkExpectedValue( const TA_Real *data, 103 | TA_RetCode retCode, TA_RetCode expectedRetCode, 104 | unsigned int outBegIdx, unsigned int expectedBegIdx, 105 | unsigned int outNbElement, unsigned int expectedNbElement, 106 | TA_Real oneOfTheExpectedOutReal, 107 | unsigned int oneOfTheExpectedOutRealIndex ); 108 | 109 | #define CHECK_EXPECTED_VALUE(bufid,id) \ 110 | { \ 111 | errNb = checkExpectedValue( bufid, \ 112 | retCode, test->expectedRetCode, \ 113 | outBegIdx, test->expectedBegIdx, \ 114 | outNbElement, test->expectedNbElement, \ 115 | test->oneOfTheExpectedOutReal##id, \ 116 | test->oneOfTheExpectedOutRealIndex##id ); \ 117 | if( errNb != TA_TEST_PASS ) \ 118 | { \ 119 | printf( "Fail for output id=%d\n", id ); \ 120 | return errNb; \ 121 | } \ 122 | } 123 | 124 | #define CLEAR_EXPECTED_VALUE(id) \ 125 | { \ 126 | retCode = TA_INTERNAL_ERROR(127); \ 127 | outBegIdx = 0;\ 128 | outNbElement = 0;\ 129 | } 130 | 131 | 132 | /* A systematic test can be done for most of the possible 133 | * range that a TA function can be called with. This test 134 | * is common to all TA function and can be easily done 135 | * with a RangeTestFunction. 136 | * 137 | * The RangeTestFunction is making abstraction of the 138 | * TA function (handles the inputs, the parameters etc...) 139 | * The RangeTestFunction must call the TA function for 140 | * the requested startIdx/endIdx range and put the output 141 | * in the provided buffer. 142 | * 143 | * The RangeTestFunction must also set the outBegIdx and 144 | * outNbElement for verification. 145 | * 146 | * Opaque data (for mostly passing optional parameters) are 147 | * pass through the pointer 'void * opaqueData'. 148 | * 149 | * The output of the function must be put in the outputBuffer 150 | * or outputBufferInt depending of the return type. 151 | */ 152 | #define MAX_RANGE_SIZE 252 153 | #define MAX_RANGE_END (MAX_RANGE_SIZE-1) 154 | 155 | typedef TA_RetCode (*RangeTestFunction)( TA_Integer startIdx, 156 | TA_Integer endIdx, 157 | TA_Real *outputBuffer, 158 | TA_Integer *outputBufferInt, 159 | TA_Integer *outBegIdx, 160 | TA_Integer *outNbElement, 161 | TA_Integer *lookback, 162 | void *opaqueData, 163 | unsigned int outputNb, 164 | unsigned int *isOutputInteger ); 165 | 166 | /* This is the function starting the range tests. 167 | * The parameter 'nbOutput' allows to repeat the 168 | * tests indepedently for each outputs. 169 | * 170 | * A lot of coherency tests are performed, 171 | * including comparing that the same value are 172 | * returned even when using a different startIdx 173 | * and endIdx. 174 | * 175 | * Because of the complexity added by algorithm that 176 | * have an unstable period, the comparison is 177 | * done using a tolerance algorithm (see test_util.c). 178 | * 179 | * Comparison can be ignored by specifiying 180 | * an integerTolerance == TA_DO_NOT_COMPARE 181 | * 182 | * Even without comparison, a lot of coherency 183 | * tests are still performed (like making sure the 184 | * lookback function is coherent with its TA function). 185 | * 186 | * In the case that the TA function output are 187 | * integer, the integerTolerance indicate by how much 188 | * the value can vary for a function having an 189 | * unstable period. Example: If 2 is pass, the 190 | * value can vary of no more or less 2. 191 | * When passing zero, the tolerance is done using 192 | * a "reasonable" logic using double calculation (see 193 | * test_util.c for more info). 194 | */ 195 | #define TA_DO_NOT_COMPARE 0xFFFFFFFF 196 | ErrorNumber doRangeTest( RangeTestFunction testFunction, 197 | TA_FuncUnstId unstId, 198 | void *opaqueData, 199 | unsigned int nbOutput, 200 | unsigned int integerTolerance ); 201 | 202 | /* Print out info about a retCode */ 203 | void printRetCode( TA_RetCode retCode ); 204 | 205 | /* Function to print character to show that the software is still alive. */ 206 | void showFeedback(void); 207 | void hideFeedback(void); 208 | 209 | #endif 210 | 211 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/ta-lib-config.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | usage="\ 4 | Usage: ta-lib-config [--version] [--libs] [--cflags]" 5 | 6 | if test $# -eq 0; then 7 | echo "${usage}" 1>&2 8 | exit 1 9 | fi 10 | 11 | while test $# -gt 0; do 12 | case $1 in 13 | --version) 14 | echo @VERSION@ 15 | ;; 16 | --cflags) 17 | echo -I@includedir@/ta-lib @DEFS@ 18 | ;; 19 | --libs) 20 | echo -L@libdir@ @LIBS@ 21 | ;; 22 | *) 23 | echo "${usage}" 1>&2 24 | exit 1 25 | ;; 26 | esac 27 | shift 28 | done 29 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/ta-lib.dpkg.in: -------------------------------------------------------------------------------- 1 | Package: ta-lib 2 | Version: @VERSION@ 3 | Section: dev-libs 4 | Priority: optional 5 | Architecture: i686 6 | Essential: no 7 | Depends: 8 | Pre-Depends: 9 | Recommends: 10 | Suggests: 11 | Installed-Size: 3700000 12 | Maintainer: Mario Fortier [mfortier@ta-lib.org] 13 | Conflicts: 14 | Replaces: 15 | Provides: 16 | Description: TA-Lib provides common functions for the technical analysis of stock/future/commodity market data. 17 | -------------------------------------------------------------------------------- /ta-lib-sys/ta-lib-0.4.0/ta-lib.spec.in: -------------------------------------------------------------------------------- 1 | Summary: Technical Analysis Library 2 | Name: ta-lib 3 | Version: @VERSION@ 4 | Release: 1 5 | License: BSD 6 | Group: Development/Libraries 7 | 8 | %description 9 | TA-Lib provides common functions for the technical analysis of stock/future/commodity market data. 10 | 11 | %build 12 | ./autogen.sh 13 | CFLAGS="-g0 -O3 -pipe" ./configure --prefix=/usr 14 | make 15 | 16 | %install 17 | rm -rf $RPM_BUILD_ROOT 18 | make DESTDIR=$RPM_BUILD_ROOT install 19 | 20 | %post -p /sbin/ldconfig 21 | %postun -p /sbin/ldconfig 22 | 23 | %files 24 | %defattr(-,root,root) 25 | /usr 26 | -------------------------------------------------------------------------------- /ta-lib-sys/wrapper.h: -------------------------------------------------------------------------------- 1 | #include "ta-lib/ta_abstract.h" 2 | #include "ta-lib/ta_common.h" 3 | #include "ta-lib/ta_defs.h" 4 | #include "ta-lib/ta_func.h" 5 | #include "ta-lib/ta_libc.h" 6 | -------------------------------------------------------------------------------- /ta-lib/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ta-lib" 3 | version = "0.1.2" 4 | edition = "2021" 5 | authors = ["Moritz Moeller "] 6 | description = "High level Rust wrapper for TA-lib" 7 | keywords = ["ta-lib", "technical-analysis", "indicator", "trading", "financial-market"] 8 | categories = ["api-bindings"] 9 | license = "Apache-2.0 OR BSD-3-Clause OR MIT OR Zlib" 10 | readme = "README.md" 11 | homepage = "https://ta-lib.org/" 12 | repository = "https://github.com/virtualritz/ta-lib-rs/" 13 | documentation = "https://docs.rs/ta-lib/" 14 | 15 | [features] 16 | use_system_lib = ["ta-lib-sys/use_system_lib"] 17 | 18 | [dependencies] 19 | concat-idents = "1.1.4" 20 | ta-lib-sys = "0.1.2" 21 | -------------------------------------------------------------------------------- /ta-lib/README.md: -------------------------------------------------------------------------------- 1 | # `ta-lib` 2 | 3 | High level Rust wrapper around the Technical Analysis library. 4 | ## Caveat 5 | 6 | This crate only exposes the functions I need myself from the original TA lib. 7 | Which has around 200 of them. Feel free to expose more and open a PR. Wrapping 8 | a missing indicator is usually a one line addition with the existing wrapper 9 | generation macros in the crate. 10 | 11 | The following indicators are currently wrapped: 12 | 13 | * ADX – Average Directional (Movement) Index. 14 | * ATR – Average True Range. 15 | * BBANDS – Bollinger Bands. 16 | * -DI – Minus Directional Indicator. 17 | * +DI – Plus Directional Indicator. 18 | * EMA – Exponential Moving Average. 19 | * NATR – Normalized Average True Range. 20 | * OBV – On Balance Volume. 21 | * SMA – Simple Moving Average. 22 | * TRANGE – True Range. 23 | 24 | ## Alternatives 25 | 26 | I sugget using the [`ta`](https://crates.io/crates/ta/) crate instead, which is 27 | a rewrite in Rust of *some* parts of TA but with better ergonomics than this 28 | crate. But it also only implements parts of the original TA lib indicators. 29 | 30 | I.e. if you need to use an indicator missing from `ta` this crate may get you 31 | there quickly, as a workaround. 32 | --------------------------------------------------------------------------------