Class: SQA::Strategy::EMA

Inherits:
Object
  • Object
show all
Extended by:
Common
Defined in:
lib/sqa/strategy/ema.rb

Class Method Summary collapse

Methods included from Common

desc, trade_against

Class Method Details

.trade(vector) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/sqa/strategy/ema.rb', line 8

def self.trade(vector)
  ema_trend = vector.ema[:trend]

  if :up == ema_trend
    :buy
  elsif :down == ema_trend
    :sell
  else
    :hold
  end
end