ta-indicator 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +200 -196
- data/examples/mapping.rb +15 -0
- data/lib/indicator/auto_gen.rb +158 -158
- data/lib/indicator/auto_gen/ad.rb +2 -2
- data/lib/indicator/auto_gen/ad_osc.rb +2 -2
- data/lib/indicator/auto_gen/adx.rb +2 -2
- data/lib/indicator/auto_gen/adxr.rb +2 -2
- data/lib/indicator/auto_gen/aroon.rb +2 -2
- data/lib/indicator/auto_gen/aroon_osc.rb +2 -2
- data/lib/indicator/auto_gen/atr.rb +2 -2
- data/lib/indicator/auto_gen/avg_price.rb +1 -1
- data/lib/indicator/auto_gen/bop.rb +1 -1
- data/lib/indicator/auto_gen/cci.rb +2 -2
- data/lib/indicator/auto_gen/cdl2_crows.rb +1 -1
- data/lib/indicator/auto_gen/cdl3_black_crows.rb +1 -1
- data/lib/indicator/auto_gen/cdl3_inside.rb +1 -1
- data/lib/indicator/auto_gen/cdl3_line_strike.rb +1 -1
- data/lib/indicator/auto_gen/cdl3_outside.rb +1 -1
- data/lib/indicator/auto_gen/cdl3_stars_in_south.rb +1 -1
- data/lib/indicator/auto_gen/cdl3_white_soldiers.rb +1 -1
- data/lib/indicator/auto_gen/cdl_abandoned_baby.rb +1 -1
- data/lib/indicator/auto_gen/cdl_advance_block.rb +1 -1
- data/lib/indicator/auto_gen/cdl_belt_hold.rb +1 -1
- data/lib/indicator/auto_gen/cdl_breakaway.rb +1 -1
- data/lib/indicator/auto_gen/cdl_closing_marubozu.rb +1 -1
- data/lib/indicator/auto_gen/cdl_conceal_babys_wall.rb +1 -1
- data/lib/indicator/auto_gen/cdl_counter_attack.rb +1 -1
- data/lib/indicator/auto_gen/cdl_dark_cloud_cover.rb +1 -1
- data/lib/indicator/auto_gen/cdl_doji.rb +1 -1
- data/lib/indicator/auto_gen/cdl_doji_star.rb +1 -1
- data/lib/indicator/auto_gen/cdl_dragonfly_doji.rb +1 -1
- data/lib/indicator/auto_gen/cdl_engulfing.rb +1 -1
- data/lib/indicator/auto_gen/cdl_evening_doji_star.rb +1 -1
- data/lib/indicator/auto_gen/cdl_evening_star.rb +1 -1
- data/lib/indicator/auto_gen/cdl_gap_side_side_white.rb +1 -1
- data/lib/indicator/auto_gen/cdl_gravestone_doji.rb +1 -1
- data/lib/indicator/auto_gen/cdl_hammer.rb +1 -1
- data/lib/indicator/auto_gen/cdl_hanging_man.rb +1 -1
- data/lib/indicator/auto_gen/cdl_harami.rb +1 -1
- data/lib/indicator/auto_gen/cdl_harami_cross.rb +1 -1
- data/lib/indicator/auto_gen/cdl_hign_wave.rb +1 -1
- data/lib/indicator/auto_gen/cdl_hikkake.rb +1 -1
- data/lib/indicator/auto_gen/cdl_hikkake_mod.rb +1 -1
- data/lib/indicator/auto_gen/cdl_homing_pigeon.rb +1 -1
- data/lib/indicator/auto_gen/cdl_identical3_crows.rb +1 -1
- data/lib/indicator/auto_gen/cdl_in_neck.rb +1 -1
- data/lib/indicator/auto_gen/cdl_inverted_hammer.rb +1 -1
- data/lib/indicator/auto_gen/cdl_kicking.rb +1 -1
- data/lib/indicator/auto_gen/cdl_kicking_by_length.rb +1 -1
- data/lib/indicator/auto_gen/cdl_ladder_bottom.rb +1 -1
- data/lib/indicator/auto_gen/cdl_long_legged_doji.rb +1 -1
- data/lib/indicator/auto_gen/cdl_long_line.rb +1 -1
- data/lib/indicator/auto_gen/cdl_marubozu.rb +1 -1
- data/lib/indicator/auto_gen/cdl_mat_hold.rb +1 -1
- data/lib/indicator/auto_gen/cdl_matching_low.rb +1 -1
- data/lib/indicator/auto_gen/cdl_morning_doji_star.rb +1 -1
- data/lib/indicator/auto_gen/cdl_morning_star.rb +1 -1
- data/lib/indicator/auto_gen/cdl_on_neck.rb +1 -1
- data/lib/indicator/auto_gen/cdl_piercing.rb +1 -1
- data/lib/indicator/auto_gen/cdl_rickshaw_man.rb +1 -1
- data/lib/indicator/auto_gen/cdl_rise_fall3_methods.rb +1 -1
- data/lib/indicator/auto_gen/cdl_seperating_lines.rb +1 -1
- data/lib/indicator/auto_gen/cdl_shooting_star.rb +1 -1
- data/lib/indicator/auto_gen/cdl_short_line.rb +1 -1
- data/lib/indicator/auto_gen/cdl_spinning_top.rb +1 -1
- data/lib/indicator/auto_gen/cdl_stalled_pattern.rb +1 -1
- data/lib/indicator/auto_gen/cdl_stick_sandwhich.rb +1 -1
- data/lib/indicator/auto_gen/cdl_takuri.rb +1 -1
- data/lib/indicator/auto_gen/cdl_tasuki_gap.rb +1 -1
- data/lib/indicator/auto_gen/cdl_thrusting.rb +1 -1
- data/lib/indicator/auto_gen/cdl_tristar.rb +1 -1
- data/lib/indicator/auto_gen/cdl_unique3_river.rb +1 -1
- data/lib/indicator/auto_gen/cdl_upside_gap2_crows.rb +1 -1
- data/lib/indicator/auto_gen/cdl_x_side_gap3_methods.rb +1 -1
- data/lib/indicator/auto_gen/dx.rb +2 -2
- data/lib/indicator/auto_gen/med_price.rb +2 -2
- data/lib/indicator/auto_gen/mfi.rb +2 -2
- data/lib/indicator/auto_gen/mid_price.rb +2 -2
- data/lib/indicator/auto_gen/minus_di.rb +2 -2
- data/lib/indicator/auto_gen/minus_dm.rb +2 -2
- data/lib/indicator/auto_gen/natr.rb +2 -2
- data/lib/indicator/auto_gen/obv.rb +6 -5
- data/lib/indicator/auto_gen/plus_di.rb +2 -2
- data/lib/indicator/auto_gen/plus_dm.rb +2 -2
- data/lib/indicator/auto_gen/sar.rb +2 -2
- data/lib/indicator/auto_gen/sar_ext.rb +2 -2
- data/lib/indicator/auto_gen/stoch.rb +2 -2
- data/lib/indicator/auto_gen/stoch_f.rb +2 -2
- data/lib/indicator/auto_gen/true_range.rb +2 -2
- data/lib/indicator/auto_gen/typ_price.rb +2 -2
- data/lib/indicator/auto_gen/ult_osc.rb +2 -2
- data/lib/indicator/auto_gen/wcl_price.rb +2 -2
- data/lib/indicator/auto_gen/will_r.rb +2 -2
- data/lib/indicator/base.rb +18 -0
- data/lib/indicator/data_mapper.rb +0 -20
- data/lib/indicator/version.rb +1 -1
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -1,196 +1,200 @@
|
|
1
|
-
= Technical Analysis Indicator Library
|
2
|
-
|
3
|
-
== Overview
|
4
|
-
|
5
|
-
Provides a wrapper around the talib-ruby[https://github.com/rivella50/talib-ruby] library which is a ruby wrapper for the ta-lib[http://ta-lib.org/] library.
|
6
|
-
|
7
|
-
This library has been designed to make interfacing with the ta-lib functions easy by wrapping each function in a ruby class.
|
8
|
-
|
9
|
-
The wrappers are autogenerated from the xml function description provided with the ta-lib project.
|
10
|
-
|
11
|
-
== Usage
|
12
|
-
|
13
|
-
Requires the talib-ruby gem. The examples require the yahoofinance gem.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
Indicator.
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
or
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
=>
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
=> [
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
=> [:
|
117
|
-
|
118
|
-
=> [:
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
=> [nil, nil,
|
129
|
-
|
130
|
-
|
131
|
-
puts
|
132
|
-
=> [nil, nil, -
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
=> [
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
sma
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
The
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
1
|
+
= Technical Analysis Indicator Library
|
2
|
+
|
3
|
+
== Overview
|
4
|
+
|
5
|
+
Provides a wrapper around the talib-ruby[https://github.com/rivella50/talib-ruby] library which is a ruby wrapper for the ta-lib[http://ta-lib.org/] library.
|
6
|
+
|
7
|
+
This library has been designed to make interfacing with the ta-lib functions easy by wrapping each function in a ruby class.
|
8
|
+
|
9
|
+
The wrappers are autogenerated from the xml function description provided with the ta-lib project.
|
10
|
+
|
11
|
+
== Usage
|
12
|
+
|
13
|
+
Requires the talib-ruby gem. The examples require the yahoofinance gem.
|
14
|
+
|
15
|
+
Install via gem using:
|
16
|
+
|
17
|
+
gem install ta-indicator
|
18
|
+
|
19
|
+
=== Simple Example
|
20
|
+
The easiest way to use the indicator library is to include the indicator mixin module. This module extends the Array class with the Indicator::Mixin module allowing quick calculations to be performed:
|
21
|
+
|
22
|
+
require 'indicator/mixin'
|
23
|
+
|
24
|
+
data = [1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3]
|
25
|
+
results = data.indicator(:sma, :time_period => 5)
|
26
|
+
results = data.indicator(:sma, 5)
|
27
|
+
results = data.indicator(:sma_5)
|
28
|
+
|
29
|
+
All perform a simple moving average with time period of 5 and produce the same results:
|
30
|
+
|
31
|
+
=> [nil, nil, nil, nil, 2.2, 2.4, 2.6, 2.4, 2.6, 2.4, 2.6]
|
32
|
+
|
33
|
+
More complex indicators can also be used
|
34
|
+
|
35
|
+
result = data.indicator(:macd_12_26_9)
|
36
|
+
|
37
|
+
This performs a macd calculation using a slow period of 12, fast period of 26 and signal period of 9.
|
38
|
+
|
39
|
+
The list of available indicators can be retrieved via
|
40
|
+
|
41
|
+
Indicator.list
|
42
|
+
|
43
|
+
Information about each indicator including a list of arguments can be retrieved via:
|
44
|
+
|
45
|
+
Indicator.info :sma
|
46
|
+
Inficator.info :macd
|
47
|
+
...
|
48
|
+
|
49
|
+
== Details
|
50
|
+
The base Indicator functions are located in the Indicator module and the auto generated classed are located in the Indicator::AutoGen module. All of the following examples assume these modules have been included:
|
51
|
+
|
52
|
+
require 'indicator'
|
53
|
+
include Indicator
|
54
|
+
include Indicator::AutoGen
|
55
|
+
|
56
|
+
=== Class Construction
|
57
|
+
|
58
|
+
All ta-lib functions are wrapped in a class named using the camel class name of the function: SMA is Sma, AVGPRICE is AvgPrice, etc. The constructor takes the optional arguments either as a hash or argument list. For example the Macd class takes three arguments, fast_period, slow_period and signal_period. They can be initialised in any of the following ways:
|
59
|
+
|
60
|
+
sma = Sma.new 5
|
61
|
+
macd = Macd.new 12,26,9
|
62
|
+
or
|
63
|
+
sma = Sma.new :time_period => 5
|
64
|
+
macd = Macd.new :fast_period => 12, :slow_period => 26, :signal_period => 9
|
65
|
+
|
66
|
+
If a parameter is not passed in then it will be initialised to the default value as specified by the ta-lib interface.
|
67
|
+
|
68
|
+
The Indicator module also supports factory style functions to simplify class creation.
|
69
|
+
|
70
|
+
sma = Indicator.create :sma
|
71
|
+
sma = Indicator.create :sma, 5
|
72
|
+
sma = Indicator.create :sma, time_period => 5
|
73
|
+
|
74
|
+
macd = Indicator.create :macd
|
75
|
+
macd = Indicator.create :macd, 12,26,9
|
76
|
+
macd = Indicator.create :macd, :fast_period => 12, :slow_period => 26, :signal_period => 9
|
77
|
+
|
78
|
+
If a indicator is to be constructed using only integer parameters then an indicator can be constructed using the create_named factory function. The create_named function expects the indicator name optionally followed by it's arguments joined by an underscore.
|
79
|
+
|
80
|
+
sma = Indicator.create_named :sma_5
|
81
|
+
macd = Indicator.create_named :macd_12_26_9
|
82
|
+
|
83
|
+
=== Argument attributes
|
84
|
+
|
85
|
+
All arguments can be updated through attributes:
|
86
|
+
macd.fast_period
|
87
|
+
=> 12
|
88
|
+
macd.slow_period = 30
|
89
|
+
=> 30
|
90
|
+
|
91
|
+
A list of all the arguments that a particular class takes can be be retrieved using the class method 'arguments'.
|
92
|
+
Macd.arguments
|
93
|
+
=> [:fast_period, :slow_period, :signal_period]
|
94
|
+
Sma.arguments
|
95
|
+
=> [:time_period]
|
96
|
+
|
97
|
+
=== Running The Indicators
|
98
|
+
Each indicator defines a run method that takes in each input array to be processed as a List. An example of an indicator that takes one input:
|
99
|
+
sma = Indicator.create_named :sma_5
|
100
|
+
sma.run [1,2,3,4,3,2,3,2,3,2,3,2]
|
101
|
+
=> [nil, nil, nil, nil, 2.6, 2.8, 3.0, 2.8, 2.6, 2.4, 2.6, 2.4]
|
102
|
+
|
103
|
+
An example of an indicator that takes two inputs:
|
104
|
+
add = Indicator.create_named :add
|
105
|
+
add.run [1,2,3,4,5], [5,4,3,2,1]
|
106
|
+
=> [6.0, 6.0, 6.0, 6.0, 6.0]
|
107
|
+
|
108
|
+
Some indicators require OHLC (and optionally V) price inputs. An example of an indicator that takes price inputs:
|
109
|
+
avg = AvgPrice.new
|
110
|
+
# AvgPrice run function takes open, high, low, close
|
111
|
+
avg.run [1,2,1,2], [2,1,2,1], [3,1,3,1], [1,3,1,3]
|
112
|
+
=> [1.75, 1.75, 1.75, 1.75]
|
113
|
+
|
114
|
+
A list of inputs that a indicator run function requires can be retrieved using the class method 'inputs'.
|
115
|
+
Sma.inputs
|
116
|
+
=> [:in_real]
|
117
|
+
Add.inputs
|
118
|
+
=> [:in_real0, in_real1]
|
119
|
+
AvgPrice.inputs
|
120
|
+
=> [:open, :high, :low, :close]
|
121
|
+
AdOsc.inputs
|
122
|
+
=> [:open, :high, :low, :close, :volume]
|
123
|
+
|
124
|
+
=== Outputs
|
125
|
+
The run function returns an array containing the results if there is only one List to return otherwise it returns a hash that maps each output List to it's name. For eample:
|
126
|
+
sma = Sma.new(5)
|
127
|
+
sma.run [1,2,3,4,3,2,3,2,3,2,3,2]
|
128
|
+
=> [nil, nil, nil, nil, 2.6, 2.8, 3.0, 2.8, 2.6, 2.4, 2.6, 2.4]
|
129
|
+
macd = Macd.new 3,4,1
|
130
|
+
result = macd.run [1,2,3,4,4,3]
|
131
|
+
puts results[:out_macd]
|
132
|
+
=> [nil, nil, -3.785768566076978e-270, 0.5, nil, nil]
|
133
|
+
puts result[:out_macd_signal]
|
134
|
+
=> [nil, nil, 0.399999999999999, 0.189999999999999, nil, nil],
|
135
|
+
puts result[:out_macd_hist]
|
136
|
+
=> [nil, nil, -0.3999999999999999, 0.31000000000000005, nil, nil]
|
137
|
+
|
138
|
+
A list of outputs that an indicator run function returns can be retrieved using the class method 'outputs'.
|
139
|
+
Sma.outputs
|
140
|
+
=> [:out_real]
|
141
|
+
Macd.outputs
|
142
|
+
=> [:out_macd, :out_macd_signal, :out_macd_hist]
|
143
|
+
|
144
|
+
=== Data Mapping
|
145
|
+
The run function also accepts a DataMapping::Map structure which can be used to extract data from an enumerable collection.
|
146
|
+
|
147
|
+
# Assume historical_data is a list of hashes with the following keys
|
148
|
+
# :open, :high, :low, :close, :volume
|
149
|
+
sma = Sma.new 5
|
150
|
+
sma_results = sma.run(DataMapper::Map.new(historical_data, :open))
|
151
|
+
|
152
|
+
When the above example is run the DataMapper will attempt to extract data from the historical_data collection by either calling a function called open or retrieving a hash value using the key :open. You can also directly pass in a lambda function if a more complex mapping function is required.
|
153
|
+
To reduce the amount of code required a helper function called new_map is available:
|
154
|
+
|
155
|
+
sma = Sma.new 5
|
156
|
+
sma_results = sma.run new_map(historical_data, :open)
|
157
|
+
sma_results = sma.run new_map(historical_data, lambda => |b| { b[:open] / 2 })
|
158
|
+
|
159
|
+
By default the run function will attempt to use a default getter of :open, so the following is also valid:
|
160
|
+
|
161
|
+
sma = Sma.new 5
|
162
|
+
sma_results = sma.run historical_data
|
163
|
+
# Calculates the sma by accessing [:open] on each element of historical_data
|
164
|
+
|
165
|
+
The default getter can be changed:
|
166
|
+
sma = Sma.new 5
|
167
|
+
sma.default_getter :high
|
168
|
+
sma_results = sma.run historical_data
|
169
|
+
# Calculates the sma by accessing [:high] on each element of historical_data
|
170
|
+
|
171
|
+
The same mapping system works for functions requiring price data as an input. The AvgPrice function can be called using either of the following syntax:
|
172
|
+
|
173
|
+
ap = AvgPrice.new
|
174
|
+
ap.run(
|
175
|
+
new_map(historical_data, :open),
|
176
|
+
new_map(historical_data, :high),
|
177
|
+
new_map(historical_data, :low),
|
178
|
+
new_map(historical_data, :close))
|
179
|
+
|
180
|
+
or
|
181
|
+
|
182
|
+
ap = AvgPrice.new
|
183
|
+
ap.run historical_data
|
184
|
+
|
185
|
+
The run function will again attempt to use sensible default mappings of :open, :high, :low, :close and :volume (if required).
|
186
|
+
|
187
|
+
== Regenerating the wrappers
|
188
|
+
|
189
|
+
The wrappers can be regenerated using the gen_wrapper.rb file in the tools directory:
|
190
|
+
|
191
|
+
ruby gen_wrapper.rb
|
192
|
+
|
193
|
+
This script must be run from the tools directory as it uses realtive paths.
|
194
|
+
The gen_wrapper.rb script uses the erb library to generate code from the defined templates.
|
195
|
+
|
196
|
+
== Copyright
|
197
|
+
|
198
|
+
Copyright (c) 2012 Michael Lamb. See LICENSE for details.
|
199
|
+
|
200
|
+
The files ta_func_api.xml and ta_func_api.xsd are from the talib library. The license details are contained within LICENSE-ta-lib.
|
data/examples/mapping.rb
CHANGED
@@ -13,6 +13,16 @@ def bar_to_hash r
|
|
13
13
|
h
|
14
14
|
end
|
15
15
|
|
16
|
+
def short_hash r
|
17
|
+
h = {}
|
18
|
+
h[:date] = r[:date]
|
19
|
+
h[:high] = r[:high]
|
20
|
+
h[:low] = r[:low]
|
21
|
+
h[:close] = r[:close]
|
22
|
+
h[:volume] = r[:volume]
|
23
|
+
h
|
24
|
+
end
|
25
|
+
|
16
26
|
def get_data_100 ticker
|
17
27
|
YahooFinance::get_historical_quotes_days(ticker, 100)
|
18
28
|
end
|
@@ -20,6 +30,7 @@ end
|
|
20
30
|
puts 'Retrieving historical data'
|
21
31
|
cba = get_data_100("CBA.AX").inject([]) { |lst, q| lst << bar_to_hash(q) }
|
22
32
|
nab = get_data_100("NAB.AX").inject([]) { |lst, q| lst << bar_to_hash(q) }
|
33
|
+
nab_no_open = nab.inject([]) { |lst, q| lst << short_hash(q) }
|
23
34
|
|
24
35
|
sma = Indicator.create_named :sma_13
|
25
36
|
sma_results = sma.run(Indicator::DataMapper::Map.new(cba, :open))
|
@@ -32,6 +43,10 @@ sub = Indicator.create :sub
|
|
32
43
|
sub.default_getter = :low
|
33
44
|
sub_results = sub.run cba, nab
|
34
45
|
|
46
|
+
stoch = Indicator.create :stoch
|
47
|
+
stoch_results = stoch.run nab
|
48
|
+
stoch_results = stoch.run nab_no_open
|
49
|
+
|
35
50
|
adx = Indicator.create :adx
|
36
51
|
adx_results = adx.run(
|
37
52
|
new_map(nab, :open),
|
data/lib/indicator/auto_gen.rb
CHANGED
@@ -3,161 +3,161 @@ module Indicator
|
|
3
3
|
end
|
4
4
|
end
|
5
5
|
|
6
|
-
require 'indicator
|
7
|
-
require 'indicator
|
8
|
-
require 'indicator
|
9
|
-
require 'indicator
|
10
|
-
require 'indicator
|
11
|
-
require 'indicator
|
12
|
-
require 'indicator
|
13
|
-
require 'indicator
|
14
|
-
require 'indicator
|
15
|
-
require 'indicator
|
16
|
-
require 'indicator
|
17
|
-
require 'indicator
|
18
|
-
require 'indicator
|
19
|
-
require 'indicator
|
20
|
-
require 'indicator
|
21
|
-
require 'indicator
|
22
|
-
require 'indicator
|
23
|
-
require 'indicator
|
24
|
-
require 'indicator
|
25
|
-
require 'indicator
|
26
|
-
require 'indicator
|
27
|
-
require 'indicator
|
28
|
-
require 'indicator
|
29
|
-
require 'indicator
|
30
|
-
require 'indicator
|
31
|
-
require 'indicator
|
32
|
-
require 'indicator
|
33
|
-
require 'indicator
|
34
|
-
require 'indicator
|
35
|
-
require 'indicator
|
36
|
-
require 'indicator
|
37
|
-
require 'indicator
|
38
|
-
require 'indicator
|
39
|
-
require 'indicator
|
40
|
-
require 'indicator
|
41
|
-
require 'indicator
|
42
|
-
require 'indicator
|
43
|
-
require 'indicator
|
44
|
-
require 'indicator
|
45
|
-
require 'indicator
|
46
|
-
require 'indicator
|
47
|
-
require 'indicator
|
48
|
-
require 'indicator
|
49
|
-
require 'indicator
|
50
|
-
require 'indicator
|
51
|
-
require 'indicator
|
52
|
-
require 'indicator
|
53
|
-
require 'indicator
|
54
|
-
require 'indicator
|
55
|
-
require 'indicator
|
56
|
-
require 'indicator
|
57
|
-
require 'indicator
|
58
|
-
require 'indicator
|
59
|
-
require 'indicator
|
60
|
-
require 'indicator
|
61
|
-
require 'indicator
|
62
|
-
require 'indicator
|
63
|
-
require 'indicator
|
64
|
-
require 'indicator
|
65
|
-
require 'indicator
|
66
|
-
require 'indicator
|
67
|
-
require 'indicator
|
68
|
-
require 'indicator
|
69
|
-
require 'indicator
|
70
|
-
require 'indicator
|
71
|
-
require 'indicator
|
72
|
-
require 'indicator
|
73
|
-
require 'indicator
|
74
|
-
require 'indicator
|
75
|
-
require 'indicator
|
76
|
-
require 'indicator
|
77
|
-
require 'indicator
|
78
|
-
require 'indicator
|
79
|
-
require 'indicator
|
80
|
-
require 'indicator
|
81
|
-
require 'indicator
|
82
|
-
require 'indicator
|
83
|
-
require 'indicator
|
84
|
-
require 'indicator
|
85
|
-
require 'indicator
|
86
|
-
require 'indicator
|
87
|
-
require 'indicator
|
88
|
-
require 'indicator
|
89
|
-
require 'indicator
|
90
|
-
require 'indicator
|
91
|
-
require 'indicator
|
92
|
-
require 'indicator
|
93
|
-
require 'indicator
|
94
|
-
require 'indicator
|
95
|
-
require 'indicator
|
96
|
-
require 'indicator
|
97
|
-
require 'indicator
|
98
|
-
require 'indicator
|
99
|
-
require 'indicator
|
100
|
-
require 'indicator
|
101
|
-
require 'indicator
|
102
|
-
require 'indicator
|
103
|
-
require 'indicator
|
104
|
-
require 'indicator
|
105
|
-
require 'indicator
|
106
|
-
require 'indicator
|
107
|
-
require 'indicator
|
108
|
-
require 'indicator
|
109
|
-
require 'indicator
|
110
|
-
require 'indicator
|
111
|
-
require 'indicator
|
112
|
-
require 'indicator
|
113
|
-
require 'indicator
|
114
|
-
require 'indicator
|
115
|
-
require 'indicator
|
116
|
-
require 'indicator
|
117
|
-
require 'indicator
|
118
|
-
require 'indicator
|
119
|
-
require 'indicator
|
120
|
-
require 'indicator
|
121
|
-
require 'indicator
|
122
|
-
require 'indicator
|
123
|
-
require 'indicator
|
124
|
-
require 'indicator
|
125
|
-
require 'indicator
|
126
|
-
require 'indicator
|
127
|
-
require 'indicator
|
128
|
-
require 'indicator
|
129
|
-
require 'indicator
|
130
|
-
require 'indicator
|
131
|
-
require 'indicator
|
132
|
-
require 'indicator
|
133
|
-
require 'indicator
|
134
|
-
require 'indicator
|
135
|
-
require 'indicator
|
136
|
-
require 'indicator
|
137
|
-
require 'indicator
|
138
|
-
require 'indicator
|
139
|
-
require 'indicator
|
140
|
-
require 'indicator
|
141
|
-
require 'indicator
|
142
|
-
require 'indicator
|
143
|
-
require 'indicator
|
144
|
-
require 'indicator
|
145
|
-
require 'indicator
|
146
|
-
require 'indicator
|
147
|
-
require 'indicator
|
148
|
-
require 'indicator
|
149
|
-
require 'indicator
|
150
|
-
require 'indicator
|
151
|
-
require 'indicator
|
152
|
-
require 'indicator
|
153
|
-
require 'indicator
|
154
|
-
require 'indicator
|
155
|
-
require 'indicator
|
156
|
-
require 'indicator
|
157
|
-
require 'indicator
|
158
|
-
require 'indicator
|
159
|
-
require 'indicator
|
160
|
-
require 'indicator
|
161
|
-
require 'indicator
|
162
|
-
require 'indicator
|
163
|
-
require 'indicator
|
6
|
+
require 'indicator\auto_gen\acos'
|
7
|
+
require 'indicator\auto_gen\ad'
|
8
|
+
require 'indicator\auto_gen\add'
|
9
|
+
require 'indicator\auto_gen\ad_osc'
|
10
|
+
require 'indicator\auto_gen\adx'
|
11
|
+
require 'indicator\auto_gen\adxr'
|
12
|
+
require 'indicator\auto_gen\apo'
|
13
|
+
require 'indicator\auto_gen\aroon'
|
14
|
+
require 'indicator\auto_gen\aroon_osc'
|
15
|
+
require 'indicator\auto_gen\asin'
|
16
|
+
require 'indicator\auto_gen\atan'
|
17
|
+
require 'indicator\auto_gen\atr'
|
18
|
+
require 'indicator\auto_gen\avg_price'
|
19
|
+
require 'indicator\auto_gen\bbands'
|
20
|
+
require 'indicator\auto_gen\beta'
|
21
|
+
require 'indicator\auto_gen\bop'
|
22
|
+
require 'indicator\auto_gen\cci'
|
23
|
+
require 'indicator\auto_gen\cdl2_crows'
|
24
|
+
require 'indicator\auto_gen\cdl3_black_crows'
|
25
|
+
require 'indicator\auto_gen\cdl3_inside'
|
26
|
+
require 'indicator\auto_gen\cdl3_line_strike'
|
27
|
+
require 'indicator\auto_gen\cdl3_outside'
|
28
|
+
require 'indicator\auto_gen\cdl3_stars_in_south'
|
29
|
+
require 'indicator\auto_gen\cdl3_white_soldiers'
|
30
|
+
require 'indicator\auto_gen\cdl_abandoned_baby'
|
31
|
+
require 'indicator\auto_gen\cdl_advance_block'
|
32
|
+
require 'indicator\auto_gen\cdl_belt_hold'
|
33
|
+
require 'indicator\auto_gen\cdl_breakaway'
|
34
|
+
require 'indicator\auto_gen\cdl_closing_marubozu'
|
35
|
+
require 'indicator\auto_gen\cdl_conceal_babys_wall'
|
36
|
+
require 'indicator\auto_gen\cdl_counter_attack'
|
37
|
+
require 'indicator\auto_gen\cdl_dark_cloud_cover'
|
38
|
+
require 'indicator\auto_gen\cdl_doji'
|
39
|
+
require 'indicator\auto_gen\cdl_doji_star'
|
40
|
+
require 'indicator\auto_gen\cdl_dragonfly_doji'
|
41
|
+
require 'indicator\auto_gen\cdl_engulfing'
|
42
|
+
require 'indicator\auto_gen\cdl_evening_doji_star'
|
43
|
+
require 'indicator\auto_gen\cdl_evening_star'
|
44
|
+
require 'indicator\auto_gen\cdl_gap_side_side_white'
|
45
|
+
require 'indicator\auto_gen\cdl_gravestone_doji'
|
46
|
+
require 'indicator\auto_gen\cdl_hammer'
|
47
|
+
require 'indicator\auto_gen\cdl_hanging_man'
|
48
|
+
require 'indicator\auto_gen\cdl_harami'
|
49
|
+
require 'indicator\auto_gen\cdl_harami_cross'
|
50
|
+
require 'indicator\auto_gen\cdl_hign_wave'
|
51
|
+
require 'indicator\auto_gen\cdl_hikkake'
|
52
|
+
require 'indicator\auto_gen\cdl_hikkake_mod'
|
53
|
+
require 'indicator\auto_gen\cdl_homing_pigeon'
|
54
|
+
require 'indicator\auto_gen\cdl_identical3_crows'
|
55
|
+
require 'indicator\auto_gen\cdl_in_neck'
|
56
|
+
require 'indicator\auto_gen\cdl_inverted_hammer'
|
57
|
+
require 'indicator\auto_gen\cdl_kicking'
|
58
|
+
require 'indicator\auto_gen\cdl_kicking_by_length'
|
59
|
+
require 'indicator\auto_gen\cdl_ladder_bottom'
|
60
|
+
require 'indicator\auto_gen\cdl_long_legged_doji'
|
61
|
+
require 'indicator\auto_gen\cdl_long_line'
|
62
|
+
require 'indicator\auto_gen\cdl_marubozu'
|
63
|
+
require 'indicator\auto_gen\cdl_matching_low'
|
64
|
+
require 'indicator\auto_gen\cdl_mat_hold'
|
65
|
+
require 'indicator\auto_gen\cdl_morning_doji_star'
|
66
|
+
require 'indicator\auto_gen\cdl_morning_star'
|
67
|
+
require 'indicator\auto_gen\cdl_on_neck'
|
68
|
+
require 'indicator\auto_gen\cdl_piercing'
|
69
|
+
require 'indicator\auto_gen\cdl_rickshaw_man'
|
70
|
+
require 'indicator\auto_gen\cdl_rise_fall3_methods'
|
71
|
+
require 'indicator\auto_gen\cdl_seperating_lines'
|
72
|
+
require 'indicator\auto_gen\cdl_shooting_star'
|
73
|
+
require 'indicator\auto_gen\cdl_short_line'
|
74
|
+
require 'indicator\auto_gen\cdl_spinning_top'
|
75
|
+
require 'indicator\auto_gen\cdl_stalled_pattern'
|
76
|
+
require 'indicator\auto_gen\cdl_stick_sandwhich'
|
77
|
+
require 'indicator\auto_gen\cdl_takuri'
|
78
|
+
require 'indicator\auto_gen\cdl_tasuki_gap'
|
79
|
+
require 'indicator\auto_gen\cdl_thrusting'
|
80
|
+
require 'indicator\auto_gen\cdl_tristar'
|
81
|
+
require 'indicator\auto_gen\cdl_unique3_river'
|
82
|
+
require 'indicator\auto_gen\cdl_upside_gap2_crows'
|
83
|
+
require 'indicator\auto_gen\cdl_x_side_gap3_methods'
|
84
|
+
require 'indicator\auto_gen\ceil'
|
85
|
+
require 'indicator\auto_gen\cmo'
|
86
|
+
require 'indicator\auto_gen\correl'
|
87
|
+
require 'indicator\auto_gen\cos'
|
88
|
+
require 'indicator\auto_gen\cosh'
|
89
|
+
require 'indicator\auto_gen\dema'
|
90
|
+
require 'indicator\auto_gen\div'
|
91
|
+
require 'indicator\auto_gen\dx'
|
92
|
+
require 'indicator\auto_gen\ema'
|
93
|
+
require 'indicator\auto_gen\exp'
|
94
|
+
require 'indicator\auto_gen\floor'
|
95
|
+
require 'indicator\auto_gen\ht_dc_period'
|
96
|
+
require 'indicator\auto_gen\ht_dc_phase'
|
97
|
+
require 'indicator\auto_gen\ht_phasor'
|
98
|
+
require 'indicator\auto_gen\ht_sine'
|
99
|
+
require 'indicator\auto_gen\ht_trendline'
|
100
|
+
require 'indicator\auto_gen\ht_trend_mode'
|
101
|
+
require 'indicator\auto_gen\kama'
|
102
|
+
require 'indicator\auto_gen\linear_reg'
|
103
|
+
require 'indicator\auto_gen\linear_reg_angle'
|
104
|
+
require 'indicator\auto_gen\linear_reg_intercept'
|
105
|
+
require 'indicator\auto_gen\linear_reg_slope'
|
106
|
+
require 'indicator\auto_gen\ln'
|
107
|
+
require 'indicator\auto_gen\log10'
|
108
|
+
require 'indicator\auto_gen\moving_average'
|
109
|
+
require 'indicator\auto_gen\macd'
|
110
|
+
require 'indicator\auto_gen\macd_ext'
|
111
|
+
require 'indicator\auto_gen\macd_fix'
|
112
|
+
require 'indicator\auto_gen\mama'
|
113
|
+
require 'indicator\auto_gen\moving_average_variable_period'
|
114
|
+
require 'indicator\auto_gen\max'
|
115
|
+
require 'indicator\auto_gen\max_index'
|
116
|
+
require 'indicator\auto_gen\med_price'
|
117
|
+
require 'indicator\auto_gen\mfi'
|
118
|
+
require 'indicator\auto_gen\mid_point'
|
119
|
+
require 'indicator\auto_gen\mid_price'
|
120
|
+
require 'indicator\auto_gen\min'
|
121
|
+
require 'indicator\auto_gen\min_index'
|
122
|
+
require 'indicator\auto_gen\min_max'
|
123
|
+
require 'indicator\auto_gen\min_max_index'
|
124
|
+
require 'indicator\auto_gen\minus_di'
|
125
|
+
require 'indicator\auto_gen\minus_dm'
|
126
|
+
require 'indicator\auto_gen\mom'
|
127
|
+
require 'indicator\auto_gen\mult'
|
128
|
+
require 'indicator\auto_gen\natr'
|
129
|
+
require 'indicator\auto_gen\obv'
|
130
|
+
require 'indicator\auto_gen\plus_di'
|
131
|
+
require 'indicator\auto_gen\plus_dm'
|
132
|
+
require 'indicator\auto_gen\ppo'
|
133
|
+
require 'indicator\auto_gen\roc'
|
134
|
+
require 'indicator\auto_gen\roc_p'
|
135
|
+
require 'indicator\auto_gen\roc_r'
|
136
|
+
require 'indicator\auto_gen\roc_r100'
|
137
|
+
require 'indicator\auto_gen\rsi'
|
138
|
+
require 'indicator\auto_gen\sar'
|
139
|
+
require 'indicator\auto_gen\sar_ext'
|
140
|
+
require 'indicator\auto_gen\sin'
|
141
|
+
require 'indicator\auto_gen\sinh'
|
142
|
+
require 'indicator\auto_gen\sma'
|
143
|
+
require 'indicator\auto_gen\sqrt'
|
144
|
+
require 'indicator\auto_gen\std_dev'
|
145
|
+
require 'indicator\auto_gen\stoch'
|
146
|
+
require 'indicator\auto_gen\stoch_f'
|
147
|
+
require 'indicator\auto_gen\stoch_rsi'
|
148
|
+
require 'indicator\auto_gen\sub'
|
149
|
+
require 'indicator\auto_gen\sum'
|
150
|
+
require 'indicator\auto_gen\t3'
|
151
|
+
require 'indicator\auto_gen\tan'
|
152
|
+
require 'indicator\auto_gen\tanh'
|
153
|
+
require 'indicator\auto_gen\tema'
|
154
|
+
require 'indicator\auto_gen\true_range'
|
155
|
+
require 'indicator\auto_gen\trima'
|
156
|
+
require 'indicator\auto_gen\trix'
|
157
|
+
require 'indicator\auto_gen\tsf'
|
158
|
+
require 'indicator\auto_gen\typ_price'
|
159
|
+
require 'indicator\auto_gen\ult_osc'
|
160
|
+
require 'indicator\auto_gen\variance'
|
161
|
+
require 'indicator\auto_gen\wcl_price'
|
162
|
+
require 'indicator\auto_gen\will_r'
|
163
|
+
require 'indicator\auto_gen\wma'
|