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 +4 -4
- data/.rubocop_todo.yml +8 -10
- data/lib/cryptum/ui/order_execution.rb +53 -51
- data/lib/cryptum/ui/order_plan.rb +3 -2
- data/lib/cryptum/version.rb +1 -1
- 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: 1613515179a2bffe718ae5afe3828daf161bc4502dbe8ff3df2f60bb42659234
|
4
|
+
data.tar.gz: 590ed73249828eb8b7f71ef647964d31a985d9653253cf66756784b909749902
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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.
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
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
|
-
|
455
|
-
|
456
|
-
|
455
|
+
buy_created_at_hash_arr = order_history.select do |oh|
|
456
|
+
oh[:id] == meta[:buy_order_id]
|
457
|
+
end
|
457
458
|
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
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
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
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 |
|
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)
|
data/lib/cryptum/version.rb
CHANGED