Class: Finexclub::Signals::Alpha

Inherits:
Finexclub::Signal show all
Defined in:
lib/finexclub/signals/alpha.rb

Instance Attribute Summary

Attributes inherited from Finexclub::Signal

#core

Instance Method Summary collapse

Methods inherited from Finexclub::Signal

build, handler_for, #initialize

Methods included from Document

included

Constructor Details

This class inherits a constructor from Finexclub::Signal

Instance Method Details

#stabilityObject



17
18
19
20
21
22
23
24
25
# File 'lib/finexclub/signals/alpha.rb', line 17

def stability
  case index
    when 100 then :confirmed
    when 90..99 then :high
    when 80..89 then :medium
    when 70..79 then :low
    else :unstable
  end
end

#trendObject



13
14
15
# File 'lib/finexclub/signals/alpha.rb', line 13

def trend
  direction == 1 ? :bullish : :bearish
end