cryptum 0.0.308 → 0.0.310

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: f8aa7618c541ca39cbc15ca5ba1cec34b5c8b93428cf107b3799fd4bf3fa8013
4
- data.tar.gz: 5aa0428513584f228f59346a706b7b38f56a3d46c0b02aa01f616de72b471a09
3
+ metadata.gz: fadd6558d56296e82e092941ac2634cddd8e32ad2c96ceb56d77e572c3b08f9d
4
+ data.tar.gz: de1f66c4a6df6af45eb76661815299dd3940b9845b001480bc76a9fc878cdb2e
5
5
  SHA512:
6
- metadata.gz: d529c47732e456446ce6c072c42614f4db05115c3192f51d89f24f01f9fbe4e0967a41447d9cc54d7452bc84745dce58208dc2af2a90807acc18c35e8f2c0ccc
7
- data.tar.gz: 2042b992d7ac3a8dbd53ae464b0f0d61eaff7f4ddb845f5e6d8afae94d6e7a976f0875868523cf765f52c536ec2e45bdc7a88ce488f79cd1b5db0c223b8db25e
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
- # 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,7 @@ module Cryptum
321
330
  string: ''.ljust(col_just4, ' ')
322
331
  )
323
332
 
324
- 5.times.each do
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
- # 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)
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: :white,
427
- style: :normal,
454
+ color: header_color,
455
+ style: header_style,
428
456
  string: ''.ljust(col_just1, ' ')
429
457
  )
430
- end
431
458
 
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
- )
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
- Cryptum::UI.colorize(
449
- ui_win: order_plan_win,
450
- color: header_color,
451
- style: header_style,
452
- string: header_str
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.308'
4
+ VERSION = '0.0.310'
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.308
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-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