Class: NDayEma
Instance Attribute Summary
Attributes inherited from Ema
Instance Method Summary collapse
-
#initialize(n:) ⇒ NDayEma
constructor
A new instance of NDayEma.
Methods inherited from Ema
Constructor Details
#initialize(n:) ⇒ NDayEma
Returns a new instance of NDayEma.
2 3 4 5 6 7 8 9 |
# File 'lib/rbma/n_day_ema.rb', line 2 def initialize(n:) if n < 2 warn "ATTENTION: N should probably be bigger thant 2." else a = 2.0/(n+1) super(a: a) end end |