Module: Coinbot::Event::Cancel

Defined in:
lib/coinbot/event/cancel.rb

Class Method Summary collapse

Class Method Details

.helpObject

Display Usage for this Module



32
33
34
35
36
# File 'lib/coinbot/event/cancel.rb', line 32

public_class_method def self.help
  puts "USAGE:
   event_history = #{self}.crypto()
  "
end

.open_orders(opts = {}) ⇒ Object

Supported Method Parameters

Coinbot::Event::Cancel.open_orders( )



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/coinbot/event/cancel.rb', line 10

public_class_method def self.open_orders(opts = {})
  option_choice = opts[:option_choice]
  env = opts[:env]
  event_history = opts[:event_history]
  order_type = opts[:order_type]
  order_action = opts[:order_action]

  event_history.order_canceled = true
  event_history.event_notes = "{ \"event_type\": \"#{event_history.event_type}\", \"cancel\": \"#{event_history.order_canceled}\", \"submitted\": \"#{event_history.}\" }" if option_choice.proxy

  Coinbot::API.cancel_open_order(
    env: env,
    option_choice: option_choice,
    order_id: event_history.this_opened_order_id,
    order_type: order_type,
    event_notes: event_history.event_notes
  )
rescue StandardError => e
  raise e
end