Class: Generator::Alpha

Inherits:
Object
  • Object
show all
Defined in:
bin/finexclub_updater

Instance Method Summary collapse

Instance Method Details

#generate(options = {}) ⇒ Object



41
42
43
44
45
46
47
48
49
# File 'bin/finexclub_updater', line 41

def generate(options = {})
  timeframe = options[:timeframe] || raise("--tf option is missing")
  Finexclub::Chart::SYMBOLS.inject([]) do |data, symbol| 
    data << ["alpha[][symbol]", symbol.upcase]
    data << ["alpha[][timeframe]", timeframe]
    data << ["alpha[][index]", Generator.rand_index]
    data << ["alpha[][direction]", rand > 0.5? 1 : 0]
  end
end

#nameObject



37
38
39
# File 'bin/finexclub_updater', line 37

def name
  'alpha'
end