# 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