Class: Generator::Octopus

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

Instance Method Summary collapse

Instance Method Details

#generate(options = {}) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'bin/finexclub_updater', line 100

def generate(options = {})
  symbol = options[:symbol] || raise("--symbol option is missing")
  timeframe = options[:timeframe] || raise("--tf option is missing")
  actions = %w(buy sell hold_sell hold_buy stop)
  data = []
  data << ["octopus[][symbol]", symbol.upcase]
  data << ["octopus[][timeframe]", timeframe]
  data << ["octopus[][action]", actions[rand(actions.size)]]
  data << ["octopus[][take_profit]", Generator.rand_price]
  data << ["octopus[][profit]", rand(100)]
  data << ["octopus[][stop_loss]", Generator.rand_price]
  data << ["octopus[][loss]", rand(100)]
  data << ["octopus[][index]", Generator.rand_index]
  data << ["octopus[][tsi]", Generator.rand_index]
  data << ["octopus[][trend]", rand > 0.4 ? 1 : 0 ]
  data << ["octopus[][screenshot_filename]", "OCTOPUS.gif"]
end

#nameObject



96
97
98
# File 'bin/finexclub_updater', line 96

def name
  'octopus'
end