cryptum 0.0.270 → 0.0.271
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/.rubocop_todo.yml +5 -4
- data/lib/cryptum/ui/order_execute_details.rb +70 -28
- 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: a2a99684100eded0f7b6ca6e94cd2b7afa4f1a46f4d173fcf8f6d23929f412ed
|
4
|
+
data.tar.gz: d01f3f8a7de3c65f295785f5fb38d781e0e3f2c4694eb8fe90e9a9e792442bf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3323a2fd4c747bb7daf655eff588ab7bf2e5010eb9cc707e1f44157f62b328a9ee3866beb4785e1423eae08ff82adb8dfb0771c3fc733ce6f3baf775948d4e12
|
7
|
+
data.tar.gz: c6de579395b53f951f12ef615aca7540b647d7d13a5bab05a27115ec88c8636a47b13df6e44edce7b8fd908ab81e889aeee6611e32529df9d0f2a8cbcebc0826
|
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-05
|
3
|
+
# on 2022-12-05 23:34:03 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
|
@@ -127,7 +127,7 @@ Metrics/ModuleLength:
|
|
127
127
|
Metrics/PerceivedComplexity:
|
128
128
|
Max: 76
|
129
129
|
|
130
|
-
# Offense count:
|
130
|
+
# Offense count: 4
|
131
131
|
# This cop supports safe autocorrection (--autocorrect).
|
132
132
|
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
|
133
133
|
# SupportedStyles: assign_to_condition, assign_inside_condition
|
@@ -135,6 +135,7 @@ Style/ConditionalAssignment:
|
|
135
135
|
Exclude:
|
136
136
|
- 'lib/cryptum/event/pane.rb'
|
137
137
|
- 'lib/cryptum/option.rb'
|
138
|
+
- 'lib/cryptum/ui/order_execute_details.rb'
|
138
139
|
|
139
140
|
# Offense count: 1
|
140
141
|
# Configuration parameters: AllowedConstants.
|
@@ -217,9 +218,9 @@ Style/TrailingCommaInArrayLiteral:
|
|
217
218
|
Exclude:
|
218
219
|
- 'lib/cryptum/matrix.rb'
|
219
220
|
|
220
|
-
# Offense count:
|
221
|
+
# Offense count: 22
|
221
222
|
# This cop supports safe autocorrection (--autocorrect).
|
222
223
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
|
223
224
|
# URISchemes: http, https
|
224
225
|
Layout/LineLength:
|
225
|
-
Max:
|
226
|
+
Max: 216
|
@@ -21,7 +21,56 @@ module Cryptum
|
|
21
21
|
order = event_history.order_execute_selected_data
|
22
22
|
tpm = order[:tpm]
|
23
23
|
autotrade_percent = order[:autotrade_percent]
|
24
|
-
order_color = order[:color]
|
24
|
+
order_color = order[:color].to_sym
|
25
|
+
|
26
|
+
order_plan_no = order[:plan_no]
|
27
|
+
case order_color
|
28
|
+
when :cyan, :red
|
29
|
+
order_id = order[:buy_order_id]
|
30
|
+
order_type = 'Buy'
|
31
|
+
when :green, :magenta, :yellow
|
32
|
+
order_id = order[:sell_order_id]
|
33
|
+
order_type = 'Sell'
|
34
|
+
when :black
|
35
|
+
order_id = 'Expired'
|
36
|
+
order_type = 'Expired'
|
37
|
+
else
|
38
|
+
order_id = 'N/A'
|
39
|
+
order_type = 'N/A'
|
40
|
+
end
|
41
|
+
|
42
|
+
risk_alloc_out = Cryptum.beautify_large_number(
|
43
|
+
value: order[:risk_alloc]
|
44
|
+
)
|
45
|
+
invest_out = Cryptum.beautify_large_number(
|
46
|
+
value: order[:invest]
|
47
|
+
)
|
48
|
+
price_out = Cryptum.beautify_large_number(
|
49
|
+
value: order[:price]
|
50
|
+
)
|
51
|
+
size_out = Cryptum.beautify_large_number(
|
52
|
+
value: order[:size]
|
53
|
+
)
|
54
|
+
target_price_out = Cryptum.beautify_large_number(
|
55
|
+
value: order[:target_price]
|
56
|
+
)
|
57
|
+
profit_out = Cryptum.beautify_large_number(
|
58
|
+
value: order[:profit]
|
59
|
+
)
|
60
|
+
plan_no = "#{order[:plan_no]}|"
|
61
|
+
|
62
|
+
created_at = order[:created_at]
|
63
|
+
|
64
|
+
invest = "$#{invest_out} @ "
|
65
|
+
tick = "$#{price_out} = "
|
66
|
+
size = "*#{size_out} + "
|
67
|
+
tpm_out = "#{order[:tpm]}% = "
|
68
|
+
targ_tick = "$#{target_price_out}"
|
69
|
+
profit = "|Profit: $#{order[:profit]}"
|
70
|
+
|
71
|
+
order_id_details = "#{order_type} Order ID: #{order_id}"
|
72
|
+
order_plan_details = "Order Slice #: #{order_plan_no}"
|
73
|
+
order_exec_ln = "Details: #{created_at}|#{invest}#{tick}#{size}#{tpm_out}#{targ_tick}#{profit}"
|
25
74
|
|
26
75
|
# UI
|
27
76
|
col_just1 = (Curses.cols - Cryptum::UI.col_first) - 1
|
@@ -71,42 +120,35 @@ module Cryptum
|
|
71
120
|
order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
|
72
121
|
order_execute_details_win.clrtoeol
|
73
122
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
)
|
80
|
-
price_out = Cryptum.beautify_large_number(
|
81
|
-
value: order[:price]
|
82
|
-
)
|
83
|
-
size_out = Cryptum.beautify_large_number(
|
84
|
-
value: order[:size]
|
85
|
-
)
|
86
|
-
target_price_out = Cryptum.beautify_large_number(
|
87
|
-
value: order[:target_price]
|
88
|
-
)
|
89
|
-
profit_out = Cryptum.beautify_large_number(
|
90
|
-
value: order[:profit]
|
123
|
+
Cryptum::UI.colorize(
|
124
|
+
ui_win: order_execute_details_win,
|
125
|
+
color: order_color,
|
126
|
+
style: style,
|
127
|
+
string: order_id_details.ljust(col_just1, ' ')
|
91
128
|
)
|
92
|
-
plan_no = "#{order[:plan_no]}|"
|
93
129
|
|
94
|
-
|
130
|
+
# ROW 5
|
131
|
+
out_line_no += 1
|
132
|
+
order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
|
133
|
+
order_execute_details_win.clrtoeol
|
95
134
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
135
|
+
Cryptum::UI.colorize(
|
136
|
+
ui_win: order_execute_details_win,
|
137
|
+
color: order_color,
|
138
|
+
style: style,
|
139
|
+
string: order_plan_details.ljust(col_just1, ' ')
|
140
|
+
)
|
102
141
|
|
103
|
-
|
142
|
+
# ROW 4
|
143
|
+
out_line_no += 1
|
144
|
+
order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
|
145
|
+
order_execute_details_win.clrtoeol
|
104
146
|
|
105
147
|
Cryptum::UI.colorize(
|
106
148
|
ui_win: order_execute_details_win,
|
107
149
|
color: order_color,
|
108
150
|
style: style,
|
109
|
-
string: order_exec_ln.ljust(col_just1, '
|
151
|
+
string: order_exec_ln.ljust(col_just1, ' ')
|
110
152
|
)
|
111
153
|
|
112
154
|
# Clear to OK ROW
|
data/lib/cryptum/version.rb
CHANGED