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
@@ -38,7 +38,7 @@ class Indicator::AutoGen::CdlMatHold < Indicator::Base
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def run(*args)
|
41
|
-
o, h, l, c, v, len = map_ohlcv(
|
41
|
+
o, h, l, c, v, len = map_ohlcv(self.class.inputs, *args)
|
42
42
|
@func.in_price(0, o, h, l, c, v, nil)
|
43
43
|
|
44
44
|
@func.opt_real(0, @penetration)
|
@@ -38,7 +38,7 @@ class Indicator::AutoGen::CdlMorningDojiStar < Indicator::Base
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def run(*args)
|
41
|
-
o, h, l, c, v, len = map_ohlcv(
|
41
|
+
o, h, l, c, v, len = map_ohlcv(self.class.inputs, *args)
|
42
42
|
@func.in_price(0, o, h, l, c, v, nil)
|
43
43
|
|
44
44
|
@func.opt_real(0, @penetration)
|
@@ -38,7 +38,7 @@ class Indicator::AutoGen::CdlMorningStar < Indicator::Base
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def run(*args)
|
41
|
-
o, h, l, c, v, len = map_ohlcv(
|
41
|
+
o, h, l, c, v, len = map_ohlcv(self.class.inputs, *args)
|
42
42
|
@func.in_price(0, o, h, l, c, v, nil)
|
43
43
|
|
44
44
|
@func.opt_real(0, @penetration)
|
@@ -29,7 +29,7 @@ class Indicator::AutoGen::Dx < Indicator::Base
|
|
29
29
|
|
30
30
|
# The minimum set of inputs required
|
31
31
|
def self.inputs
|
32
|
-
[ :
|
32
|
+
[ :high, :low, :close ]
|
33
33
|
end
|
34
34
|
|
35
35
|
# The outputs generated by this function
|
@@ -38,7 +38,7 @@ class Indicator::AutoGen::Dx < Indicator::Base
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def run(*args)
|
41
|
-
o, h, l, c, v, len = map_ohlcv(
|
41
|
+
o, h, l, c, v, len = map_ohlcv(self.class.inputs, *args)
|
42
42
|
@func.in_price(0, o, h, l, c, v, nil)
|
43
43
|
|
44
44
|
@func.opt_int(0, @time_period)
|
@@ -21,7 +21,7 @@ class Indicator::AutoGen::MedPrice < Indicator::Base
|
|
21
21
|
|
22
22
|
# The minimum set of inputs required
|
23
23
|
def self.inputs
|
24
|
-
[ :
|
24
|
+
[ :high, :low ]
|
25
25
|
end
|
26
26
|
|
27
27
|
# The outputs generated by this function
|
@@ -30,7 +30,7 @@ class Indicator::AutoGen::MedPrice < Indicator::Base
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def run(*args)
|
33
|
-
o, h, l, c, v, len = map_ohlcv(
|
33
|
+
o, h, l, c, v, len = map_ohlcv(self.class.inputs, *args)
|
34
34
|
@func.in_price(0, o, h, l, c, v, nil)
|
35
35
|
|
36
36
|
|
@@ -29,7 +29,7 @@ class Indicator::AutoGen::Mfi < Indicator::Base
|
|
29
29
|
|
30
30
|
# The minimum set of inputs required
|
31
31
|
def self.inputs
|
32
|
-
[ :
|
32
|
+
[ :high, :low, :close, :volume ]
|
33
33
|
end
|
34
34
|
|
35
35
|
# The outputs generated by this function
|
@@ -38,7 +38,7 @@ class Indicator::AutoGen::Mfi < Indicator::Base
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def run(*args)
|
41
|
-
o, h, l, c, v, len = map_ohlcv(
|
41
|
+
o, h, l, c, v, len = map_ohlcv(self.class.inputs, *args)
|
42
42
|
@func.in_price(0, o, h, l, c, v, nil)
|
43
43
|
|
44
44
|
@func.opt_int(0, @time_period)
|
@@ -29,7 +29,7 @@ class Indicator::AutoGen::MidPrice < Indicator::Base
|
|
29
29
|
|
30
30
|
# The minimum set of inputs required
|
31
31
|
def self.inputs
|
32
|
-
[ :
|
32
|
+
[ :high, :low ]
|
33
33
|
end
|
34
34
|
|
35
35
|
# The outputs generated by this function
|
@@ -38,7 +38,7 @@ class Indicator::AutoGen::MidPrice < Indicator::Base
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def run(*args)
|
41
|
-
o, h, l, c, v, len = map_ohlcv(
|
41
|
+
o, h, l, c, v, len = map_ohlcv(self.class.inputs, *args)
|
42
42
|
@func.in_price(0, o, h, l, c, v, nil)
|
43
43
|
|
44
44
|
@func.opt_int(0, @time_period)
|
@@ -29,7 +29,7 @@ class Indicator::AutoGen::MinusDI < Indicator::Base
|
|
29
29
|
|
30
30
|
# The minimum set of inputs required
|
31
31
|
def self.inputs
|
32
|
-
[ :
|
32
|
+
[ :high, :low, :close ]
|
33
33
|
end
|
34
34
|
|
35
35
|
# The outputs generated by this function
|
@@ -38,7 +38,7 @@ class Indicator::AutoGen::MinusDI < Indicator::Base
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def run(*args)
|
41
|
-
o, h, l, c, v, len = map_ohlcv(
|
41
|
+
o, h, l, c, v, len = map_ohlcv(self.class.inputs, *args)
|
42
42
|
@func.in_price(0, o, h, l, c, v, nil)
|
43
43
|
|
44
44
|
@func.opt_int(0, @time_period)
|
@@ -29,7 +29,7 @@ class Indicator::AutoGen::MinusDM < Indicator::Base
|
|
29
29
|
|
30
30
|
# The minimum set of inputs required
|
31
31
|
def self.inputs
|
32
|
-
[ :
|
32
|
+
[ :high, :low ]
|
33
33
|
end
|
34
34
|
|
35
35
|
# The outputs generated by this function
|
@@ -38,7 +38,7 @@ class Indicator::AutoGen::MinusDM < Indicator::Base
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def run(*args)
|
41
|
-
o, h, l, c, v, len = map_ohlcv(
|
41
|
+
o, h, l, c, v, len = map_ohlcv(self.class.inputs, *args)
|
42
42
|
@func.in_price(0, o, h, l, c, v, nil)
|
43
43
|
|
44
44
|
@func.opt_int(0, @time_period)
|
@@ -29,7 +29,7 @@ class Indicator::AutoGen::Natr < Indicator::Base
|
|
29
29
|
|
30
30
|
# The minimum set of inputs required
|
31
31
|
def self.inputs
|
32
|
-
[ :
|
32
|
+
[ :high, :low, :close ]
|
33
33
|
end
|
34
34
|
|
35
35
|
# The outputs generated by this function
|
@@ -38,7 +38,7 @@ class Indicator::AutoGen::Natr < Indicator::Base
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def run(*args)
|
41
|
-
o, h, l, c, v, len = map_ohlcv(
|
41
|
+
o, h, l, c, v, len = map_ohlcv(self.class.inputs, *args)
|
42
42
|
@func.in_price(0, o, h, l, c, v, nil)
|
43
43
|
|
44
44
|
@func.opt_int(0, @time_period)
|
@@ -11,7 +11,7 @@ class Indicator::AutoGen::Obv < Indicator::Base
|
|
11
11
|
|
12
12
|
# Is price data required as an input
|
13
13
|
def self.price_input?
|
14
|
-
|
14
|
+
false
|
15
15
|
end
|
16
16
|
|
17
17
|
# The list of arguments
|
@@ -21,7 +21,7 @@ class Indicator::AutoGen::Obv < Indicator::Base
|
|
21
21
|
|
22
22
|
# The minimum set of inputs required
|
23
23
|
def self.inputs
|
24
|
-
[ :
|
24
|
+
[ :in_real, :volume ]
|
25
25
|
end
|
26
26
|
|
27
27
|
# The outputs generated by this function
|
@@ -29,9 +29,10 @@ class Indicator::AutoGen::Obv < Indicator::Base
|
|
29
29
|
[ :out_real ]
|
30
30
|
end
|
31
31
|
|
32
|
-
def run(
|
33
|
-
|
34
|
-
@func.
|
32
|
+
def run(in_real, volume)
|
33
|
+
len = in_real.length
|
34
|
+
@func.in_real(0, map(in_real))
|
35
|
+
@func.in_real(1, map(volume))
|
35
36
|
|
36
37
|
|
37
38
|
out_real = Array.new(len)
|