Sha256: 78c27ab1baca4d55d17d5d29666b682036bd2a972e0665fbc4bb96b73ed0fee9

Contents?: true

Size: 1.97 KB

Versions: 15

Compression:

Stored size: 1.97 KB

Contents

# frozen_string_literal: true

module Cryptum
  # This plugin is used to Cancel Open Limit Orders
  module Event
    # Keep Last Event History When Terminal Resize Occuers
    class History
      attr_accessor :bullish_trend,
                    :event,
                    :event_notes,
                    :event_type,
                    :first_event,
                    :market_trend_event,
                    :order_book,
                    :order_canceled,
                    :order_submitted,
                    :order_ready,
                    :plan_no,
                    :reconnected,
                    :red_pill,
                    :reset_market_trend,
                    :start_time,
                    :ticker_event,
                    :time_between_orders,
                    :time_between_orders_max,
                    :time_between_orders_min,
                    :time_between_orders_reset

      def initialize(opts = {})
        option_choice = opts[:option_choice]
        start_time = opts[:start_time]
        order_book = opts[:order_book]

        self.bullish_trend = false
        self.first_event = true
        self.order_canceled = false
        self.order_submitted = false
        self.order_ready = false
        self.order_book = order_book
        self.plan_no = 0
        self.start_time = start_time
        self.reconnected = false
        self.red_pill = false
        self.reset_market_trend = false

        # 60 seconds
        self.time_between_orders = option_choice.market_trend_reset
        self.time_between_orders_reset = self.time_between_orders

        # 60 minutes
        self.time_between_orders_max = self.time_between_orders_reset * 60

        # 5 seconds
        self.time_between_orders_min = 5
      end
    rescue Interrupt
      # Exit Gracefully if CTRL+C is Pressed During Session
      Cryptum.exit_gracefully(which_self: self)
    rescue StandardError => e
      # Produce a Stacktrace for anything else
      raise e
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
cryptum-0.0.247 lib/cryptum/event/history.rb
cryptum-0.0.246 lib/cryptum/event/history.rb
cryptum-0.0.245 lib/cryptum/event/history.rb
cryptum-0.0.244 lib/cryptum/event/history.rb
cryptum-0.0.243 lib/cryptum/event/history.rb
cryptum-0.0.242 lib/cryptum/event/history.rb
cryptum-0.0.241 lib/cryptum/event/history.rb
cryptum-0.0.240 lib/cryptum/event/history.rb
cryptum-0.0.239 lib/cryptum/event/history.rb
cryptum-0.0.238 lib/cryptum/event/history.rb
cryptum-0.0.234 lib/cryptum/event/history.rb
cryptum-0.0.233 lib/cryptum/event/history.rb
cryptum-0.0.232 lib/cryptum/event/history.rb
cryptum-0.0.231 lib/cryptum/event/history.rb
cryptum-0.0.230 lib/cryptum/event/history.rb