cryptum 0.0.329 → 0.0.331

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74b648e0d4c6dd269161b34790ad1ba954e7a182d45ba6f183402d603c1f96d4
4
- data.tar.gz: ed9eefd21eec9b4191b62316c086a2cbf1bc4b7aaabc639444476d957b1a5820
3
+ metadata.gz: 2bc7b6990410f2f5c42f379118c90b162834aed78d4a67c14eb26fa043caa71e
4
+ data.tar.gz: 2295d95f989f1e843424637e61cdf859c2f95caa71a3bd14d1bcf5956d76a74e
5
5
  SHA512:
6
- metadata.gz: ece2ec1bcbabb4cbd4b026559f058e875d4928bcb8733ecef886fdbbc5e2bcc1614f684f987bcc49856fe20721c756e8fd15468d0cb5d0e179ff8e560b525693
7
- data.tar.gz: dc9bd1e442bcc049d572716ee4b8b9db873bbf217dd7f76c146213ac13bb4b0356da4e47e2134eec4f425fb50402edee77f61604f9be7548ddbaeaea46053f4c
6
+ metadata.gz: a916eae1f779fb87d360c28385041f9ab3f5078eacecdb48640a8544047591804a66ebab65c62e98c12ba2f845fc67212dd464e0efe4dde17df5b72d5b4cdff7
7
+ data.tar.gz: b3109886785fd6847ec477c5bcadaf1c8d63d8bd238178476f06ef20d6aec79ae2f5668886b4f251d4b1bf4560d403fd8d81ed75cc6f706b12e5ade538e5cbef
data/lib/cryptum/event.rb CHANGED
@@ -5,18 +5,18 @@ require 'logger'
5
5
  module Cryptum
6
6
  # This plugin is used to parse Coinbase Pro Web Socket Events in the HTTP Response
7
7
  module Event
8
- autoload :BotConf, 'cryptum/event/bot_conf'
9
- autoload :Buy, 'cryptum/event/buy'
10
- autoload :Cancel, 'cryptum/event/cancel'
11
- autoload :Exit, 'cryptum/event/exit'
12
- autoload :GTFO, 'cryptum/event/gtfo'
13
- autoload :History, 'cryptum/event/history'
14
- autoload :KeyPress, 'cryptum/event/key_press'
15
- autoload :OrderBook, 'cryptum/event/order_book'
16
- autoload :Pane, 'cryptum/event/pane'
17
- autoload :Parse, 'cryptum/event/parse'
18
- autoload :Scroll, 'cryptum/event/scroll'
19
- autoload :Sell, 'cryptum/event/sell'
8
+ require 'cryptum/event/bot_conf'
9
+ require 'cryptum/event/buy'
10
+ require 'cryptum/event/cancel'
11
+ require 'cryptum/event/exit'
12
+ require 'cryptum/event/gtfo'
13
+ require 'cryptum/event/history'
14
+ require 'cryptum/event/key_press'
15
+ require 'cryptum/event/order_book'
16
+ require 'cryptum/event/pane'
17
+ require 'cryptum/event/parse'
18
+ require 'cryptum/event/scroll'
19
+ require 'cryptum/event/sell'
20
20
 
21
21
  # Display Usage for this Module
22
22
 
@@ -7,7 +7,7 @@ module Cryptum
7
7
  # Cryptum::UI Module used for Presenting the
8
8
  # Cryptum Curses Interface
9
9
  module Option
10
- autoload :Choice, 'cryptum/option/choice'
10
+ require 'cryptum/option/choice'
11
11
 
12
12
  # Options for cryptum Driver
13
13
  public_class_method def self.parser(opts = {})
@@ -6,10 +6,10 @@ require 'logger'
6
6
  module Cryptum
7
7
  # This module is used to define the Order Book Data Structure
8
8
  module OrderBook
9
- autoload :Generate, 'cryptum/order_book/generate'
10
- autoload :Indicator, 'cryptum/order_book/indicator'
11
- autoload :MarketTrend, 'cryptum/order_book/market_trend'
12
- autoload :ProfitMargin, 'cryptum/order_book/profit_margin'
9
+ require 'cryptum/order_book/generate'
10
+ require 'cryptum/order_book/indicator'
11
+ require 'cryptum/order_book/market_trend'
12
+ require 'cryptum/order_book/profit_margin'
13
13
 
14
14
  # Display Usage for this Module
15
15
  public_class_method def self.help
@@ -5,7 +5,7 @@ require 'logger'
5
5
  module Cryptum
6
6
  # This plugin is used to instantiate a Cryptum logger with a custom message format
7
7
  module Portfolio
8
- autoload :Balance, 'cryptum/portfolio/balance'
8
+ require 'cryptum/portfolio/balance'
9
9
 
10
10
  # Display Usage for this Module
11
11
  public_class_method def self.help
@@ -485,17 +485,20 @@ module Cryptum
485
485
  # Clear to SUMMARY
486
486
  # (Only Applicable if order_book[:order_history_meta] < max_rows_to_display)
487
487
  # out_line_no += 1
488
- rows_to_blank = out_line_no + remaining_blank_rows - 1
489
- (out_line_no..rows_to_blank).each do |clr_line|
490
- out_line_no = clr_line
491
- order_execute_win.setpos(clr_line, Cryptum::UI.col_first)
492
- order_execute_win.clrtoeol
493
- Cryptum::UI.colorize(
494
- ui_win: order_execute_win,
495
- color: :white,
496
- style: :normal,
497
- string: ''.ljust(col_just1, ' ')
498
- )
488
+ if remaining_blank_rows.positive?
489
+ rows_to_blank = out_line_no + remaining_blank_rows
490
+ out_line_no += 1
491
+ (out_line_no..rows_to_blank).each do |clr_line|
492
+ out_line_no = clr_line
493
+ order_execute_win.setpos(clr_line, Cryptum::UI.col_first)
494
+ order_execute_win.clrtoeol
495
+ Cryptum::UI.colorize(
496
+ ui_win: order_execute_win,
497
+ color: :white,
498
+ style: :normal,
499
+ string: ''.ljust(col_just1, ' ')
500
+ )
501
+ end
499
502
  end
500
503
 
501
504
  # ROW 10
@@ -174,7 +174,7 @@ module Cryptum
174
174
 
175
175
  if event_history.red_pill
176
176
  order_plan_prefix = '--'
177
- max_order_plan_slices = '0'
177
+ # max_order_plan_slices = '0'
178
178
  order_plan_volume_out = '0.00'
179
179
  order_plan_profit_sum_out = '0.00'
180
180
  order_plan_exec_percent = '0.00'
@@ -353,7 +353,6 @@ module Cryptum
353
353
  first_row = last_row - event_history.order_plan_max_records_available_to_display
354
354
  event_history.order_plan_index_offset = first_row
355
355
  remaining_blank_rows = max_rows_to_display - last_row
356
- remaining_blank_rows = max_rows_to_display - last_row - 1 if last_row < max_rows_to_display
357
356
  end
358
357
 
359
358
  selected_order = event_history.order_plan_selected_data
@@ -421,29 +420,32 @@ module Cryptum
421
420
  end
422
421
  event_history.order_plan_selected_data = selected_order
423
422
 
424
- if order_plan.length < 9
425
- lines_to_clear = 9 - order_plan.length
426
- (1..lines_to_clear).each do |_line|
427
- out_line_no += 1
428
- order_plan_win.setpos(out_line_no, Cryptum::UI.col_first)
429
- order_plan_win.clrtoeol
430
- end
431
- end
423
+ # if order_plan.length < 9
424
+ # lines_to_clear = 9 - order_plan.length
425
+ # (1..lines_to_clear).each do |_line|
426
+ # out_line_no += 1
427
+ # order_plan_win.setpos(out_line_no, Cryptum::UI.col_first)
428
+ # order_plan_win.clrtoeol
429
+ # end
430
+ # end
432
431
 
433
432
  # Clear to SUMMARY
434
433
  # (Only Applicable if order_book[:order_plan] < max_rows_to_display)
435
434
  # out_line_no += 1
436
- rows_to_blank = (out_line_no + remaining_blank_rows) - 1
437
- (out_line_no..rows_to_blank).each do |clr_line|
438
- out_line_no = clr_line
439
- order_plan_win.setpos(clr_line, Cryptum::UI.col_first)
440
- order_plan_win.clrtoeol
441
- Cryptum::UI.colorize(
442
- ui_win: order_plan_win,
443
- color: :white,
444
- style: :normal,
445
- string: ''.ljust(col_just1, ' ')
446
- )
435
+ if remaining_blank_rows.positive?
436
+ rows_to_blank = (out_line_no + remaining_blank_rows)
437
+ out_line_no += 1
438
+ (out_line_no..rows_to_blank).each do |clr_line|
439
+ out_line_no = clr_line
440
+ order_plan_win.setpos(clr_line, Cryptum::UI.col_first)
441
+ order_plan_win.clrtoeol
442
+ Cryptum::UI.colorize(
443
+ ui_win: order_plan_win,
444
+ color: :white,
445
+ style: :normal,
446
+ string: ''.ljust(col_just1, ' ')
447
+ )
448
+ end
447
449
  end
448
450
 
449
451
  # ROW 10
@@ -457,7 +459,7 @@ module Cryptum
457
459
  string: ''.ljust(col_just1, ' ')
458
460
  )
459
461
 
460
- header_str = "CYCLE SUMMARY | Slices: #{max_order_plan_slices} | Risk Allocated: $#{order_plan_volume_out} | Profit: $#{order_plan_profit_sum_out} | #{order_plan_exec_percent}% Done"
462
+ header_str = "CYCLE SUMMARY | Risk Allocated: $#{order_plan_volume_out} | Profit: $#{order_plan_profit_sum_out} | #{order_plan_exec_percent}% Done"
461
463
  order_plan_win.setpos(
462
464
  out_line_no,
463
465
  Cryptum::UI.col_center(str: header_str)
data/lib/cryptum/ui.rb CHANGED
@@ -7,18 +7,18 @@ module Cryptum
7
7
  # Cryptum::UI Module used for Presenting the
8
8
  # Cryptum Curses Interface
9
9
  module UI
10
- autoload :KeyPressEvent, 'cryptum/ui/key_press_event'
11
- autoload :TerminalWindow, 'cryptum/ui/terminal_window'
12
- autoload :Ticker, 'cryptum/ui/ticker'
13
- autoload :Portfolio, 'cryptum/ui/portfolio'
14
- autoload :OrderPlan, 'cryptum/ui/order_plan'
15
- autoload :OrderPlanDetails, 'cryptum/ui/order_plan_details'
16
- autoload :OrderTimer, 'cryptum/ui/order_timer'
17
- autoload :MarketTrend, 'cryptum/ui/market_trend'
18
- autoload :SignalEngine, 'cryptum/ui/signal_engine'
19
- autoload :OrderExecution, 'cryptum/ui/order_execution'
20
- autoload :OrderExecuteDetails, 'cryptum/ui/order_execute_details'
21
- autoload :Command, 'cryptum/ui/command'
10
+ require 'cryptum/ui/key_press_event'
11
+ require 'cryptum/ui/terminal_window'
12
+ require 'cryptum/ui/ticker'
13
+ require 'cryptum/ui/portfolio'
14
+ require 'cryptum/ui/order_plan'
15
+ require 'cryptum/ui/order_plan_details'
16
+ require 'cryptum/ui/order_timer'
17
+ require 'cryptum/ui/market_trend'
18
+ require 'cryptum/ui/signal_engine'
19
+ require 'cryptum/ui/order_execution'
20
+ require 'cryptum/ui/order_execute_details'
21
+ require 'cryptum/ui/command'
22
22
 
23
23
  # Initialize the UI
24
24
  public_class_method def self.init
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.329'
4
+ VERSION = '0.0.331'
5
5
  end
@@ -4,8 +4,8 @@ module Cryptum
4
4
  # This plugin is used to Establish a Web
5
5
  # Socket Connection with Coinbase
6
6
  module WebSock
7
- autoload :Coinbase, 'cryptum/web_sock/coinbase'
8
- autoload :EventMachine, 'cryptum/web_sock/event_machine'
7
+ require 'cryptum/web_sock/coinbase'
8
+ require 'cryptum/web_sock/event_machine'
9
9
 
10
10
  # Display Usage for this Module
11
11
 
data/lib/cryptum.rb CHANGED
@@ -1,29 +1,26 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'cryptum/version'
4
3
  require 'rbtrace'
5
4
  require 'yaml'
6
5
  require 'json'
7
6
  require 'fileutils'
8
7
  require 'tty-spinner'
9
-
10
8
  # Root-Level Namespace for cryptum
11
9
  module Cryptum
12
10
  $stdout.sync = true
13
11
  $stdout.flush
14
12
 
15
- autoload :API, 'cryptum/api'
16
- autoload :BotConf, 'cryptum/bot_conf'
17
- autoload :Event, 'cryptum/event'
18
- autoload :Indicator, 'cryptum/indicator'
19
- autoload :Log, 'cryptum/log'
20
- autoload :Matrix, 'cryptum/matrix'
21
- autoload :Option, 'cryptum/option'
22
- autoload :OrderBook, 'cryptum/order_book'
23
- autoload :Portfolio, 'cryptum/portfolio'
24
- autoload :ProbabilityEngine, 'cryptum/probability_engine'
25
- autoload :UI, 'cryptum/ui'
26
- autoload :WebSock, 'cryptum/web_sock'
13
+ require 'cryptum/api'
14
+ require 'cryptum/bot_conf'
15
+ require 'cryptum/event'
16
+ require 'cryptum/log'
17
+ require 'cryptum/matrix'
18
+ require 'cryptum/option'
19
+ require 'cryptum/order_book'
20
+ require 'cryptum/portfolio'
21
+ require 'cryptum/ui'
22
+ require 'cryptum/version'
23
+ require 'cryptum/web_sock'
27
24
 
28
25
  public_class_method def self.bin
29
26
  File.join root, 'bin'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.329
4
+ version: 0.0.331
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.