Class: Indicator::AutoGen::CdlTristar

Inherits:
Base
  • Object
show all
Defined in:
lib/indicator/auto_gen/cdl_tristar.rb

Overview

Ta-Lib function mapping class Function: ‘CDLTRISTAR’ Description: ‘Tristar Pattern’ This file has been autogenerated - Do Not Edit.

Instance Attribute Summary

Attributes inherited from Base

#name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inherited, #map_ohlcv

Methods included from DataMapper

#default_getter, #default_getter=, #map

Constructor Details

#initialize(*args) ⇒ CdlTristar

Returns a new instance of CdlTristar.



7
8
9
10
# File 'lib/indicator/auto_gen/cdl_tristar.rb', line 7

def initialize(*args)
  
  @func = TaLib::Function.new("CDLTRISTAR")
end

Class Method Details

.argumentsObject

The list of arguments



18
19
20
# File 'lib/indicator/auto_gen/cdl_tristar.rb', line 18

def self.arguments
  [  ]
end

.inputsObject

The minimum set of inputs required



23
24
25
# File 'lib/indicator/auto_gen/cdl_tristar.rb', line 23

def self.inputs
  [ :open, :high, :low, :close ]
end

.outputsObject

The outputs generated by this function



28
29
30
# File 'lib/indicator/auto_gen/cdl_tristar.rb', line 28

def self.outputs
  [ :out_integer ]
end

.price_input?Boolean

Is price data required as an input

Returns:

  • (Boolean)


13
14
15
# File 'lib/indicator/auto_gen/cdl_tristar.rb', line 13

def self.price_input?
  true
end

Instance Method Details

#run(*args) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/indicator/auto_gen/cdl_tristar.rb', line 32

def run(*args)
  o, h, l, c, v, len = map_ohlcv(self.class.inputs, *args)
  @func.in_price(0, o, h, l, c, v, nil)


  out_integer = Array.new(len)
  @func.out_int(0, out_integer)

  @func.call(0, len - 1)

  out_integer
end