Sha256: a2e49f123fb752553c75e3b4f2f407cc5cc7219a2e576ba187c4236967afab9d

Contents?: true

Size: 1.62 KB

Versions: 1

Compression:

Stored size: 1.62 KB

Contents

#!/usr/bin/env ruby

# frozen_string_literal: true

require 'cryptum'

# Initialize Driver Name & Parse cryptum Flags
driver_name = File.basename($PROGRAM_NAME)
option_choice = Cryptum::Option::Parser.get(driver_name: driver_name)

# Initialize the Respective Environment / API Authentication Artifacts
env = Cryptum::Option::Environment.get(option_choice: option_choice)

# Dump out supported products if --list-products flag is passed and exit
if option_choice.list_products
  Cryptum::API::Products.list_and_exit(
    option_choice: option_choice,
    env: env
  )
end

# Instantiate Our Status Indicators & History Objects
indicator_status = Cryptum::OrderBook::Indicator.new

# Initialize Curses UI
terminal_win = Cryptum::UI.init

# Generate an Order Book for Session Tracking
# Load previous order_book_justification from
# Order Book File (if it exists)
event_history = Cryptum::OrderBook::Generate.new(
  option_choice: option_choice,
  env: env
)
terminal_win.key_press_event.key_w = true if option_choice.reset_session_countdown

# Automatically Create Bot Confs if they don't
# Exist and Initialize Automated Trading Parameters
bot_conf = Cryptum::BotConf.read(
  option_choice: option_choice,
  event_history: event_history
)

# Connect to WebSocket
# Trigger Events as Event Data
# Generated via Coinbase Pro
# Web Socket HTTP Responses
# Refresh UI with Event Data
# Update "Status Indicators"
# Leverage "Status Indicators" to Initiate Actions
Cryptum::WebSock::EventMachine.run(
  option_choice: option_choice,
  env: env,
  terminal_win: terminal_win,
  event_history: event_history,
  indicator_status: indicator_status,
  bot_conf: bot_conf
)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cryptum-0.0.388 bin/cryptum