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 +4 -4
- data/lib/cryptum/event.rb +12 -12
- data/lib/cryptum/option.rb +1 -1
- data/lib/cryptum/order_book.rb +4 -4
- data/lib/cryptum/portfolio.rb +1 -1
- data/lib/cryptum/ui/order_execution.rb +14 -11
- data/lib/cryptum/ui/order_plan.rb +24 -22
- data/lib/cryptum/ui.rb +12 -12
- data/lib/cryptum/version.rb +1 -1
- data/lib/cryptum/web_sock.rb +2 -2
- data/lib/cryptum.rb +11 -14
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bc7b6990410f2f5c42f379118c90b162834aed78d4a67c14eb26fa043caa71e
|
4
|
+
data.tar.gz: 2295d95f989f1e843424637e61cdf859c2f95caa71a3bd14d1bcf5956d76a74e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
|
data/lib/cryptum/option.rb
CHANGED
@@ -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
|
-
|
10
|
+
require 'cryptum/option/choice'
|
11
11
|
|
12
12
|
# Options for cryptum Driver
|
13
13
|
public_class_method def self.parser(opts = {})
|
data/lib/cryptum/order_book.rb
CHANGED
@@ -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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
data/lib/cryptum/portfolio.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
489
|
-
|
490
|
-
out_line_no
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
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
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
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
|
-
|
437
|
-
|
438
|
-
out_line_no
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
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 |
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
data/lib/cryptum/version.rb
CHANGED
data/lib/cryptum/web_sock.rb
CHANGED
@@ -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
|
-
|
8
|
-
|
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
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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'
|