Class: SQA::Strategy::SMA

Inherits:
Object
  • Object
show all
Extended by:
Common
Defined in:
lib/sqa/strategy/sma.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/sma.rb', line 8

def self.trade(vector)
  sma_trend = vector.rsi[:trend]

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