cryptum 0.0.261 → 0.0.262

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: 4d760ea86d8e98005d157ecee37d0b52fbd89bc44bc5c093bac8201020dfee8c
4
- data.tar.gz: e6e52346266ac38bf4f3e71535a17a6891388f27e06884985f35c7f09a957d6f
3
+ metadata.gz: 1613515179a2bffe718ae5afe3828daf161bc4502dbe8ff3df2f60bb42659234
4
+ data.tar.gz: 590ed73249828eb8b7f71ef647964d31a985d9653253cf66756784b909749902
5
5
  SHA512:
6
- metadata.gz: bffdfad77d1716fd242f4441a271066851c397fe44f3e3ec828b22bf8688236c98bd5b22d27e18da526c4c6bd445731351913eea9cb38b982216b459571a9fc5
7
- data.tar.gz: dd2c16cbdb3ebdf0349cde5e5e9f4a08ad2f436bceed8994b44695ebbadec9552848e0a0ddb85da5dd408f9050b5ea5dbc598edeb7177cb705e034b952107e73
6
+ metadata.gz: fb88630123183ba7c3ba6daccf547dd22f77d1c15c95767bc92e3672f5097352c9677a2d3faa3047fd9773d531ef0bd276758488fb8efc24cc529f8bd5a90d94
7
+ data.tar.gz: a6a5f988349fc5aafe94d1a602594c6f586a3430f8cdfe469b253da4cc9021174c5c63a075d3c65343a4f4aaad36226b5c60b3fe23521f24b6f92cdeead7ceaf
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2022-12-02 18:49:14 UTC using RuboCop version 1.39.0.
3
+ # on 2022-12-02 19:50:43 UTC using RuboCop version 1.39.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -102,7 +102,7 @@ Layout/TrailingWhitespace:
102
102
  - 'lib/cryptum/ui/order_plan.rb'
103
103
  - 'lib/cryptum/ui/order_timer.rb'
104
104
 
105
- # Offense count: 54
105
+ # Offense count: 56
106
106
  Lint/UselessAssignment:
107
107
  Exclude:
108
108
  - 'bin/cryptum-forecast'
@@ -123,7 +123,7 @@ Lint/UselessAssignment:
123
123
  # Offense count: 39
124
124
  # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes.
125
125
  Metrics/AbcSize:
126
- Max: 401
126
+ Max: 400
127
127
 
128
128
  # Offense count: 7
129
129
  # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
@@ -139,12 +139,12 @@ Metrics/BlockNesting:
139
139
  # Offense count: 16
140
140
  # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
141
141
  Metrics/CyclomaticComplexity:
142
- Max: 72
142
+ Max: 73
143
143
 
144
144
  # Offense count: 56
145
145
  # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
146
146
  Metrics/MethodLength:
147
- Max: 391
147
+ Max: 387
148
148
 
149
149
  # Offense count: 15
150
150
  # Configuration parameters: CountComments, CountAsOne.
@@ -154,7 +154,7 @@ Metrics/ModuleLength:
154
154
  # Offense count: 17
155
155
  # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
156
156
  Metrics/PerceivedComplexity:
157
- Max: 75
157
+ Max: 76
158
158
 
159
159
  # Offense count: 1
160
160
  # This cop supports safe autocorrection (--autocorrect).
@@ -221,14 +221,12 @@ Style/StringChars:
221
221
  Exclude:
222
222
  - 'lib/cryptum.rb'
223
223
 
224
- # Offense count: 3
224
+ # Offense count: 1
225
225
  # This cop supports safe autocorrection (--autocorrect).
226
226
  # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
227
227
  # SupportedStyles: single_quotes, double_quotes
228
228
  Style/StringLiterals:
229
229
  Exclude:
230
- - 'lib/cryptum/ui/order_execution.rb'
231
- - 'lib/cryptum/ui/order_timer.rb'
232
230
  - 'lib/cryptum/ui/portfolio.rb'
233
231
 
234
232
  # Offense count: 2
@@ -247,7 +245,7 @@ Style/TrailingCommaInArrayLiteral:
247
245
  Exclude:
248
246
  - 'lib/cryptum/matrix.rb'
249
247
 
250
- # Offense count: 14
248
+ # Offense count: 15
251
249
  # This cop supports safe autocorrection (--autocorrect).
252
250
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
253
251
  # URISchemes: http, https
@@ -425,60 +425,62 @@ module Cryptum
425
425
  event_history.order_execute_index_offset = first_row
426
426
  end
427
427
 
428
- order_history_meta.reverse[first_row..last_row].each do |meta|
429
- out_line_no += 1
430
- current_line = out_line_no - 2
431
-
432
- style = :normal
433
- style = :highlight if event_history.order_execute_row_to_select == current_line
434
- risk_alloc_out = Cryptum.beautify_large_number(
435
- value: meta[:risk_alloc]
436
- )
437
- invest_out = Cryptum.beautify_large_number(
438
- value: meta[:invest]
439
- )
440
- price_out = Cryptum.beautify_large_number(
441
- value: meta[:price]
442
- )
443
- size_out = Cryptum.beautify_large_number(
444
- value: meta[:size]
445
- )
446
- target_price_out = Cryptum.beautify_large_number(
447
- value: meta[:target_price]
448
- )
449
- profit_out = Cryptum.beautify_large_number(
450
- value: meta[:profit]
451
- )
452
- plan_no = "#{meta[:plan_no]}|"
428
+ if order_history_meta.any?
429
+ order_history_meta.reverse[first_row..last_row].each do |meta|
430
+ out_line_no += 1
431
+ current_line = out_line_no - 2
432
+
433
+ style = :normal
434
+ style = :highlight if event_history.order_execute_row_to_select == current_line
435
+ risk_alloc_out = Cryptum.beautify_large_number(
436
+ value: meta[:risk_alloc]
437
+ )
438
+ invest_out = Cryptum.beautify_large_number(
439
+ value: meta[:invest]
440
+ )
441
+ price_out = Cryptum.beautify_large_number(
442
+ value: meta[:price]
443
+ )
444
+ size_out = Cryptum.beautify_large_number(
445
+ value: meta[:size]
446
+ )
447
+ target_price_out = Cryptum.beautify_large_number(
448
+ value: meta[:target_price]
449
+ )
450
+ profit_out = Cryptum.beautify_large_number(
451
+ value: meta[:profit]
452
+ )
453
+ plan_no = "#{meta[:plan_no]}|"
453
454
 
454
- buy_created_at_hash_arr = order_history.select do |oh|
455
- oh[:id] == meta[:buy_order_id]
456
- end
455
+ buy_created_at_hash_arr = order_history.select do |oh|
456
+ oh[:id] == meta[:buy_order_id]
457
+ end
457
458
 
458
- buy_created_at = '____-__-__ __:__:__'
459
- unless buy_created_at_hash_arr.empty?
460
- buy_created_at = Time.parse(
461
- buy_created_at_hash_arr.first[:created_at]
462
- ).strftime('%Y-%m-%d %H:%M:%S')
463
- end
459
+ buy_created_at = '____-__-__ __:__:__'
460
+ unless buy_created_at_hash_arr.empty?
461
+ buy_created_at = Time.parse(
462
+ buy_created_at_hash_arr.first[:created_at]
463
+ ).strftime('%Y-%m-%d %H:%M:%S')
464
+ end
464
465
 
465
- invest = "$#{invest_out} @ "
466
- tick = "$#{price_out} = "
467
- size = "*#{size_out} + "
468
- tpm_out = "#{meta[:tpm]}% = "
469
- targ_tick = "$#{target_price_out}"
470
- profit = "|Profit: $#{meta[:profit]}"
471
-
472
- order_exec_ln = "#{buy_created_at}|#{invest}#{tick}#{size}#{tpm_out}#{targ_tick}#{profit}"
473
-
474
- order_execute_win.setpos(out_line_no, Cryptum::UI.col_first)
475
- order_execute_win.clrtoeol
476
- Cryptum::UI.colorize(
477
- ui_win: order_execute_win,
478
- color: meta[:color],
479
- style: style,
480
- string: order_exec_ln.ljust(col_just1, '.')
481
- )
466
+ invest = "$#{invest_out} @ "
467
+ tick = "$#{price_out} = "
468
+ size = "*#{size_out} + "
469
+ tpm_out = "#{meta[:tpm]}% = "
470
+ targ_tick = "$#{target_price_out}"
471
+ profit = "|Profit: $#{meta[:profit]}"
472
+
473
+ order_exec_ln = "#{buy_created_at}|#{invest}#{tick}#{size}#{tpm_out}#{targ_tick}#{profit}"
474
+
475
+ order_execute_win.setpos(out_line_no, Cryptum::UI.col_first)
476
+ order_execute_win.clrtoeol
477
+ Cryptum::UI.colorize(
478
+ ui_win: order_execute_win,
479
+ color: meta[:color],
480
+ style: style,
481
+ string: order_exec_ln.ljust(col_just1, '.')
482
+ )
483
+ end
482
484
  end
483
485
 
484
486
  # ROW 10
@@ -80,7 +80,8 @@ module Cryptum
80
80
 
81
81
  event_history.red_pill = true if crypto_invested_percent.to_f > autotrade_percent
82
82
 
83
- if crypto_invested_percent.to_f <= autotrade_percent && (
83
+ if crypto_invested_percent.to_f <= autotrade_percent &&
84
+ autotrade_percent.positive? && (
84
85
  order_plan.empty? || (
85
86
  indicator_status.action_signal == :buy &&
86
87
  indicator_status.last_action_signal == :sell
@@ -389,7 +390,7 @@ module Cryptum
389
390
  string: ''.ljust(col_just1, ' ')
390
391
  )
391
392
 
392
- header_str = "CYCLE SUMMARY | Risk Allocated: $#{order_plan_volume_out} | Slices: #{max_order_plan_slices} | Profit: $#{order_plan_profit_sum_out} | #{order_plan_exec_percent}% Done"
393
+ 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"
393
394
  order_plan_win.setpos(
394
395
  out_line_no,
395
396
  Cryptum::UI.col_center(str: header_str)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.261'
4
+ VERSION = '0.0.262'
5
5
  end
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.261
4
+ version: 0.0.262
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.