ta_lib_ffi 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/ta_lib_ffi.rb CHANGED
@@ -4,11 +4,25 @@ require "fiddle"
4
4
  require "fiddle/import"
5
5
 
6
6
  # Ruby FFI wrapper for TA-Lib (Technical Analysis Library)
7
+ #
8
+ # This module provides a Ruby interface to the TA-Lib technical analysis library
9
+ # using FFI (Foreign Function Interface). It allows you to perform various
10
+ # technical analysis calculations on financial market data.
11
+ #
12
+ # @example Basic usage
13
+ # require 'ta_lib_ffi'
14
+ #
15
+ # # Calculate Simple Moving Average
16
+ # prices = [10.0, 11.0, 12.0, 11.0, 10.0]
17
+ # result = TALibFFI.sma(prices, time_period: 3)
18
+ #
19
+ # @see https://ta-lib.org/ TA-Lib Official Website
7
20
  module TALibFFI
8
- VERSION = "0.2.0"
21
+ VERSION = "0.3.0"
9
22
 
10
23
  if defined?(Zeitwerk)
11
- # Custom inflector for handling special case module names like TALibFFI
24
+ # https://github.com/fxn/zeitwerk?tab=readme-ov-file#custom-inflector
25
+ # @!visibility private
12
26
  class Inflector < Zeitwerk::GemInflector
13
27
  def camelize(basename, _abspath)
14
28
  case basename
@@ -210,6 +224,11 @@ module TALibFFI
210
224
 
211
225
  module_function
212
226
 
227
+ # Extracts flags from a bitmask value based on the flag type
228
+ #
229
+ # @param value [Integer] The bitmask value to extract flags from
230
+ # @param type [Symbol] The type of flags to extract (:TA_InputFlags, :TA_OptInputFlags, or :TA_OutputFlags)
231
+ # @return [Array<Symbol>] Array of flag names that are set in the bitmask
213
232
  def extract_flags(value, type)
214
233
  flags_set = []
215
234
  TA_FLAGS[type].each do |k, v|
@@ -218,6 +237,9 @@ module TALibFFI
218
237
  flags_set
219
238
  end
220
239
 
240
+ # Returns a list of all available function groups in TA-Lib
241
+ #
242
+ # @return [Array<String>] Array of group names
221
243
  def group_table
222
244
  string_table_ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_VOIDP)
223
245
  ret_code = TA_GroupTableAlloc(string_table_ptr.ref)
@@ -230,6 +252,10 @@ module TALibFFI
230
252
  group_names
231
253
  end
232
254
 
255
+ # Returns a list of all functions in a specific group
256
+ #
257
+ # @param group [String] The name of the group to get functions for
258
+ # @return [Array<String>] Array of function names in the group
233
259
  def function_table(group)
234
260
  string_table_ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_VOIDP)
235
261
  ret_code = TA_FuncTableAlloc(group, string_table_ptr.ref)
@@ -243,6 +269,10 @@ module TALibFFI
243
269
  func_names
244
270
  end
245
271
 
272
+ # Gets detailed information about a specific TA-Lib function
273
+ #
274
+ # @param name [String] The name of the function to get information for
275
+ # @return [Fiddle::CStructEntity] Struct containing function information
246
276
  def function_info(name)
247
277
  handle_ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_VOIDP)
248
278
  ret_code = TA_GetFuncHandle(name, handle_ptr.ref)
@@ -255,6 +285,10 @@ module TALibFFI
255
285
  TA_FuncInfo.new(info_ptr)
256
286
  end
257
287
 
288
+ # Iterates over all available TA-Lib functions
289
+ #
290
+ # @yield [func_info] Yields function information for each function
291
+ # @yieldparam func_info [Fiddle::CStructEntity] Function information struct
258
292
  def each_function(&block)
259
293
  callback = Fiddle::Closure::BlockCaller.new(
260
294
  Fiddle::TYPE_VOID,
@@ -268,9 +302,10 @@ module TALibFFI
268
302
  check_ta_return_code(ret_code)
269
303
  end
270
304
 
271
- # rubocop:disable Metrics/MethodLength
272
- # rubocop:disable Metrics/AbcSize
273
- def print_function_info(func_info)
305
+ # Prints detailed information about a TA-Lib function
306
+ #
307
+ # @param func_info [Fiddle::CStructEntity] Function information struct to print
308
+ def print_function_info(func_info) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
274
309
  puts "Function Name: #{func_info["name"]}"
275
310
  puts "Function Group: #{func_info["group"]}"
276
311
  puts "Function Hint: #{func_info["hint"]}"
@@ -320,11 +355,14 @@ module TALibFFI
320
355
  puts " Flags: #{extract_flags(param_info["flags"], :TA_OutputFlags)}"
321
356
  end
322
357
  end
323
- # rubocop:enable Metrics/MethodLength
324
- # rubocop:enable Metrics/AbcSize
325
358
 
326
- # rubocop:disable Metrics/MethodLength
327
- def call_func(func_name, args)
359
+ # Calls a TA-Lib function with the given arguments
360
+ #
361
+ # @param func_name [String] The name of the function to call
362
+ # @param args [Array] Array of input arrays and optional parameters
363
+ # @return [Array, Hash] Function results (single array or hash of named outputs)
364
+ # @raise [TALibError] If there is an error in function execution
365
+ def call_func(func_name, args) # rubocop:disable Metrics/MethodLength
328
366
  options = args.last.is_a?(Hash) ? args.pop : {}
329
367
  input_arrays = args
330
368
 
@@ -337,13 +375,16 @@ module TALibFFI
337
375
  setup_input_parameters(params_ptr, input_arrays, func_name)
338
376
  setup_optional_parameters(params_ptr, options, func_name)
339
377
  _lookback = calculate_lookback(params_ptr)
340
- calculate_results(params_ptr, input_arrays.first.length, func_name)
378
+ calculate_results(params_ptr, input_arrays, func_name)
341
379
  ensure
342
380
  TA_ParamHolderFree(params_ptr)
343
381
  end
344
382
  end
345
- # rubocop:enable Metrics/MethodLength
346
383
 
384
+ # Calculates the lookback period for a function with given parameters
385
+ #
386
+ # @param params_ptr [Fiddle::Pointer] Pointer to parameter holder
387
+ # @return [Integer] The lookback period
347
388
  def calculate_lookback(params_ptr)
348
389
  lookback_ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INT)
349
390
  ret_code = TA_GetLookback(params_ptr, lookback_ptr)
@@ -351,9 +392,11 @@ module TALibFFI
351
392
  lookback_ptr[0, Fiddle::SIZEOF_INT].unpack1("l")
352
393
  end
353
394
 
354
- # rubocop:disable Metrics/CyclomaticComplexity
355
- # rubocop:disable Metrics/PerceivedComplexity
356
- def validate_inputs!(arrays)
395
+ # Validates input arrays for TA-Lib functions
396
+ #
397
+ # @param arrays [Array<Array>] Arrays to validate
398
+ # @raise [TALibError] If any array is invalid
399
+ def validate_inputs!(arrays) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
357
400
  raise TALibError, "Input arrays cannot be empty" if arrays.empty?
358
401
 
359
402
  arrays.each do |arr|
@@ -367,9 +410,11 @@ module TALibFFI
367
410
  raise TALibError, "Input arrays must contain only numbers" unless arr.flatten.all? { |x| x.is_a?(Numeric) }
368
411
  end
369
412
  end
370
- # rubocop:enable Metrics/CyclomaticComplexity
371
- # rubocop:enable Metrics/PerceivedComplexity
372
413
 
414
+ # Gets a function handle for a given function name
415
+ #
416
+ # @param func_name [String] The name of the function
417
+ # @return [Fiddle::Pointer] Pointer to function handle
373
418
  def get_function_handle(func_name)
374
419
  handle_ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_VOIDP)
375
420
  ret_code = TA_GetFuncHandle(func_name, handle_ptr.ref)
@@ -377,6 +422,10 @@ module TALibFFI
377
422
  handle_ptr
378
423
  end
379
424
 
425
+ # Creates a parameter holder for a function
426
+ #
427
+ # @param handle_ptr [Fiddle::Pointer] Function handle pointer
428
+ # @return [Fiddle::Pointer] Pointer to parameter holder
380
429
  def create_parameter_holder(handle_ptr)
381
430
  params_ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_VOIDP)
382
431
  ret_code = TA_ParamHolderAlloc(handle_ptr, params_ptr.ref)
@@ -384,6 +433,11 @@ module TALibFFI
384
433
  params_ptr
385
434
  end
386
435
 
436
+ # Sets up input parameters for a function call
437
+ #
438
+ # @param params_ptr [Fiddle::Pointer] Parameter holder pointer
439
+ # @param input_arrays [Array<Array>] Input data arrays
440
+ # @param func_name [String] Function name
387
441
  def setup_input_parameters(params_ptr, input_arrays, func_name)
388
442
  func_info = function_info_map[func_name]
389
443
  input_arrays.each_with_index do |array, index|
@@ -393,6 +447,13 @@ module TALibFFI
393
447
  end
394
448
  end
395
449
 
450
+ # Sets a single input parameter
451
+ #
452
+ # @param params_ptr [Fiddle::Pointer] Parameter holder pointer
453
+ # @param index [Integer] Parameter index
454
+ # @param array [Array] Input data array
455
+ # @param input_info [Hash] Input parameter information
456
+ # @return [Integer] TA-Lib return code
396
457
  def set_input_parameter(params_ptr, index, array, input_info)
397
458
  case input_info["type"]
398
459
  when TA_PARAM_TYPE[:TA_Input_Real]
@@ -406,6 +467,10 @@ module TALibFFI
406
467
  end
407
468
  end
408
469
 
470
+ # Prepares a double array for TA-Lib input
471
+ #
472
+ # @param array [Array<Numeric>] Array of numbers to prepare
473
+ # @return [Fiddle::Pointer] Pointer to prepared array
409
474
  def prepare_double_array(array)
410
475
  array_ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_DOUBLE * array.length)
411
476
  array.each_with_index do |value, i|
@@ -414,6 +479,10 @@ module TALibFFI
414
479
  array_ptr
415
480
  end
416
481
 
482
+ # Prepares an integer array for TA-Lib input
483
+ #
484
+ # @param array [Array<Numeric>] Array of numbers to prepare
485
+ # @return [Fiddle::Pointer] Pointer to prepared array
417
486
  def prepare_integer_array(array)
418
487
  array_ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INT * array.length)
419
488
  array.each_with_index do |value, i|
@@ -422,6 +491,11 @@ module TALibFFI
422
491
  array_ptr
423
492
  end
424
493
 
494
+ # Sets up optional parameters for a function call
495
+ #
496
+ # @param params_ptr [Fiddle::Pointer] Parameter holder pointer
497
+ # @param options [Hash] Optional parameters
498
+ # @param func_name [String] Function name
425
499
  def setup_optional_parameters(params_ptr, options, func_name)
426
500
  func_info = function_info_map[func_name]
427
501
  func_info[:opt_inputs]&.each_with_index do |opt_input, index|
@@ -430,6 +504,12 @@ module TALibFFI
430
504
  end
431
505
  end
432
506
 
507
+ # Sets a single optional parameter
508
+ #
509
+ # @param params_ptr [Fiddle::Pointer] Parameter holder pointer
510
+ # @param index [Integer] Parameter index
511
+ # @param value [Numeric] Parameter value
512
+ # @param type [Integer] Parameter type
433
513
  def set_optional_parameter(params_ptr, index, value, type)
434
514
  case type
435
515
  when TA_PARAM_TYPE[:TA_OptInput_RealRange], TA_PARAM_TYPE[:TA_OptInput_RealList]
@@ -440,8 +520,20 @@ module TALibFFI
440
520
  check_ta_return_code(ret_code)
441
521
  end
442
522
 
443
- # rubocop:disable Metrics/MethodLength
444
- def calculate_results(params_ptr, input_size, func_name)
523
+ # Calculates function results
524
+ #
525
+ # @param params_ptr [Fiddle::Pointer] Parameter holder pointer
526
+ # @param input_arrays [Array] Input data
527
+ # @param func_name [String] Function name
528
+ # @return [Array, Hash] Function results
529
+ def calculate_results(params_ptr, input_arrays, func_name) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
530
+ func_info = function_info_map[func_name]
531
+ input_size = if func_info[:inputs].first["type"] == TA_PARAM_TYPE[:TA_Input_Price]
532
+ input_arrays[0][0].length
533
+ else
534
+ input_arrays[0].length
535
+ end
536
+
445
537
  out_begin = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INT)
446
538
  out_size = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INT)
447
539
  output_arrays = setup_output_buffers(params_ptr, input_size, func_name)
@@ -458,11 +550,14 @@ module TALibFFI
458
550
  output_arrays.each(&:free)
459
551
  end
460
552
  end
461
- # rubocop:enable Metrics/MethodLength
462
553
 
463
- # rubocop:disable Metrics/MethodLength
464
- # rubocop:disable Metrics/AbcSize
465
- def setup_output_buffers(params_ptr, size, func_name)
554
+ # Sets up output buffers for function results
555
+ #
556
+ # @param params_ptr [Fiddle::Pointer] Parameter holder pointer
557
+ # @param size [Integer] Size of output buffer
558
+ # @param func_name [String] Function name
559
+ # @return [Array<Fiddle::Pointer>] Array of output buffer pointers
560
+ def setup_output_buffers(params_ptr, size, func_name) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
466
561
  func_info = function_info_map[func_name]
467
562
  output_ptrs = []
468
563
 
@@ -488,12 +583,14 @@ module TALibFFI
488
583
 
489
584
  output_ptrs
490
585
  end
491
- # rubocop:enable Metrics/MethodLength
492
- # rubocop:enable Metrics/AbcSize
493
586
 
494
- # rubocop:disable Metrics/MethodLength
495
- # rubocop:disable Metrics/AbcSize
496
- def format_output_results(output_ptrs, size, func_name)
587
+ # Formats output results from TA-Lib function
588
+ #
589
+ # @param output_ptrs [Array<Fiddle::Pointer>] Array of output buffer pointers
590
+ # @param size [Integer] Size of output data
591
+ # @param func_name [String] Function name
592
+ # @return [Array, Hash] Formatted results
593
+ def format_output_results(output_ptrs, size, func_name) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
497
594
  func_info = function_info_map[func_name]
498
595
  results = output_ptrs.zip(func_info[:outputs]).map do |ptr, output|
499
596
  case output["type"]
@@ -511,17 +608,24 @@ module TALibFFI
511
608
  end
512
609
  output_names.zip(results).to_h
513
610
  end
514
- # rubocop:enable Metrics/AbcSize
515
- # rubocop:enable Metrics/MethodLength
516
611
 
612
+ # Gets XML description of all TA-Lib functions
613
+ #
614
+ # @return [String] XML function descriptions
517
615
  def function_description_xml
518
616
  TA_FunctionDescriptionXML().to_s
519
617
  end
520
618
 
619
+ # Gets or builds the function information map
620
+ #
621
+ # @return [Hash] Map of function information
521
622
  def function_info_map
522
623
  @function_info_map ||= build_function_info_map
523
624
  end
524
625
 
626
+ # Builds a map of function information for all functions
627
+ #
628
+ # @return [Hash] Map of function information
525
629
  def build_function_info_map
526
630
  info_map = {}
527
631
  each_function do |func_info|
@@ -535,6 +639,10 @@ module TALibFFI
535
639
  info_map
536
640
  end
537
641
 
642
+ # Collects input parameter information for a function
643
+ #
644
+ # @param func_info [Fiddle::CStructEntity] Function information
645
+ # @return [Array<Fiddle::CStructEntity>] Array of input parameter information
538
646
  def collect_input_info(func_info)
539
647
  func_info["nbInput"].times.map do |i|
540
648
  param_info_ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_VOIDP)
@@ -543,6 +651,10 @@ module TALibFFI
543
651
  end
544
652
  end
545
653
 
654
+ # Collects optional input parameter information for a function
655
+ #
656
+ # @param func_info [Fiddle::CStructEntity] Function information
657
+ # @return [Array<Fiddle::CStructEntity>] Array of optional input parameter information
546
658
  def collect_opt_input_info(func_info)
547
659
  func_info["nbOptInput"].times.map do |i|
548
660
  param_info_ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_VOIDP)
@@ -551,6 +663,10 @@ module TALibFFI
551
663
  end
552
664
  end
553
665
 
666
+ # Collects output parameter information for a function
667
+ #
668
+ # @param func_info [Fiddle::CStructEntity] Function information
669
+ # @return [Array<Fiddle::CStructEntity>] Array of output parameter information
554
670
  def collect_output_info(func_info)
555
671
  func_info["nbOutput"].times.map do |i|
556
672
  param_info_ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_VOIDP)
@@ -559,14 +675,22 @@ module TALibFFI
559
675
  end
560
676
  end
561
677
 
678
+ # Generates Ruby methods for all TA-Lib functions
679
+ #
680
+ # This method iterates through all available TA-Lib functions and creates
681
+ # corresponding Ruby methods with proper documentation.
562
682
  def generate_ta_functions
563
683
  each_function do |func_info|
564
684
  define_ta_function(func_info["name"].to_s.downcase, func_info["name"].to_s)
565
685
  end
566
686
  end
567
687
 
688
+ # Normalizes parameter names to Ruby style
689
+ #
690
+ # @param name [String] Parameter name to normalize
691
+ # @return [String] Normalized parameter name
568
692
  def normalize_parameter_name(name)
569
- name.sub(/^(optIn|outReal|outInteger|out)/, "")
693
+ name.sub(/^(optIn|outReal|outInteger|out|in)/, "")
570
694
  .gsub(/::/, "/")
571
695
  .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
572
696
  .gsub(/([a-z\d])([A-Z])/, '\1_\2')
@@ -574,10 +698,11 @@ module TALibFFI
574
698
  .downcase
575
699
  end
576
700
 
577
- # rubocop:disable Metrics/MethodLength
578
- # rubocop:disable Metrics/AbcSize
579
- # rubocop:disable Metrics/CyclomaticComplexity
580
- def check_ta_return_code(code)
701
+ # Checks TA-Lib return codes and raises appropriate errors
702
+ #
703
+ # @param code [Integer] TA-Lib return code
704
+ # @raise [TALibError] If the return code indicates an error
705
+ def check_ta_return_code(code) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength
581
706
  return if code == TA_SUCCESS
582
707
 
583
708
  error_message = case code
@@ -623,10 +748,8 @@ module TALibFFI
623
748
 
624
749
  raise TALibError, error_message
625
750
  end
626
- # rubocop:enable Metrics/CyclomaticComplexity
627
- # rubocop:enable Metrics/MethodLength
628
- # rubocop:enable Metrics/AbcSize
629
751
 
752
+ # Initializes the TA-Lib library
630
753
  def initialize_ta_lib
631
754
  return if @initialized
632
755
 
@@ -636,21 +759,28 @@ module TALibFFI
636
759
  @initialized = true
637
760
  end
638
761
 
762
+ # Defines a TA-Lib function as a Ruby method with documentation
763
+ #
764
+ # @param method_name [String] Name of the Ruby method to define
765
+ # @param func_name [String] Name of the TA-Lib function
639
766
  def define_ta_function(method_name, func_name)
640
767
  define_singleton_method(method_name) do |*args|
641
768
  call_func(func_name, args)
642
769
  end
643
770
  end
644
771
 
772
+ # Sets up price inputs for functions that take price data
773
+ #
774
+ # @param params_ptr [Fiddle::Pointer] Parameter holder pointer
775
+ # @param index [Integer] Parameter index
776
+ # @param price_data [Array] Price data array
777
+ # @param flags [Integer] Input flags
645
778
  def setup_price_inputs(params_ptr, index, price_data, flags)
646
779
  required_flags = extract_flags(flags, :TA_InputFlags)
647
- data_pointers = Array.new(6) { nil }
648
- TA_FLAGS[:TA_InputFlags].keys[0..5].each_with_index do |flag, i|
649
- data_pointers[i] = if required_flags.include?(flag)
650
- prepare_double_array(price_data[required_flags.index(flag)])
651
- else
652
- Fiddle::Pointer.malloc(0)
653
- end
780
+ data_pointers = Array.new(6) { Fiddle::Pointer.malloc(0) }
781
+ required_flags.each_with_index do |flag, i|
782
+ flag_index = TA_FLAGS[:TA_InputFlags].keys.index(flag)
783
+ data_pointers[flag_index] = prepare_double_array(price_data[i]) if required_flags.include?(flag)
654
784
  end
655
785
 
656
786
  TA_SetInputParamPricePtr(params_ptr, index, *data_pointers)
@@ -658,4 +788,1295 @@ module TALibFFI
658
788
 
659
789
  initialize_ta_lib
660
790
  generate_ta_functions
791
+
792
+ # Placeholder for generated TA-Lib function documentation.
793
+ # Generated using YARD.
794
+ # Run: rake yard
795
+ class << self
796
+ ### GENERATED DOCUMENTATION START ###
797
+ # @!method accbands(price_hlc, time_period: 20.0)
798
+ # Acceleration Bands
799
+ #
800
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
801
+ # @param time_period [Integer] Number of period (default: 20.0)
802
+ # @return [Hash] Hash containing the following arrays:
803
+ # @option result [Array<Float>] :upper_band Output values
804
+ # @option result [Array<Float>] :middle_band Output values
805
+ # @option result [Array<Float>] :lower_band Output values
806
+ # @raise [TALibError] If there is an error in function execution
807
+
808
+ # @!method acos(real)
809
+ # Vector Trigonometric ACos
810
+ #
811
+ # @param real [Array<Float>] Input values
812
+ # @return [Array<Float>]
813
+ # @raise [TALibError] If there is an error in function execution
814
+
815
+ # @!method ad(price_hlcv)
816
+ # Chaikin A/D Line
817
+ #
818
+ # @param price_hlcv [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close, volume
819
+ # @return [Array<Float>]
820
+ # @raise [TALibError] If there is an error in function execution
821
+
822
+ # @!method add(real0, real1)
823
+ # Vector Arithmetic Add
824
+ #
825
+ # @param real0 [Array<Float>] Input values
826
+ # @param real1 [Array<Float>] Input values
827
+ # @return [Array<Float>]
828
+ # @raise [TALibError] If there is an error in function execution
829
+
830
+ # @!method adosc(price_hlcv, fast_period: 3.0, slow_period: 10.0)
831
+ # Chaikin A/D Oscillator
832
+ #
833
+ # @param price_hlcv [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close, volume
834
+ # @param fast_period [Integer] Number of period for the fast MA (default: 3.0)
835
+ # @param slow_period [Integer] Number of period for the slow MA (default: 10.0)
836
+ # @return [Array<Float>]
837
+ # @raise [TALibError] If there is an error in function execution
838
+
839
+ # @!method adx(price_hlc, time_period: 14.0)
840
+ # Average Directional Movement Index
841
+ #
842
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
843
+ # @param time_period [Integer] Number of period (default: 14.0)
844
+ # @return [Array<Float>]
845
+ # @raise [TALibError] If there is an error in function execution
846
+
847
+ # @!method adxr(price_hlc, time_period: 14.0)
848
+ # Average Directional Movement Index Rating
849
+ #
850
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
851
+ # @param time_period [Integer] Number of period (default: 14.0)
852
+ # @return [Array<Float>]
853
+ # @raise [TALibError] If there is an error in function execution
854
+
855
+ # @!method apo(real, fast_period: 12.0, slow_period: 26.0, ma_type: 0.0)
856
+ # Absolute Price Oscillator
857
+ #
858
+ # @param real [Array<Float>] Input values
859
+ # @param fast_period [Integer] Number of period for the fast MA (default: 12.0)
860
+ # @param slow_period [Integer] Number of period for the slow MA (default: 26.0)
861
+ # @param ma_type [Integer] Type of Moving Average (default: 0.0)
862
+ # @return [Array<Float>]
863
+ # @raise [TALibError] If there is an error in function execution
864
+
865
+ # @!method aroon(price_hl, time_period: 14.0)
866
+ # Aroon
867
+ #
868
+ # @param price_hl [Array(Array<Float>, Array<Float>)] Required price arrays: high, low
869
+ # @param time_period [Integer] Number of period (default: 14.0)
870
+ # @return [Hash] Hash containing the following arrays:
871
+ # @option result [Array<Float>] :aroon_down Output values
872
+ # @option result [Array<Float>] :aroon_up Output values
873
+ # @raise [TALibError] If there is an error in function execution
874
+
875
+ # @!method aroonosc(price_hl, time_period: 14.0)
876
+ # Aroon Oscillator
877
+ #
878
+ # @param price_hl [Array(Array<Float>, Array<Float>)] Required price arrays: high, low
879
+ # @param time_period [Integer] Number of period (default: 14.0)
880
+ # @return [Array<Float>]
881
+ # @raise [TALibError] If there is an error in function execution
882
+
883
+ # @!method asin(real)
884
+ # Vector Trigonometric ASin
885
+ #
886
+ # @param real [Array<Float>] Input values
887
+ # @return [Array<Float>]
888
+ # @raise [TALibError] If there is an error in function execution
889
+
890
+ # @!method atan(real)
891
+ # Vector Trigonometric ATan
892
+ #
893
+ # @param real [Array<Float>] Input values
894
+ # @return [Array<Float>]
895
+ # @raise [TALibError] If there is an error in function execution
896
+
897
+ # @!method atr(price_hlc, time_period: 14.0)
898
+ # Average True Range
899
+ #
900
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
901
+ # @param time_period [Integer] Number of period (default: 14.0)
902
+ # @return [Array<Float>]
903
+ # @raise [TALibError] If there is an error in function execution
904
+
905
+ # @!method avgprice(price_ohlc)
906
+ # Average Price
907
+ #
908
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
909
+ # @return [Array<Float>]
910
+ # @raise [TALibError] If there is an error in function execution
911
+
912
+ # @!method avgdev(real, time_period: 14.0)
913
+ # Average Deviation
914
+ #
915
+ # @param real [Array<Float>] Input values
916
+ # @param time_period [Integer] Number of period (default: 14.0)
917
+ # @return [Array<Float>]
918
+ # @raise [TALibError] If there is an error in function execution
919
+
920
+ # @!method bbands(real, time_period: 5.0, nb_dev_up: 2.0, nb_dev_dn: 2.0, ma_type: 0.0)
921
+ # Bollinger Bands
922
+ #
923
+ # @param real [Array<Float>] Input values
924
+ # @param time_period [Integer] Number of period (default: 5.0)
925
+ # @param nb_dev_up [Float] Deviation multiplier for upper band (default: 2.0)
926
+ # @param nb_dev_dn [Float] Deviation multiplier for lower band (default: 2.0)
927
+ # @param ma_type [Integer] Type of Moving Average (default: 0.0)
928
+ # @return [Hash] Hash containing the following arrays:
929
+ # @option result [Array<Float>] :upper_band Output values
930
+ # @option result [Array<Float>] :middle_band Output values
931
+ # @option result [Array<Float>] :lower_band Output values
932
+ # @raise [TALibError] If there is an error in function execution
933
+
934
+ # @!method beta(real0, real1, time_period: 5.0)
935
+ # Beta
936
+ #
937
+ # @param real0 [Array<Float>] Input values
938
+ # @param real1 [Array<Float>] Input values
939
+ # @param time_period [Integer] Number of period (default: 5.0)
940
+ # @return [Array<Float>]
941
+ # @raise [TALibError] If there is an error in function execution
942
+
943
+ # @!method bop(price_ohlc)
944
+ # Balance Of Power
945
+ #
946
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
947
+ # @return [Array<Float>]
948
+ # @raise [TALibError] If there is an error in function execution
949
+
950
+ # @!method cci(price_hlc, time_period: 14.0)
951
+ # Commodity Channel Index
952
+ #
953
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
954
+ # @param time_period [Integer] Number of period (default: 14.0)
955
+ # @return [Array<Float>]
956
+ # @raise [TALibError] If there is an error in function execution
957
+
958
+ # @!method cdl2crows(price_ohlc)
959
+ # Two Crows
960
+ #
961
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
962
+ # @return [Array<Integer>]
963
+ # @raise [TALibError] If there is an error in function execution
964
+
965
+ # @!method cdl3blackcrows(price_ohlc)
966
+ # Three Black Crows
967
+ #
968
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
969
+ # @return [Array<Integer>]
970
+ # @raise [TALibError] If there is an error in function execution
971
+
972
+ # @!method cdl3inside(price_ohlc)
973
+ # Three Inside Up/Down
974
+ #
975
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
976
+ # @return [Array<Integer>]
977
+ # @raise [TALibError] If there is an error in function execution
978
+
979
+ # @!method cdl3linestrike(price_ohlc)
980
+ # Three-Line Strike
981
+ #
982
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
983
+ # @return [Array<Integer>]
984
+ # @raise [TALibError] If there is an error in function execution
985
+
986
+ # @!method cdl3outside(price_ohlc)
987
+ # Three Outside Up/Down
988
+ #
989
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
990
+ # @return [Array<Integer>]
991
+ # @raise [TALibError] If there is an error in function execution
992
+
993
+ # @!method cdl3starsinsouth(price_ohlc)
994
+ # Three Stars In The South
995
+ #
996
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
997
+ # @return [Array<Integer>]
998
+ # @raise [TALibError] If there is an error in function execution
999
+
1000
+ # @!method cdl3whitesoldiers(price_ohlc)
1001
+ # Three Advancing White Soldiers
1002
+ #
1003
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1004
+ # @return [Array<Integer>]
1005
+ # @raise [TALibError] If there is an error in function execution
1006
+
1007
+ # @!method cdlabandonedbaby(price_ohlc, penetration: 0.3)
1008
+ # Abandoned Baby
1009
+ #
1010
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1011
+ # @param penetration [Float] Percentage of penetration of a candle within another candle (default: 0.3)
1012
+ # @return [Array<Integer>]
1013
+ # @raise [TALibError] If there is an error in function execution
1014
+
1015
+ # @!method cdladvanceblock(price_ohlc)
1016
+ # Advance Block
1017
+ #
1018
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1019
+ # @return [Array<Integer>]
1020
+ # @raise [TALibError] If there is an error in function execution
1021
+
1022
+ # @!method cdlbelthold(price_ohlc)
1023
+ # Belt-hold
1024
+ #
1025
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1026
+ # @return [Array<Integer>]
1027
+ # @raise [TALibError] If there is an error in function execution
1028
+
1029
+ # @!method cdlbreakaway(price_ohlc)
1030
+ # Breakaway
1031
+ #
1032
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1033
+ # @return [Array<Integer>]
1034
+ # @raise [TALibError] If there is an error in function execution
1035
+
1036
+ # @!method cdlclosingmarubozu(price_ohlc)
1037
+ # Closing Marubozu
1038
+ #
1039
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1040
+ # @return [Array<Integer>]
1041
+ # @raise [TALibError] If there is an error in function execution
1042
+
1043
+ # @!method cdlconcealbabyswall(price_ohlc)
1044
+ # Concealing Baby Swallow
1045
+ #
1046
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1047
+ # @return [Array<Integer>]
1048
+ # @raise [TALibError] If there is an error in function execution
1049
+
1050
+ # @!method cdlcounterattack(price_ohlc)
1051
+ # Counterattack
1052
+ #
1053
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1054
+ # @return [Array<Integer>]
1055
+ # @raise [TALibError] If there is an error in function execution
1056
+
1057
+ # @!method cdldarkcloudcover(price_ohlc, penetration: 0.5)
1058
+ # Dark Cloud Cover
1059
+ #
1060
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1061
+ # @param penetration [Float] Percentage of penetration of a candle within another candle (default: 0.5)
1062
+ # @return [Array<Integer>]
1063
+ # @raise [TALibError] If there is an error in function execution
1064
+
1065
+ # @!method cdldoji(price_ohlc)
1066
+ # Doji
1067
+ #
1068
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1069
+ # @return [Array<Integer>]
1070
+ # @raise [TALibError] If there is an error in function execution
1071
+
1072
+ # @!method cdldojistar(price_ohlc)
1073
+ # Doji Star
1074
+ #
1075
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1076
+ # @return [Array<Integer>]
1077
+ # @raise [TALibError] If there is an error in function execution
1078
+
1079
+ # @!method cdldragonflydoji(price_ohlc)
1080
+ # Dragonfly Doji
1081
+ #
1082
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1083
+ # @return [Array<Integer>]
1084
+ # @raise [TALibError] If there is an error in function execution
1085
+
1086
+ # @!method cdlengulfing(price_ohlc)
1087
+ # Engulfing Pattern
1088
+ #
1089
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1090
+ # @return [Array<Integer>]
1091
+ # @raise [TALibError] If there is an error in function execution
1092
+
1093
+ # @!method cdleveningdojistar(price_ohlc, penetration: 0.3)
1094
+ # Evening Doji Star
1095
+ #
1096
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1097
+ # @param penetration [Float] Percentage of penetration of a candle within another candle (default: 0.3)
1098
+ # @return [Array<Integer>]
1099
+ # @raise [TALibError] If there is an error in function execution
1100
+
1101
+ # @!method cdleveningstar(price_ohlc, penetration: 0.3)
1102
+ # Evening Star
1103
+ #
1104
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1105
+ # @param penetration [Float] Percentage of penetration of a candle within another candle (default: 0.3)
1106
+ # @return [Array<Integer>]
1107
+ # @raise [TALibError] If there is an error in function execution
1108
+
1109
+ # @!method cdlgapsidesidewhite(price_ohlc)
1110
+ # Up/Down-gap side-by-side white lines
1111
+ #
1112
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1113
+ # @return [Array<Integer>]
1114
+ # @raise [TALibError] If there is an error in function execution
1115
+
1116
+ # @!method cdlgravestonedoji(price_ohlc)
1117
+ # Gravestone Doji
1118
+ #
1119
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1120
+ # @return [Array<Integer>]
1121
+ # @raise [TALibError] If there is an error in function execution
1122
+
1123
+ # @!method cdlhammer(price_ohlc)
1124
+ # Hammer
1125
+ #
1126
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1127
+ # @return [Array<Integer>]
1128
+ # @raise [TALibError] If there is an error in function execution
1129
+
1130
+ # @!method cdlhangingman(price_ohlc)
1131
+ # Hanging Man
1132
+ #
1133
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1134
+ # @return [Array<Integer>]
1135
+ # @raise [TALibError] If there is an error in function execution
1136
+
1137
+ # @!method cdlharami(price_ohlc)
1138
+ # Harami Pattern
1139
+ #
1140
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1141
+ # @return [Array<Integer>]
1142
+ # @raise [TALibError] If there is an error in function execution
1143
+
1144
+ # @!method cdlharamicross(price_ohlc)
1145
+ # Harami Cross Pattern
1146
+ #
1147
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1148
+ # @return [Array<Integer>]
1149
+ # @raise [TALibError] If there is an error in function execution
1150
+
1151
+ # @!method cdlhighwave(price_ohlc)
1152
+ # High-Wave Candle
1153
+ #
1154
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1155
+ # @return [Array<Integer>]
1156
+ # @raise [TALibError] If there is an error in function execution
1157
+
1158
+ # @!method cdlhikkake(price_ohlc)
1159
+ # Hikkake Pattern
1160
+ #
1161
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1162
+ # @return [Array<Integer>]
1163
+ # @raise [TALibError] If there is an error in function execution
1164
+
1165
+ # @!method cdlhikkakemod(price_ohlc)
1166
+ # Modified Hikkake Pattern
1167
+ #
1168
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1169
+ # @return [Array<Integer>]
1170
+ # @raise [TALibError] If there is an error in function execution
1171
+
1172
+ # @!method cdlhomingpigeon(price_ohlc)
1173
+ # Homing Pigeon
1174
+ #
1175
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1176
+ # @return [Array<Integer>]
1177
+ # @raise [TALibError] If there is an error in function execution
1178
+
1179
+ # @!method cdlidentical3crows(price_ohlc)
1180
+ # Identical Three Crows
1181
+ #
1182
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1183
+ # @return [Array<Integer>]
1184
+ # @raise [TALibError] If there is an error in function execution
1185
+
1186
+ # @!method cdlinneck(price_ohlc)
1187
+ # In-Neck Pattern
1188
+ #
1189
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1190
+ # @return [Array<Integer>]
1191
+ # @raise [TALibError] If there is an error in function execution
1192
+
1193
+ # @!method cdlinvertedhammer(price_ohlc)
1194
+ # Inverted Hammer
1195
+ #
1196
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1197
+ # @return [Array<Integer>]
1198
+ # @raise [TALibError] If there is an error in function execution
1199
+
1200
+ # @!method cdlkicking(price_ohlc)
1201
+ # Kicking
1202
+ #
1203
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1204
+ # @return [Array<Integer>]
1205
+ # @raise [TALibError] If there is an error in function execution
1206
+
1207
+ # @!method cdlkickingbylength(price_ohlc)
1208
+ # Kicking - bull/bear determined by the longer marubozu
1209
+ #
1210
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1211
+ # @return [Array<Integer>]
1212
+ # @raise [TALibError] If there is an error in function execution
1213
+
1214
+ # @!method cdlladderbottom(price_ohlc)
1215
+ # Ladder Bottom
1216
+ #
1217
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1218
+ # @return [Array<Integer>]
1219
+ # @raise [TALibError] If there is an error in function execution
1220
+
1221
+ # @!method cdllongleggeddoji(price_ohlc)
1222
+ # Long Legged Doji
1223
+ #
1224
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1225
+ # @return [Array<Integer>]
1226
+ # @raise [TALibError] If there is an error in function execution
1227
+
1228
+ # @!method cdllongline(price_ohlc)
1229
+ # Long Line Candle
1230
+ #
1231
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1232
+ # @return [Array<Integer>]
1233
+ # @raise [TALibError] If there is an error in function execution
1234
+
1235
+ # @!method cdlmarubozu(price_ohlc)
1236
+ # Marubozu
1237
+ #
1238
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1239
+ # @return [Array<Integer>]
1240
+ # @raise [TALibError] If there is an error in function execution
1241
+
1242
+ # @!method cdlmatchinglow(price_ohlc)
1243
+ # Matching Low
1244
+ #
1245
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1246
+ # @return [Array<Integer>]
1247
+ # @raise [TALibError] If there is an error in function execution
1248
+
1249
+ # @!method cdlmathold(price_ohlc, penetration: 0.5)
1250
+ # Mat Hold
1251
+ #
1252
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1253
+ # @param penetration [Float] Percentage of penetration of a candle within another candle (default: 0.5)
1254
+ # @return [Array<Integer>]
1255
+ # @raise [TALibError] If there is an error in function execution
1256
+
1257
+ # @!method cdlmorningdojistar(price_ohlc, penetration: 0.3)
1258
+ # Morning Doji Star
1259
+ #
1260
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1261
+ # @param penetration [Float] Percentage of penetration of a candle within another candle (default: 0.3)
1262
+ # @return [Array<Integer>]
1263
+ # @raise [TALibError] If there is an error in function execution
1264
+
1265
+ # @!method cdlmorningstar(price_ohlc, penetration: 0.3)
1266
+ # Morning Star
1267
+ #
1268
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1269
+ # @param penetration [Float] Percentage of penetration of a candle within another candle (default: 0.3)
1270
+ # @return [Array<Integer>]
1271
+ # @raise [TALibError] If there is an error in function execution
1272
+
1273
+ # @!method cdlonneck(price_ohlc)
1274
+ # On-Neck Pattern
1275
+ #
1276
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1277
+ # @return [Array<Integer>]
1278
+ # @raise [TALibError] If there is an error in function execution
1279
+
1280
+ # @!method cdlpiercing(price_ohlc)
1281
+ # Piercing Pattern
1282
+ #
1283
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1284
+ # @return [Array<Integer>]
1285
+ # @raise [TALibError] If there is an error in function execution
1286
+
1287
+ # @!method cdlrickshawman(price_ohlc)
1288
+ # Rickshaw Man
1289
+ #
1290
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1291
+ # @return [Array<Integer>]
1292
+ # @raise [TALibError] If there is an error in function execution
1293
+
1294
+ # @!method cdlrisefall3methods(price_ohlc)
1295
+ # Rising/Falling Three Methods
1296
+ #
1297
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1298
+ # @return [Array<Integer>]
1299
+ # @raise [TALibError] If there is an error in function execution
1300
+
1301
+ # @!method cdlseparatinglines(price_ohlc)
1302
+ # Separating Lines
1303
+ #
1304
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1305
+ # @return [Array<Integer>]
1306
+ # @raise [TALibError] If there is an error in function execution
1307
+
1308
+ # @!method cdlshootingstar(price_ohlc)
1309
+ # Shooting Star
1310
+ #
1311
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1312
+ # @return [Array<Integer>]
1313
+ # @raise [TALibError] If there is an error in function execution
1314
+
1315
+ # @!method cdlshortline(price_ohlc)
1316
+ # Short Line Candle
1317
+ #
1318
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1319
+ # @return [Array<Integer>]
1320
+ # @raise [TALibError] If there is an error in function execution
1321
+
1322
+ # @!method cdlspinningtop(price_ohlc)
1323
+ # Spinning Top
1324
+ #
1325
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1326
+ # @return [Array<Integer>]
1327
+ # @raise [TALibError] If there is an error in function execution
1328
+
1329
+ # @!method cdlstalledpattern(price_ohlc)
1330
+ # Stalled Pattern
1331
+ #
1332
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1333
+ # @return [Array<Integer>]
1334
+ # @raise [TALibError] If there is an error in function execution
1335
+
1336
+ # @!method cdlsticksandwich(price_ohlc)
1337
+ # Stick Sandwich
1338
+ #
1339
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1340
+ # @return [Array<Integer>]
1341
+ # @raise [TALibError] If there is an error in function execution
1342
+
1343
+ # @!method cdltakuri(price_ohlc)
1344
+ # Takuri (Dragonfly Doji with very long lower shadow)
1345
+ #
1346
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1347
+ # @return [Array<Integer>]
1348
+ # @raise [TALibError] If there is an error in function execution
1349
+
1350
+ # @!method cdltasukigap(price_ohlc)
1351
+ # Tasuki Gap
1352
+ #
1353
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1354
+ # @return [Array<Integer>]
1355
+ # @raise [TALibError] If there is an error in function execution
1356
+
1357
+ # @!method cdlthrusting(price_ohlc)
1358
+ # Thrusting Pattern
1359
+ #
1360
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1361
+ # @return [Array<Integer>]
1362
+ # @raise [TALibError] If there is an error in function execution
1363
+
1364
+ # @!method cdltristar(price_ohlc)
1365
+ # Tristar Pattern
1366
+ #
1367
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1368
+ # @return [Array<Integer>]
1369
+ # @raise [TALibError] If there is an error in function execution
1370
+
1371
+ # @!method cdlunique3river(price_ohlc)
1372
+ # Unique 3 River
1373
+ #
1374
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1375
+ # @return [Array<Integer>]
1376
+ # @raise [TALibError] If there is an error in function execution
1377
+
1378
+ # @!method cdlupsidegap2crows(price_ohlc)
1379
+ # Upside Gap Two Crows
1380
+ #
1381
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1382
+ # @return [Array<Integer>]
1383
+ # @raise [TALibError] If there is an error in function execution
1384
+
1385
+ # @!method cdlxsidegap3methods(price_ohlc)
1386
+ # Upside/Downside Gap Three Methods
1387
+ #
1388
+ # @param price_ohlc [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: open, high, low, close
1389
+ # @return [Array<Integer>]
1390
+ # @raise [TALibError] If there is an error in function execution
1391
+
1392
+ # @!method ceil(real)
1393
+ # Vector Ceil
1394
+ #
1395
+ # @param real [Array<Float>] Input values
1396
+ # @return [Array<Float>]
1397
+ # @raise [TALibError] If there is an error in function execution
1398
+
1399
+ # @!method cmo(real, time_period: 14.0)
1400
+ # Chande Momentum Oscillator
1401
+ #
1402
+ # @param real [Array<Float>] Input values
1403
+ # @param time_period [Integer] Number of period (default: 14.0)
1404
+ # @return [Array<Float>]
1405
+ # @raise [TALibError] If there is an error in function execution
1406
+
1407
+ # @!method correl(real0, real1, time_period: 30.0)
1408
+ # Pearson's Correlation Coefficient (r)
1409
+ #
1410
+ # @param real0 [Array<Float>] Input values
1411
+ # @param real1 [Array<Float>] Input values
1412
+ # @param time_period [Integer] Number of period (default: 30.0)
1413
+ # @return [Array<Float>]
1414
+ # @raise [TALibError] If there is an error in function execution
1415
+
1416
+ # @!method cos(real)
1417
+ # Vector Trigonometric Cos
1418
+ #
1419
+ # @param real [Array<Float>] Input values
1420
+ # @return [Array<Float>]
1421
+ # @raise [TALibError] If there is an error in function execution
1422
+
1423
+ # @!method cosh(real)
1424
+ # Vector Trigonometric Cosh
1425
+ #
1426
+ # @param real [Array<Float>] Input values
1427
+ # @return [Array<Float>]
1428
+ # @raise [TALibError] If there is an error in function execution
1429
+
1430
+ # @!method dema(real, time_period: 30.0)
1431
+ # Double Exponential Moving Average
1432
+ #
1433
+ # @param real [Array<Float>] Input values
1434
+ # @param time_period [Integer] Number of period (default: 30.0)
1435
+ # @return [Array<Float>]
1436
+ # @raise [TALibError] If there is an error in function execution
1437
+
1438
+ # @!method div(real0, real1)
1439
+ # Vector Arithmetic Div
1440
+ #
1441
+ # @param real0 [Array<Float>] Input values
1442
+ # @param real1 [Array<Float>] Input values
1443
+ # @return [Array<Float>]
1444
+ # @raise [TALibError] If there is an error in function execution
1445
+
1446
+ # @!method dx(price_hlc, time_period: 14.0)
1447
+ # Directional Movement Index
1448
+ #
1449
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
1450
+ # @param time_period [Integer] Number of period (default: 14.0)
1451
+ # @return [Array<Float>]
1452
+ # @raise [TALibError] If there is an error in function execution
1453
+
1454
+ # @!method ema(real, time_period: 30.0)
1455
+ # Exponential Moving Average
1456
+ #
1457
+ # @param real [Array<Float>] Input values
1458
+ # @param time_period [Integer] Number of period (default: 30.0)
1459
+ # @return [Array<Float>]
1460
+ # @raise [TALibError] If there is an error in function execution
1461
+
1462
+ # @!method exp(real)
1463
+ # Vector Arithmetic Exp
1464
+ #
1465
+ # @param real [Array<Float>] Input values
1466
+ # @return [Array<Float>]
1467
+ # @raise [TALibError] If there is an error in function execution
1468
+
1469
+ # @!method floor(real)
1470
+ # Vector Floor
1471
+ #
1472
+ # @param real [Array<Float>] Input values
1473
+ # @return [Array<Float>]
1474
+ # @raise [TALibError] If there is an error in function execution
1475
+
1476
+ # @!method ht_dcperiod(real)
1477
+ # Hilbert Transform - Dominant Cycle Period
1478
+ #
1479
+ # @param real [Array<Float>] Input values
1480
+ # @return [Array<Float>]
1481
+ # @raise [TALibError] If there is an error in function execution
1482
+
1483
+ # @!method ht_dcphase(real)
1484
+ # Hilbert Transform - Dominant Cycle Phase
1485
+ #
1486
+ # @param real [Array<Float>] Input values
1487
+ # @return [Array<Float>]
1488
+ # @raise [TALibError] If there is an error in function execution
1489
+
1490
+ # @!method ht_phasor(real)
1491
+ # Hilbert Transform - Phasor Components
1492
+ #
1493
+ # @param real [Array<Float>] Input values
1494
+ # @return [Hash] Hash containing the following arrays:
1495
+ # @option result [Array<Float>] :in_phase Output values
1496
+ # @option result [Array<Float>] :quadrature Output values
1497
+ # @raise [TALibError] If there is an error in function execution
1498
+
1499
+ # @!method ht_sine(real)
1500
+ # Hilbert Transform - SineWave
1501
+ #
1502
+ # @param real [Array<Float>] Input values
1503
+ # @return [Hash] Hash containing the following arrays:
1504
+ # @option result [Array<Float>] :sine Output values
1505
+ # @option result [Array<Float>] :lead_sine Output values
1506
+ # @raise [TALibError] If there is an error in function execution
1507
+
1508
+ # @!method ht_trendline(real)
1509
+ # Hilbert Transform - Instantaneous Trendline
1510
+ #
1511
+ # @param real [Array<Float>] Input values
1512
+ # @return [Array<Float>]
1513
+ # @raise [TALibError] If there is an error in function execution
1514
+
1515
+ # @!method ht_trendmode(real)
1516
+ # Hilbert Transform - Trend vs Cycle Mode
1517
+ #
1518
+ # @param real [Array<Float>] Input values
1519
+ # @return [Array<Integer>]
1520
+ # @raise [TALibError] If there is an error in function execution
1521
+
1522
+ # @!method imi(price_oc, time_period: 14.0)
1523
+ # Intraday Momentum Index
1524
+ #
1525
+ # @param price_oc [Array(Array<Float>, Array<Float>)] Required price arrays: open, close
1526
+ # @param time_period [Integer] Number of period (default: 14.0)
1527
+ # @return [Array<Float>]
1528
+ # @raise [TALibError] If there is an error in function execution
1529
+
1530
+ # @!method kama(real, time_period: 30.0)
1531
+ # Kaufman Adaptive Moving Average
1532
+ #
1533
+ # @param real [Array<Float>] Input values
1534
+ # @param time_period [Integer] Number of period (default: 30.0)
1535
+ # @return [Array<Float>]
1536
+ # @raise [TALibError] If there is an error in function execution
1537
+
1538
+ # @!method linearreg(real, time_period: 14.0)
1539
+ # Linear Regression
1540
+ #
1541
+ # @param real [Array<Float>] Input values
1542
+ # @param time_period [Integer] Number of period (default: 14.0)
1543
+ # @return [Array<Float>]
1544
+ # @raise [TALibError] If there is an error in function execution
1545
+
1546
+ # @!method linearreg_angle(real, time_period: 14.0)
1547
+ # Linear Regression Angle
1548
+ #
1549
+ # @param real [Array<Float>] Input values
1550
+ # @param time_period [Integer] Number of period (default: 14.0)
1551
+ # @return [Array<Float>]
1552
+ # @raise [TALibError] If there is an error in function execution
1553
+
1554
+ # @!method linearreg_intercept(real, time_period: 14.0)
1555
+ # Linear Regression Intercept
1556
+ #
1557
+ # @param real [Array<Float>] Input values
1558
+ # @param time_period [Integer] Number of period (default: 14.0)
1559
+ # @return [Array<Float>]
1560
+ # @raise [TALibError] If there is an error in function execution
1561
+
1562
+ # @!method linearreg_slope(real, time_period: 14.0)
1563
+ # Linear Regression Slope
1564
+ #
1565
+ # @param real [Array<Float>] Input values
1566
+ # @param time_period [Integer] Number of period (default: 14.0)
1567
+ # @return [Array<Float>]
1568
+ # @raise [TALibError] If there is an error in function execution
1569
+
1570
+ # @!method ln(real)
1571
+ # Vector Log Natural
1572
+ #
1573
+ # @param real [Array<Float>] Input values
1574
+ # @return [Array<Float>]
1575
+ # @raise [TALibError] If there is an error in function execution
1576
+
1577
+ # @!method log10(real)
1578
+ # Vector Log10
1579
+ #
1580
+ # @param real [Array<Float>] Input values
1581
+ # @return [Array<Float>]
1582
+ # @raise [TALibError] If there is an error in function execution
1583
+
1584
+ # @!method ma(real, time_period: 30.0, ma_type: 0.0)
1585
+ # Moving average
1586
+ #
1587
+ # @param real [Array<Float>] Input values
1588
+ # @param time_period [Integer] Number of period (default: 30.0)
1589
+ # @param ma_type [Integer] Type of Moving Average (default: 0.0)
1590
+ # @return [Array<Float>]
1591
+ # @raise [TALibError] If there is an error in function execution
1592
+
1593
+ # @!method macd(real, fast_period: 12.0, slow_period: 26.0, signal_period: 9.0)
1594
+ # Moving Average Convergence/Divergence
1595
+ #
1596
+ # @param real [Array<Float>] Input values
1597
+ # @param fast_period [Integer] Number of period for the fast MA (default: 12.0)
1598
+ # @param slow_period [Integer] Number of period for the slow MA (default: 26.0)
1599
+ # @param signal_period [Integer] Smoothing for the signal line (nb of period) (default: 9.0)
1600
+ # @return [Hash] Hash containing the following arrays:
1601
+ # @option result [Array<Float>] :macd Output values
1602
+ # @option result [Array<Float>] :macd_signal Output values
1603
+ # @option result [Array<Float>] :macd_hist Output values
1604
+ # @raise [TALibError] If there is an error in function execution
1605
+
1606
+ # @!method macdext(real, fast_period: 12.0, fast_ma_type: 0.0, slow_period: 26.0, slow_ma_type: 0.0, signal_period: 9.0, signal_ma_type: 0.0)
1607
+ # MACD with controllable MA type
1608
+ #
1609
+ # @param real [Array<Float>] Input values
1610
+ # @param fast_period [Integer] Number of period for the fast MA (default: 12.0)
1611
+ # @param fast_ma_type [Integer] Type of Moving Average for fast MA (default: 0.0)
1612
+ # @param slow_period [Integer] Number of period for the slow MA (default: 26.0)
1613
+ # @param slow_ma_type [Integer] Type of Moving Average for slow MA (default: 0.0)
1614
+ # @param signal_period [Integer] Smoothing for the signal line (nb of period) (default: 9.0)
1615
+ # @param signal_ma_type [Integer] Type of Moving Average for signal line (default: 0.0)
1616
+ # @return [Hash] Hash containing the following arrays:
1617
+ # @option result [Array<Float>] :macd Output values
1618
+ # @option result [Array<Float>] :macd_signal Output values
1619
+ # @option result [Array<Float>] :macd_hist Output values
1620
+ # @raise [TALibError] If there is an error in function execution
1621
+
1622
+ # @!method macdfix(real, signal_period: 9.0)
1623
+ # Moving Average Convergence/Divergence Fix 12/26
1624
+ #
1625
+ # @param real [Array<Float>] Input values
1626
+ # @param signal_period [Integer] Smoothing for the signal line (nb of period) (default: 9.0)
1627
+ # @return [Hash] Hash containing the following arrays:
1628
+ # @option result [Array<Float>] :macd Output values
1629
+ # @option result [Array<Float>] :macd_signal Output values
1630
+ # @option result [Array<Float>] :macd_hist Output values
1631
+ # @raise [TALibError] If there is an error in function execution
1632
+
1633
+ # @!method mama(real, fast_limit: 0.5, slow_limit: 0.05)
1634
+ # MESA Adaptive Moving Average
1635
+ #
1636
+ # @param real [Array<Float>] Input values
1637
+ # @param fast_limit [Float] Upper limit use in the adaptive algorithm (default: 0.5)
1638
+ # @param slow_limit [Float] Lower limit use in the adaptive algorithm (default: 0.05)
1639
+ # @return [Hash] Hash containing the following arrays:
1640
+ # @option result [Array<Float>] :mama Output values
1641
+ # @option result [Array<Float>] :fama Output values
1642
+ # @raise [TALibError] If there is an error in function execution
1643
+
1644
+ # @!method mavp(real, periods, min_period: 2.0, max_period: 30.0, ma_type: 0.0)
1645
+ # Moving average with variable period
1646
+ #
1647
+ # @param real [Array<Float>] Input values
1648
+ # @param periods [Array<Float>] Input values
1649
+ # @param min_period [Integer] Value less than minimum will be changed to Minimum period (default: 2.0)
1650
+ # @param max_period [Integer] Value higher than maximum will be changed to Maximum period (default: 30.0)
1651
+ # @param ma_type [Integer] Type of Moving Average (default: 0.0)
1652
+ # @return [Array<Float>]
1653
+ # @raise [TALibError] If there is an error in function execution
1654
+
1655
+ # @!method max(real, time_period: 30.0)
1656
+ # Highest value over a specified period
1657
+ #
1658
+ # @param real [Array<Float>] Input values
1659
+ # @param time_period [Integer] Number of period (default: 30.0)
1660
+ # @return [Array<Float>]
1661
+ # @raise [TALibError] If there is an error in function execution
1662
+
1663
+ # @!method maxindex(real, time_period: 30.0)
1664
+ # Index of highest value over a specified period
1665
+ #
1666
+ # @param real [Array<Float>] Input values
1667
+ # @param time_period [Integer] Number of period (default: 30.0)
1668
+ # @return [Array<Integer>]
1669
+ # @raise [TALibError] If there is an error in function execution
1670
+
1671
+ # @!method medprice(price_hl)
1672
+ # Median Price
1673
+ #
1674
+ # @param price_hl [Array(Array<Float>, Array<Float>)] Required price arrays: high, low
1675
+ # @return [Array<Float>]
1676
+ # @raise [TALibError] If there is an error in function execution
1677
+
1678
+ # @!method mfi(price_hlcv, time_period: 14.0)
1679
+ # Money Flow Index
1680
+ #
1681
+ # @param price_hlcv [Array(Array<Float>, Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close, volume
1682
+ # @param time_period [Integer] Number of period (default: 14.0)
1683
+ # @return [Array<Float>]
1684
+ # @raise [TALibError] If there is an error in function execution
1685
+
1686
+ # @!method midpoint(real, time_period: 14.0)
1687
+ # MidPoint over period
1688
+ #
1689
+ # @param real [Array<Float>] Input values
1690
+ # @param time_period [Integer] Number of period (default: 14.0)
1691
+ # @return [Array<Float>]
1692
+ # @raise [TALibError] If there is an error in function execution
1693
+
1694
+ # @!method midprice(price_hl, time_period: 14.0)
1695
+ # Midpoint Price over period
1696
+ #
1697
+ # @param price_hl [Array(Array<Float>, Array<Float>)] Required price arrays: high, low
1698
+ # @param time_period [Integer] Number of period (default: 14.0)
1699
+ # @return [Array<Float>]
1700
+ # @raise [TALibError] If there is an error in function execution
1701
+
1702
+ # @!method min(real, time_period: 30.0)
1703
+ # Lowest value over a specified period
1704
+ #
1705
+ # @param real [Array<Float>] Input values
1706
+ # @param time_period [Integer] Number of period (default: 30.0)
1707
+ # @return [Array<Float>]
1708
+ # @raise [TALibError] If there is an error in function execution
1709
+
1710
+ # @!method minindex(real, time_period: 30.0)
1711
+ # Index of lowest value over a specified period
1712
+ #
1713
+ # @param real [Array<Float>] Input values
1714
+ # @param time_period [Integer] Number of period (default: 30.0)
1715
+ # @return [Array<Integer>]
1716
+ # @raise [TALibError] If there is an error in function execution
1717
+
1718
+ # @!method minmax(real, time_period: 30.0)
1719
+ # Lowest and highest values over a specified period
1720
+ #
1721
+ # @param real [Array<Float>] Input values
1722
+ # @param time_period [Integer] Number of period (default: 30.0)
1723
+ # @return [Hash] Hash containing the following arrays:
1724
+ # @option result [Array<Float>] :min Output values
1725
+ # @option result [Array<Float>] :max Output values
1726
+ # @raise [TALibError] If there is an error in function execution
1727
+
1728
+ # @!method minmaxindex(real, time_period: 30.0)
1729
+ # Indexes of lowest and highest values over a specified period
1730
+ #
1731
+ # @param real [Array<Float>] Input values
1732
+ # @param time_period [Integer] Number of period (default: 30.0)
1733
+ # @return [Hash] Hash containing the following arrays:
1734
+ # @option result [Array<Integer>] :min_idx Output values
1735
+ # @option result [Array<Integer>] :max_idx Output values
1736
+ # @raise [TALibError] If there is an error in function execution
1737
+
1738
+ # @!method minus_di(price_hlc, time_period: 14.0)
1739
+ # Minus Directional Indicator
1740
+ #
1741
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
1742
+ # @param time_period [Integer] Number of period (default: 14.0)
1743
+ # @return [Array<Float>]
1744
+ # @raise [TALibError] If there is an error in function execution
1745
+
1746
+ # @!method minus_dm(price_hl, time_period: 14.0)
1747
+ # Minus Directional Movement
1748
+ #
1749
+ # @param price_hl [Array(Array<Float>, Array<Float>)] Required price arrays: high, low
1750
+ # @param time_period [Integer] Number of period (default: 14.0)
1751
+ # @return [Array<Float>]
1752
+ # @raise [TALibError] If there is an error in function execution
1753
+
1754
+ # @!method mom(real, time_period: 10.0)
1755
+ # Momentum
1756
+ #
1757
+ # @param real [Array<Float>] Input values
1758
+ # @param time_period [Integer] Number of period (default: 10.0)
1759
+ # @return [Array<Float>]
1760
+ # @raise [TALibError] If there is an error in function execution
1761
+
1762
+ # @!method mult(real0, real1)
1763
+ # Vector Arithmetic Mult
1764
+ #
1765
+ # @param real0 [Array<Float>] Input values
1766
+ # @param real1 [Array<Float>] Input values
1767
+ # @return [Array<Float>]
1768
+ # @raise [TALibError] If there is an error in function execution
1769
+
1770
+ # @!method natr(price_hlc, time_period: 14.0)
1771
+ # Normalized Average True Range
1772
+ #
1773
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
1774
+ # @param time_period [Integer] Number of period (default: 14.0)
1775
+ # @return [Array<Float>]
1776
+ # @raise [TALibError] If there is an error in function execution
1777
+
1778
+ # @!method obv(real, price_v)
1779
+ # On Balance Volume
1780
+ #
1781
+ # @param real [Array<Float>] Input values
1782
+ # @param price_v [Array(Array<Float>)] Required price arrays: volume
1783
+ # @return [Array<Float>]
1784
+ # @raise [TALibError] If there is an error in function execution
1785
+
1786
+ # @!method plus_di(price_hlc, time_period: 14.0)
1787
+ # Plus Directional Indicator
1788
+ #
1789
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
1790
+ # @param time_period [Integer] Number of period (default: 14.0)
1791
+ # @return [Array<Float>]
1792
+ # @raise [TALibError] If there is an error in function execution
1793
+
1794
+ # @!method plus_dm(price_hl, time_period: 14.0)
1795
+ # Plus Directional Movement
1796
+ #
1797
+ # @param price_hl [Array(Array<Float>, Array<Float>)] Required price arrays: high, low
1798
+ # @param time_period [Integer] Number of period (default: 14.0)
1799
+ # @return [Array<Float>]
1800
+ # @raise [TALibError] If there is an error in function execution
1801
+
1802
+ # @!method ppo(real, fast_period: 12.0, slow_period: 26.0, ma_type: 0.0)
1803
+ # Percentage Price Oscillator
1804
+ #
1805
+ # @param real [Array<Float>] Input values
1806
+ # @param fast_period [Integer] Number of period for the fast MA (default: 12.0)
1807
+ # @param slow_period [Integer] Number of period for the slow MA (default: 26.0)
1808
+ # @param ma_type [Integer] Type of Moving Average (default: 0.0)
1809
+ # @return [Array<Float>]
1810
+ # @raise [TALibError] If there is an error in function execution
1811
+
1812
+ # @!method roc(real, time_period: 10.0)
1813
+ # Rate of change : ((price/prevPrice)-1)*100
1814
+ #
1815
+ # @param real [Array<Float>] Input values
1816
+ # @param time_period [Integer] Number of period (default: 10.0)
1817
+ # @return [Array<Float>]
1818
+ # @raise [TALibError] If there is an error in function execution
1819
+
1820
+ # @!method rocp(real, time_period: 10.0)
1821
+ # Rate of change Percentage: (price-prevPrice)/prevPrice
1822
+ #
1823
+ # @param real [Array<Float>] Input values
1824
+ # @param time_period [Integer] Number of period (default: 10.0)
1825
+ # @return [Array<Float>]
1826
+ # @raise [TALibError] If there is an error in function execution
1827
+
1828
+ # @!method rocr(real, time_period: 10.0)
1829
+ # Rate of change ratio: (price/prevPrice)
1830
+ #
1831
+ # @param real [Array<Float>] Input values
1832
+ # @param time_period [Integer] Number of period (default: 10.0)
1833
+ # @return [Array<Float>]
1834
+ # @raise [TALibError] If there is an error in function execution
1835
+
1836
+ # @!method rocr100(real, time_period: 10.0)
1837
+ # Rate of change ratio 100 scale: (price/prevPrice)*100
1838
+ #
1839
+ # @param real [Array<Float>] Input values
1840
+ # @param time_period [Integer] Number of period (default: 10.0)
1841
+ # @return [Array<Float>]
1842
+ # @raise [TALibError] If there is an error in function execution
1843
+
1844
+ # @!method rsi(real, time_period: 14.0)
1845
+ # Relative Strength Index
1846
+ #
1847
+ # @param real [Array<Float>] Input values
1848
+ # @param time_period [Integer] Number of period (default: 14.0)
1849
+ # @return [Array<Float>]
1850
+ # @raise [TALibError] If there is an error in function execution
1851
+
1852
+ # @!method sar(price_hl, acceleration: 0.02, maximum: 0.2)
1853
+ # Parabolic SAR
1854
+ #
1855
+ # @param price_hl [Array(Array<Float>, Array<Float>)] Required price arrays: high, low
1856
+ # @param acceleration [Float] Acceleration Factor used up to the Maximum value (default: 0.02)
1857
+ # @param maximum [Float] Acceleration Factor Maximum value (default: 0.2)
1858
+ # @return [Array<Float>]
1859
+ # @raise [TALibError] If there is an error in function execution
1860
+
1861
+ # @!method sarext(price_hl, start_value: 0.0, offset_on_reverse: 0.0, acceleration_init_long: 0.02, acceleration_long: 0.02, acceleration_max_long: 0.2, acceleration_init_short: 0.02, acceleration_short: 0.02, acceleration_max_short: 0.2)
1862
+ # Parabolic SAR - Extended
1863
+ #
1864
+ # @param price_hl [Array(Array<Float>, Array<Float>)] Required price arrays: high, low
1865
+ # @param start_value [Float] Start value and direction. 0 for Auto, >0 for Long, <0 for Short (default: 0.0)
1866
+ # @param offset_on_reverse [Float] Percent offset added/removed to initial stop on short/long reversal (default: 0.0)
1867
+ # @param acceleration_init_long [Float] Acceleration Factor initial value for the Long direction (default: 0.02)
1868
+ # @param acceleration_long [Float] Acceleration Factor for the Long direction (default: 0.02)
1869
+ # @param acceleration_max_long [Float] Acceleration Factor maximum value for the Long direction (default: 0.2)
1870
+ # @param acceleration_init_short [Float] Acceleration Factor initial value for the Short direction (default: 0.02)
1871
+ # @param acceleration_short [Float] Acceleration Factor for the Short direction (default: 0.02)
1872
+ # @param acceleration_max_short [Float] Acceleration Factor maximum value for the Short direction (default: 0.2)
1873
+ # @return [Array<Float>]
1874
+ # @raise [TALibError] If there is an error in function execution
1875
+
1876
+ # @!method sin(real)
1877
+ # Vector Trigonometric Sin
1878
+ #
1879
+ # @param real [Array<Float>] Input values
1880
+ # @return [Array<Float>]
1881
+ # @raise [TALibError] If there is an error in function execution
1882
+
1883
+ # @!method sinh(real)
1884
+ # Vector Trigonometric Sinh
1885
+ #
1886
+ # @param real [Array<Float>] Input values
1887
+ # @return [Array<Float>]
1888
+ # @raise [TALibError] If there is an error in function execution
1889
+
1890
+ # @!method sma(real, time_period: 30.0)
1891
+ # Simple Moving Average
1892
+ #
1893
+ # @param real [Array<Float>] Input values
1894
+ # @param time_period [Integer] Number of period (default: 30.0)
1895
+ # @return [Array<Float>]
1896
+ # @raise [TALibError] If there is an error in function execution
1897
+
1898
+ # @!method sqrt(real)
1899
+ # Vector Square Root
1900
+ #
1901
+ # @param real [Array<Float>] Input values
1902
+ # @return [Array<Float>]
1903
+ # @raise [TALibError] If there is an error in function execution
1904
+
1905
+ # @!method stddev(real, time_period: 5.0, nb_dev: 1.0)
1906
+ # Standard Deviation
1907
+ #
1908
+ # @param real [Array<Float>] Input values
1909
+ # @param time_period [Integer] Number of period (default: 5.0)
1910
+ # @param nb_dev [Float] Nb of deviations (default: 1.0)
1911
+ # @return [Array<Float>]
1912
+ # @raise [TALibError] If there is an error in function execution
1913
+
1914
+ # @!method stoch(price_hlc, fast_k_period: 5.0, slow_k_period: 3.0, slow_k_ma_type: 0.0, slow_d_period: 3.0, slow_d_ma_type: 0.0)
1915
+ # Stochastic
1916
+ #
1917
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
1918
+ # @param fast_k_period [Integer] Time period for building the Fast-K line (default: 5.0)
1919
+ # @param slow_k_period [Integer] Smoothing for making the Slow-K line. Usually set to 3 (default: 3.0)
1920
+ # @param slow_k_ma_type [Integer] Type of Moving Average for Slow-K (default: 0.0)
1921
+ # @param slow_d_period [Integer] Smoothing for making the Slow-D line (default: 3.0)
1922
+ # @param slow_d_ma_type [Integer] Type of Moving Average for Slow-D (default: 0.0)
1923
+ # @return [Hash] Hash containing the following arrays:
1924
+ # @option result [Array<Float>] :slow_k Output values
1925
+ # @option result [Array<Float>] :slow_d Output values
1926
+ # @raise [TALibError] If there is an error in function execution
1927
+
1928
+ # @!method stochf(price_hlc, fast_k_period: 5.0, fast_d_period: 3.0, fast_d_ma_type: 0.0)
1929
+ # Stochastic Fast
1930
+ #
1931
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
1932
+ # @param fast_k_period [Integer] Time period for building the Fast-K line (default: 5.0)
1933
+ # @param fast_d_period [Integer] Smoothing for making the Fast-D line. Usually set to 3 (default: 3.0)
1934
+ # @param fast_d_ma_type [Integer] Type of Moving Average for Fast-D (default: 0.0)
1935
+ # @return [Hash] Hash containing the following arrays:
1936
+ # @option result [Array<Float>] :fast_k Output values
1937
+ # @option result [Array<Float>] :fast_d Output values
1938
+ # @raise [TALibError] If there is an error in function execution
1939
+
1940
+ # @!method stochrsi(real, time_period: 14.0, fast_k_period: 5.0, fast_d_period: 3.0, fast_d_ma_type: 0.0)
1941
+ # Stochastic Relative Strength Index
1942
+ #
1943
+ # @param real [Array<Float>] Input values
1944
+ # @param time_period [Integer] Number of period (default: 14.0)
1945
+ # @param fast_k_period [Integer] Time period for building the Fast-K line (default: 5.0)
1946
+ # @param fast_d_period [Integer] Smoothing for making the Fast-D line. Usually set to 3 (default: 3.0)
1947
+ # @param fast_d_ma_type [Integer] Type of Moving Average for Fast-D (default: 0.0)
1948
+ # @return [Hash] Hash containing the following arrays:
1949
+ # @option result [Array<Float>] :fast_k Output values
1950
+ # @option result [Array<Float>] :fast_d Output values
1951
+ # @raise [TALibError] If there is an error in function execution
1952
+
1953
+ # @!method sub(real0, real1)
1954
+ # Vector Arithmetic Subtraction
1955
+ #
1956
+ # @param real0 [Array<Float>] Input values
1957
+ # @param real1 [Array<Float>] Input values
1958
+ # @return [Array<Float>]
1959
+ # @raise [TALibError] If there is an error in function execution
1960
+
1961
+ # @!method sum(real, time_period: 30.0)
1962
+ # Summation
1963
+ #
1964
+ # @param real [Array<Float>] Input values
1965
+ # @param time_period [Integer] Number of period (default: 30.0)
1966
+ # @return [Array<Float>]
1967
+ # @raise [TALibError] If there is an error in function execution
1968
+
1969
+ # @!method t3(real, time_period: 5.0, v_factor: 0.7)
1970
+ # Triple Exponential Moving Average (T3)
1971
+ #
1972
+ # @param real [Array<Float>] Input values
1973
+ # @param time_period [Integer] Number of period (default: 5.0)
1974
+ # @param v_factor [Float] Volume Factor (default: 0.7)
1975
+ # @return [Array<Float>]
1976
+ # @raise [TALibError] If there is an error in function execution
1977
+
1978
+ # @!method tan(real)
1979
+ # Vector Trigonometric Tan
1980
+ #
1981
+ # @param real [Array<Float>] Input values
1982
+ # @return [Array<Float>]
1983
+ # @raise [TALibError] If there is an error in function execution
1984
+
1985
+ # @!method tanh(real)
1986
+ # Vector Trigonometric Tanh
1987
+ #
1988
+ # @param real [Array<Float>] Input values
1989
+ # @return [Array<Float>]
1990
+ # @raise [TALibError] If there is an error in function execution
1991
+
1992
+ # @!method tema(real, time_period: 30.0)
1993
+ # Triple Exponential Moving Average
1994
+ #
1995
+ # @param real [Array<Float>] Input values
1996
+ # @param time_period [Integer] Number of period (default: 30.0)
1997
+ # @return [Array<Float>]
1998
+ # @raise [TALibError] If there is an error in function execution
1999
+
2000
+ # @!method trange(price_hlc)
2001
+ # True Range
2002
+ #
2003
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
2004
+ # @return [Array<Float>]
2005
+ # @raise [TALibError] If there is an error in function execution
2006
+
2007
+ # @!method trima(real, time_period: 30.0)
2008
+ # Triangular Moving Average
2009
+ #
2010
+ # @param real [Array<Float>] Input values
2011
+ # @param time_period [Integer] Number of period (default: 30.0)
2012
+ # @return [Array<Float>]
2013
+ # @raise [TALibError] If there is an error in function execution
2014
+
2015
+ # @!method trix(real, time_period: 30.0)
2016
+ # 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA
2017
+ #
2018
+ # @param real [Array<Float>] Input values
2019
+ # @param time_period [Integer] Number of period (default: 30.0)
2020
+ # @return [Array<Float>]
2021
+ # @raise [TALibError] If there is an error in function execution
2022
+
2023
+ # @!method tsf(real, time_period: 14.0)
2024
+ # Time Series Forecast
2025
+ #
2026
+ # @param real [Array<Float>] Input values
2027
+ # @param time_period [Integer] Number of period (default: 14.0)
2028
+ # @return [Array<Float>]
2029
+ # @raise [TALibError] If there is an error in function execution
2030
+
2031
+ # @!method typprice(price_hlc)
2032
+ # Typical Price
2033
+ #
2034
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
2035
+ # @return [Array<Float>]
2036
+ # @raise [TALibError] If there is an error in function execution
2037
+
2038
+ # @!method ultosc(price_hlc, time_period1: 7.0, time_period2: 14.0, time_period3: 28.0)
2039
+ # Ultimate Oscillator
2040
+ #
2041
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
2042
+ # @param time_period1 [Integer] Number of bars for 1st period. (default: 7.0)
2043
+ # @param time_period2 [Integer] Number of bars fro 2nd period (default: 14.0)
2044
+ # @param time_period3 [Integer] Number of bars for 3rd period (default: 28.0)
2045
+ # @return [Array<Float>]
2046
+ # @raise [TALibError] If there is an error in function execution
2047
+
2048
+ # @!method var(real, time_period: 5.0, nb_dev: 1.0)
2049
+ # Variance
2050
+ #
2051
+ # @param real [Array<Float>] Input values
2052
+ # @param time_period [Integer] Number of period (default: 5.0)
2053
+ # @param nb_dev [Float] Nb of deviations (default: 1.0)
2054
+ # @return [Array<Float>]
2055
+ # @raise [TALibError] If there is an error in function execution
2056
+
2057
+ # @!method wclprice(price_hlc)
2058
+ # Weighted Close Price
2059
+ #
2060
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
2061
+ # @return [Array<Float>]
2062
+ # @raise [TALibError] If there is an error in function execution
2063
+
2064
+ # @!method willr(price_hlc, time_period: 14.0)
2065
+ # Williams' %R
2066
+ #
2067
+ # @param price_hlc [Array(Array<Float>, Array<Float>, Array<Float>)] Required price arrays: high, low, close
2068
+ # @param time_period [Integer] Number of period (default: 14.0)
2069
+ # @return [Array<Float>]
2070
+ # @raise [TALibError] If there is an error in function execution
2071
+
2072
+ # @!method wma(real, time_period: 30.0)
2073
+ # Weighted Moving Average
2074
+ #
2075
+ # @param real [Array<Float>] Input values
2076
+ # @param time_period [Integer] Number of period (default: 30.0)
2077
+ # @return [Array<Float>]
2078
+ # @raise [TALibError] If there is an error in function execution
2079
+
2080
+ ### GENERATED DOCUMENTATION END ###
2081
+ end
661
2082
  end