cryptum 0.0.307 → 0.0.309

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: faa4809c3c4cd47f2ecad06fde334a0e22956187b01589b22c7856e98763bdf2
4
- data.tar.gz: e35b9fb12ea5fbb7376b02404488d6ac49b4efee53d7d615dd43eeb40e93bdf7
3
+ metadata.gz: fb68bf30183a4ab61756a6235927a9eb4ee02c326e26d5e3cf1ce835717b0e08
4
+ data.tar.gz: 69ffe9a4fa666d6179f4f6eb8a94d48b12ae595be88c109d0fb899dae8111ee4
5
5
  SHA512:
6
- metadata.gz: 3cd86f23ba8a783c95ad38a21b78d48091f9f8431dcc932be3e182aa7f41745046f3a47e20a83d44da5ebd714666e69b4a7c946e9969ea274c95ba0a0bd8f56b
7
- data.tar.gz: d5c343f0738921b46c0befd116ff466922d2c5d135ee1248ab239fce632c204124626eee82e0a7ddb24f477a33b1d4dd51c194512eed137eeb5c64fdde57ded1
6
+ metadata.gz: c1867796708dec2626f7978ca350ed742bd7a6375b93ad934d3aaca0797cba3417721b2a6326ef3d499071e8b72026778c89b0e312fc786deb1aceab9ea3e627
7
+ data.tar.gz: b1789a0f62d71f86738155133996d7637702a479c8704c229ccc02c726a53d05aa96ad1e52408b5ca3acbce5bdf68a5de4bf70e00ccf14e6112d5fb436d626c5
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
 
@@ -111,8 +111,6 @@ module Cryptum
111
111
  option_choice.market_trend_reset_label = '1h'
112
112
  when 2_700
113
113
  option_choice.market_trend_reset_label = '45m'
114
- when 2_700
115
- option_choice.market_trend_reset_label = '45m'
116
114
  when 1_800
117
115
  option_choice.market_trend_reset_label = '30m'
118
116
  when 900
@@ -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
- # col_just4 = Curses.cols - Cryptum::UI.col_fourth
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 = (out_line_no + remaining_blank_rows) - 1
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,8 @@ module Cryptum
321
330
  string: ''.ljust(col_just4, ' ')
322
331
  )
323
332
 
324
- 5.times.each do
333
+ matrix_rows = max_rows_to_display + 1
334
+ matrix_rows.times.each do
325
335
  out_line_no += 1
326
336
  this_matrix_row = Cryptum::Matrix.generate(cols: Curses.cols)
327
337
  order_plan_win.setpos(out_line_no, Cryptum::UI.col_first)
@@ -348,6 +358,7 @@ module Cryptum
348
358
  first_row = last_row - event_history.order_plan_max_records_available_to_display
349
359
  event_history.order_plan_index_offset = first_row
350
360
  remaining_blank_rows = max_rows_to_display - last_row
361
+ remaining_blank_rows = max_rows_to_display - last_row - 1 if last_row < max_rows_to_display
351
362
  end
352
363
 
353
364
  selected_order = event_history.order_plan_selected_data
@@ -400,6 +411,13 @@ module Cryptum
400
411
  style: style,
401
412
  string: "#{order_plan_invest}#{order_plan_return}".ljust(col_just1, '.')
402
413
  )
414
+ order_plan_win.setpos(out_line_no, Cryptum::UI.col_fourth)
415
+ Cryptum::UI.colorize(
416
+ ui_win: order_plan_win,
417
+ color: plan_color,
418
+ style: style,
419
+ string: ''.ljust(col_just4, ' ')
420
+ )
403
421
  end
404
422
  event_history.order_plan_selected_data = selected_order
405
423
 
@@ -411,46 +429,47 @@ module Cryptum
411
429
  order_plan_win.clrtoeol
412
430
  end
413
431
  end
414
- end
415
432
 
416
- # Clear to SUMMARY
417
- # (Only Applicable if order_book[:order_plan] < max_rows_to_display)
418
- # out_line_no += 1
419
- rows_to_blank = (out_line_no + remaining_blank_rows) - 1
420
- (out_line_no..rows_to_blank).each do |clr_line|
421
- out_line_no = clr_line
422
- order_plan_win.setpos(clr_line, Cryptum::UI.col_first)
433
+ # Clear to SUMMARY
434
+ # (Only Applicable if order_book[:order_plan] < max_rows_to_display)
435
+ # 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
+ )
447
+ end
448
+
449
+ # ROW 10
450
+ out_line_no += 1
451
+ order_plan_win.setpos(out_line_no, Cryptum::UI.col_first)
423
452
  order_plan_win.clrtoeol
424
453
  Cryptum::UI.colorize(
425
454
  ui_win: order_plan_win,
426
- color: :white,
427
- style: :normal,
455
+ color: header_color,
456
+ style: header_style,
428
457
  string: ''.ljust(col_just1, ' ')
429
458
  )
430
- end
431
459
 
432
- # ROW 10
433
- order_plan_win.setpos(out_line_no, Cryptum::UI.col_first)
434
- order_plan_win.clrtoeol
435
- Cryptum::UI.colorize(
436
- ui_win: order_plan_win,
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
- )
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"
461
+ order_plan_win.setpos(
462
+ out_line_no,
463
+ Cryptum::UI.col_center(str: header_str)
464
+ )
447
465
 
448
- Cryptum::UI.colorize(
449
- ui_win: order_plan_win,
450
- color: header_color,
451
- style: header_style,
452
- string: header_str
453
- )
466
+ Cryptum::UI.colorize(
467
+ ui_win: order_plan_win,
468
+ color: header_color,
469
+ style: header_style,
470
+ string: header_str
471
+ )
472
+ end
454
473
 
455
474
  # ROW 11
456
475
  out_line_no += 1
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.307'
4
+ VERSION = '0.0.309'
5
5
  end
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.307
4
+ version: 0.0.309
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-09 00:00:00.000000000 Z
11
+ date: 2022-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable