cryptum 0.0.308 → 0.0.310
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cryptum/event.rb +2 -1
- data/lib/cryptum/ui/order_execution.rb +11 -3
- data/lib/cryptum/ui/order_plan.rb +51 -33
- data/lib/cryptum/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fadd6558d56296e82e092941ac2634cddd8e32ad2c96ceb56d77e572c3b08f9d
|
4
|
+
data.tar.gz: de1f66c4a6df6af45eb76661815299dd3940b9845b001480bc76a9fc878cdb2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35e3027b3b623e63f1945cea52c79672ec425867a6e3e859ff8805b22aafadca811004f3d97bd898e385bcafd8e59359dc3adc40c184e13d622f0825530fa684
|
7
|
+
data.tar.gz: 457e7060727efe3e8056196b5893a527395cb0627c68e3bbc044ddc494878ad8dd42ac48e0126c8f6734ebb08384a8efa77507c00cf45fb2b7fef84a4f2b094c
|
data/lib/cryptum/event.rb
CHANGED
@@ -125,7 +125,8 @@ module Cryptum
|
|
125
125
|
)
|
126
126
|
recalc_op = event_history.recalculate_order_plan
|
127
127
|
order_plan = event_history.order_book[:order_plan]
|
128
|
-
terminal_win.key_press_event.key_w = true if recalc_op || order_plan.empty?
|
128
|
+
terminal_win.key_press_event.key_w = true if (recalc_op || order_plan.empty?) &&
|
129
|
+
!event_history.red_pill
|
129
130
|
event_history.recalculate_order_plan = false
|
130
131
|
end
|
131
132
|
|
@@ -368,7 +368,7 @@ module Cryptum
|
|
368
368
|
# UI
|
369
369
|
col_just1 = (Curses.cols - Cryptum::UI.col_first) - 1
|
370
370
|
# col_just3 = (Curses.cols - Cryptum::UI.col_third) - 1
|
371
|
-
|
371
|
+
col_just4 = Curses.cols - Cryptum::UI.col_fourth
|
372
372
|
|
373
373
|
# ROW 1
|
374
374
|
out_line_no = 0
|
@@ -423,7 +423,7 @@ module Cryptum
|
|
423
423
|
event_history.order_execute_max_records_available_to_display = last_row if last_row < max_rows_to_display
|
424
424
|
first_row = last_row - event_history.order_execute_max_records_available_to_display
|
425
425
|
event_history.order_execute_index_offset = first_row
|
426
|
-
remaining_blank_rows = max_rows_to_display - last_row
|
426
|
+
remaining_blank_rows = (max_rows_to_display - last_row) + 1
|
427
427
|
end
|
428
428
|
|
429
429
|
if order_history_meta.any?
|
@@ -487,6 +487,13 @@ module Cryptum
|
|
487
487
|
style: style,
|
488
488
|
string: order_exec_ln.ljust(col_just1, '.')
|
489
489
|
)
|
490
|
+
|
491
|
+
Cryptum::UI.colorize(
|
492
|
+
ui_win: order_execute_win,
|
493
|
+
color: meta[:color],
|
494
|
+
style: style,
|
495
|
+
string: ''.ljust(col_just4, ' ')
|
496
|
+
)
|
490
497
|
end
|
491
498
|
event_history.order_execute_selected_data = selected_order
|
492
499
|
end
|
@@ -494,7 +501,7 @@ module Cryptum
|
|
494
501
|
# Clear to SUMMARY
|
495
502
|
# (Only Applicable if order_book[:order_history_meta] < max_rows_to_display)
|
496
503
|
# out_line_no += 1
|
497
|
-
rows_to_blank =
|
504
|
+
rows_to_blank = out_line_no + remaining_blank_rows - 1
|
498
505
|
(out_line_no..rows_to_blank).each do |clr_line|
|
499
506
|
out_line_no = clr_line
|
500
507
|
order_execute_win.setpos(clr_line, Cryptum::UI.col_first)
|
@@ -508,6 +515,7 @@ module Cryptum
|
|
508
515
|
end
|
509
516
|
|
510
517
|
# ROW 10
|
518
|
+
out_line_no += 1
|
511
519
|
order_execute_win.setpos(out_line_no, Cryptum::UI.col_first)
|
512
520
|
order_execute_win.clrtoeol
|
513
521
|
Cryptum::UI.colorize(
|
@@ -246,6 +246,7 @@ module Cryptum
|
|
246
246
|
)
|
247
247
|
|
248
248
|
header_str = "- ORDER PLAN | CYCLE ##{order_plan_prefix} -"
|
249
|
+
header_str = '- ORDER PLAN | UNAVAILABLE -' if event_history.red_pill
|
249
250
|
order_plan_win.setpos(
|
250
251
|
out_line_no,
|
251
252
|
Cryptum::UI.col_center(str: header_str)
|
@@ -258,6 +259,14 @@ module Cryptum
|
|
258
259
|
string: header_str
|
259
260
|
)
|
260
261
|
|
262
|
+
order_plan_win.setpos(out_line_no, Cryptum::UI.col_fourth)
|
263
|
+
Cryptum::UI.colorize(
|
264
|
+
ui_win: order_plan_win,
|
265
|
+
color: header_color,
|
266
|
+
style: header_style,
|
267
|
+
string: ''.ljust(col_just4, ' ')
|
268
|
+
)
|
269
|
+
|
261
270
|
# ROWS 3-10
|
262
271
|
remaining_blank_rows = 0
|
263
272
|
max_rows_to_display = event_history.order_plan_max_rows_to_display
|
@@ -321,7 +330,7 @@ module Cryptum
|
|
321
330
|
string: ''.ljust(col_just4, ' ')
|
322
331
|
)
|
323
332
|
|
324
|
-
|
333
|
+
max_rows_to_display.times.each do
|
325
334
|
out_line_no += 1
|
326
335
|
this_matrix_row = Cryptum::Matrix.generate(cols: Curses.cols)
|
327
336
|
order_plan_win.setpos(out_line_no, Cryptum::UI.col_first)
|
@@ -348,6 +357,7 @@ module Cryptum
|
|
348
357
|
first_row = last_row - event_history.order_plan_max_records_available_to_display
|
349
358
|
event_history.order_plan_index_offset = first_row
|
350
359
|
remaining_blank_rows = max_rows_to_display - last_row
|
360
|
+
remaining_blank_rows = max_rows_to_display - last_row - 1 if last_row < max_rows_to_display
|
351
361
|
end
|
352
362
|
|
353
363
|
selected_order = event_history.order_plan_selected_data
|
@@ -400,6 +410,13 @@ module Cryptum
|
|
400
410
|
style: style,
|
401
411
|
string: "#{order_plan_invest}#{order_plan_return}".ljust(col_just1, '.')
|
402
412
|
)
|
413
|
+
order_plan_win.setpos(out_line_no, Cryptum::UI.col_fourth)
|
414
|
+
Cryptum::UI.colorize(
|
415
|
+
ui_win: order_plan_win,
|
416
|
+
color: plan_color,
|
417
|
+
style: style,
|
418
|
+
string: ''.ljust(col_just4, ' ')
|
419
|
+
)
|
403
420
|
end
|
404
421
|
event_history.order_plan_selected_data = selected_order
|
405
422
|
|
@@ -411,46 +428,47 @@ module Cryptum
|
|
411
428
|
order_plan_win.clrtoeol
|
412
429
|
end
|
413
430
|
end
|
414
|
-
end
|
415
431
|
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
432
|
+
# Clear to SUMMARY
|
433
|
+
# (Only Applicable if order_book[:order_plan] < max_rows_to_display)
|
434
|
+
# out_line_no += 1
|
435
|
+
rows_to_blank = (out_line_no + remaining_blank_rows) - 1
|
436
|
+
(out_line_no..rows_to_blank).each do |clr_line|
|
437
|
+
out_line_no = clr_line
|
438
|
+
order_plan_win.setpos(clr_line, Cryptum::UI.col_first)
|
439
|
+
order_plan_win.clrtoeol
|
440
|
+
Cryptum::UI.colorize(
|
441
|
+
ui_win: order_plan_win,
|
442
|
+
color: :white,
|
443
|
+
style: :normal,
|
444
|
+
string: ''.ljust(col_just1, ' ')
|
445
|
+
)
|
446
|
+
end
|
447
|
+
|
448
|
+
# ROW 10
|
449
|
+
out_line_no += 1
|
450
|
+
order_plan_win.setpos(out_line_no, Cryptum::UI.col_first)
|
423
451
|
order_plan_win.clrtoeol
|
424
452
|
Cryptum::UI.colorize(
|
425
453
|
ui_win: order_plan_win,
|
426
|
-
color:
|
427
|
-
style:
|
454
|
+
color: header_color,
|
455
|
+
style: header_style,
|
428
456
|
string: ''.ljust(col_just1, ' ')
|
429
457
|
)
|
430
|
-
end
|
431
458
|
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
color: header_color,
|
438
|
-
style: header_style,
|
439
|
-
string: ''.ljust(col_just1, ' ')
|
440
|
-
)
|
441
|
-
|
442
|
-
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"
|
443
|
-
order_plan_win.setpos(
|
444
|
-
out_line_no,
|
445
|
-
Cryptum::UI.col_center(str: header_str)
|
446
|
-
)
|
459
|
+
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"
|
460
|
+
order_plan_win.setpos(
|
461
|
+
out_line_no,
|
462
|
+
Cryptum::UI.col_center(str: header_str)
|
463
|
+
)
|
447
464
|
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
465
|
+
Cryptum::UI.colorize(
|
466
|
+
ui_win: order_plan_win,
|
467
|
+
color: header_color,
|
468
|
+
style: header_style,
|
469
|
+
string: header_str
|
470
|
+
)
|
471
|
+
end
|
454
472
|
|
455
473
|
# ROW 11
|
456
474
|
out_line_no += 1
|
data/lib/cryptum/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cryptum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.310
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|