76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'bin/finexclub_updater', line 76
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 << ["prognosis[][symbol]", symbol.upcase]
data << ["prognosis[][timeframe]", timeframe]
data << ["prognosis[][action]", actions[rand(actions.size)]]
data << ["prognosis[][take_profit]", Generator.rand_price]
data << ["prognosis[][profit]", rand(100)]
data << ["prognosis[][stop_loss]", Generator.rand_price]
data << ["prognosis[][loss]", rand(100)]
data << ["prognosis[][acceleration]", Generator.rand_array(%w(low high undefined))]
data << ["prognosis[][tsi]", Generator.rand_index]
data << ["prognosis[][trend]", rand > 0.4 ? 1 : 0 ]
data << ["prognosis[][screenshot_filename]", "PROGNOSIS.gif"]
end
|