cryptum 0.0.271 → 0.0.273
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 +7 -7
- data/bin/cryptum +6 -4
- data/lib/cryptum/event/bot_conf.rb +2 -0
- data/lib/cryptum/event/history.rb +4 -2
- data/lib/cryptum/event/order_book.rb +5 -3
- data/lib/cryptum/event.rb +1 -0
- data/lib/cryptum/option.rb +2 -2
- data/lib/cryptum/order_book/generate.rb +1 -6
- data/lib/cryptum/ui/order_execute_details.rb +104 -29
- data/lib/cryptum/ui/order_plan.rb +25 -12
- data/lib/cryptum/ui/order_plan_details.rb +5 -18
- data/lib/cryptum/version.rb +1 -1
- data/lib/cryptum/web_sock/event_machine.rb +1 -0
- data/lib/cryptum.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 448c1b3f990829ef87c5adc398ddcaea4b46c62acee1723785bf79572c6d2b89
|
4
|
+
data.tar.gz: 76fdd8d8e3258291eb3644417d9094a926cfa425c126ff7b3a2f7bb37d7fb31b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92418c47f83fe60acf22473eff5d72516e41d903f03f4484b6e67943287102758d24a1c08299f8a832136658a48876efdbc293b03adb323c10d2dcec0d2c4eed
|
7
|
+
data.tar.gz: 6150d6bdf97804e728a707cbdb06a93f174fae0da0f18a7883a0abbded5a6ba615377eff28dc68ace6004406a2867282b70dc3b1bdc641acd90cc6d0788fde3e
|
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-
|
3
|
+
# on 2022-12-06 22:57:28 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
|
@@ -87,11 +87,11 @@ Layout/TrailingWhitespace:
|
|
87
87
|
- 'lib/cryptum/ui/order_plan.rb'
|
88
88
|
- 'lib/cryptum/ui/order_timer.rb'
|
89
89
|
|
90
|
-
# Offense count:
|
90
|
+
# Offense count: 87
|
91
91
|
Lint/UselessAssignment:
|
92
92
|
Enabled: false
|
93
93
|
|
94
|
-
# Offense count:
|
94
|
+
# Offense count: 47
|
95
95
|
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes.
|
96
96
|
Metrics/AbcSize:
|
97
97
|
Max: 405
|
@@ -100,14 +100,14 @@ Metrics/AbcSize:
|
|
100
100
|
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
|
101
101
|
# AllowedMethods: refine
|
102
102
|
Metrics/BlockLength:
|
103
|
-
Max:
|
103
|
+
Max: 146
|
104
104
|
|
105
105
|
# Offense count: 4
|
106
106
|
# Configuration parameters: CountBlocks.
|
107
107
|
Metrics/BlockNesting:
|
108
108
|
Max: 4
|
109
109
|
|
110
|
-
# Offense count:
|
110
|
+
# Offense count: 20
|
111
111
|
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
|
112
112
|
Metrics/CyclomaticComplexity:
|
113
113
|
Max: 73
|
@@ -122,7 +122,7 @@ Metrics/MethodLength:
|
|
122
122
|
Metrics/ModuleLength:
|
123
123
|
Max: 538
|
124
124
|
|
125
|
-
# Offense count:
|
125
|
+
# Offense count: 20
|
126
126
|
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
|
127
127
|
Metrics/PerceivedComplexity:
|
128
128
|
Max: 76
|
@@ -218,7 +218,7 @@ Style/TrailingCommaInArrayLiteral:
|
|
218
218
|
Exclude:
|
219
219
|
- 'lib/cryptum/matrix.rb'
|
220
220
|
|
221
|
-
# Offense count:
|
221
|
+
# Offense count: 21
|
222
222
|
# This cop supports safe autocorrection (--autocorrect).
|
223
223
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
|
224
224
|
# URISchemes: http, https
|
data/bin/cryptum
CHANGED
@@ -28,6 +28,9 @@ begin
|
|
28
28
|
# Exist and Initialize Automated Trading Parameters
|
29
29
|
bot_conf = Cryptum::BotConf.read(option_choice: option_choice)
|
30
30
|
|
31
|
+
# Initialize Curses UI
|
32
|
+
terminal_win = Cryptum::UI.init
|
33
|
+
|
31
34
|
# Generate an Order Book for Session Tracking
|
32
35
|
# Load previous order_book_justification from
|
33
36
|
# Order Book File (if it exists) to preserve
|
@@ -37,11 +40,10 @@ begin
|
|
37
40
|
start_time: start_time,
|
38
41
|
option_choice: option_choice,
|
39
42
|
env: env,
|
40
|
-
bot_conf: bot_conf
|
43
|
+
bot_conf: bot_conf,
|
44
|
+
terminal_win: terminal_win
|
41
45
|
)
|
42
|
-
|
43
|
-
# Initialize Curses UI
|
44
|
-
terminal_win = Cryptum::UI.init
|
46
|
+
terminal_win.key_press_event.key_w = true
|
45
47
|
|
46
48
|
# Connect to WebSocket
|
47
49
|
# Trigger Events as Event Data
|
@@ -9,8 +9,10 @@ module Cryptum
|
|
9
9
|
# )
|
10
10
|
public_class_method def self.reload(opts = {})
|
11
11
|
terminal_win = opts[:terminal_win]
|
12
|
+
event_history = opts[:event_history]
|
12
13
|
option_choice = opts[:option_choice]
|
13
14
|
|
15
|
+
event_history.recalculate_order_plan = true
|
14
16
|
terminal_win.key_press_event.key_r = false
|
15
17
|
Cryptum.read_bot_conf(option_choice: option_choice)
|
16
18
|
rescue StandardError => e
|
@@ -35,7 +35,8 @@ module Cryptum
|
|
35
35
|
:order_execute_index_offset,
|
36
36
|
:order_execute_max_rows_to_display,
|
37
37
|
:order_execute_row_to_select,
|
38
|
-
:order_execute_selected_data
|
38
|
+
:order_execute_selected_data,
|
39
|
+
:recalculate_order_plan
|
39
40
|
|
40
41
|
def initialize(opts = {})
|
41
42
|
# option_choice = opts[:option_choice]
|
@@ -48,7 +49,7 @@ module Cryptum
|
|
48
49
|
self.order_submitted = false
|
49
50
|
self.order_ready = false
|
50
51
|
self.order_book = order_book
|
51
|
-
self.plan_no =
|
52
|
+
self.plan_no = 1
|
52
53
|
self.start_time = start_time
|
53
54
|
self.reconnected = false
|
54
55
|
self.red_pill = false
|
@@ -64,6 +65,7 @@ module Cryptum
|
|
64
65
|
self.order_execute_max_rows_to_display = 6
|
65
66
|
self.order_execute_row_to_select = order_execute_index_offset
|
66
67
|
self.order_execute_selected_data = { color: :white }
|
68
|
+
self.recalculate_order_plan = false
|
67
69
|
|
68
70
|
# TODO: Implement market_trend_reset / 144
|
69
71
|
# Default = 10 minutes
|
@@ -14,9 +14,11 @@ module Cryptum
|
|
14
14
|
|
15
15
|
terminal_win.key_press_event.key_w = false
|
16
16
|
order_book_file = event_history.order_book[:path]
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
|
18
|
+
File.write(
|
19
|
+
order_book_file,
|
20
|
+
JSON.pretty_generate(event_history.order_book)
|
21
|
+
)
|
20
22
|
rescue StandardError => e
|
21
23
|
raise e
|
22
24
|
end
|
data/lib/cryptum/event.rb
CHANGED
data/lib/cryptum/option.rb
CHANGED
@@ -56,7 +56,7 @@ module Cryptum
|
|
56
56
|
options.on(
|
57
57
|
'-tSECONDS',
|
58
58
|
'--time-between-market-trend-reset=SECONDS',
|
59
|
-
'<Optional - Seconds Between Market Trend Reset (Default
|
59
|
+
'<Optional - Seconds Between Market Trend Reset (Default 60 i.e. 1 hour)>'
|
60
60
|
) { |t| option_choice.market_trend_reset = t.to_i }
|
61
61
|
end.parse!
|
62
62
|
|
@@ -89,7 +89,7 @@ module Cryptum
|
|
89
89
|
reason = :repo_root
|
90
90
|
end
|
91
91
|
|
92
|
-
option_choice.market_trend_reset =
|
92
|
+
option_choice.market_trend_reset = 60 if option_choice.market_trend_reset.to_i.zero?
|
93
93
|
unless option_choice.market_trend_reset.to_i >= 60 &&
|
94
94
|
option_choice.market_trend_reset <= 86_400
|
95
95
|
usage = true
|
@@ -40,7 +40,7 @@ module Cryptum
|
|
40
40
|
this_product_arr = products.select do |product|
|
41
41
|
product if product[:id] == option_choice.symbol.to_s.gsub('_', '-').upcase
|
42
42
|
end
|
43
|
-
this_product = this_product_arr.
|
43
|
+
this_product = this_product_arr.last
|
44
44
|
|
45
45
|
order_book = {
|
46
46
|
path: order_book_file,
|
@@ -84,11 +84,6 @@ module Cryptum
|
|
84
84
|
order_book: order_book
|
85
85
|
)
|
86
86
|
|
87
|
-
# Write order_book to file at session initiation
|
88
|
-
File.open(order_book_file, 'w') do |f|
|
89
|
-
f.puts order_book.to_json
|
90
|
-
end
|
91
|
-
|
92
87
|
event_history.order_book = order_book
|
93
88
|
|
94
89
|
event_history
|
@@ -18,59 +18,86 @@ module Cryptum
|
|
18
18
|
indicator_status = opts[:indicator_status]
|
19
19
|
key_press_event = opts[:key_press_event]
|
20
20
|
|
21
|
-
|
22
|
-
tpm =
|
23
|
-
autotrade_percent =
|
24
|
-
order_color =
|
21
|
+
order_meta_data = event_history.order_execute_selected_data
|
22
|
+
tpm = order_meta_data[:tpm]
|
23
|
+
autotrade_percent = order_meta_data[:autotrade_percent]
|
24
|
+
order_color = order_meta_data[:color].to_sym
|
25
25
|
|
26
|
-
order_plan_no =
|
26
|
+
order_plan_no = order_meta_data[:plan_no]
|
27
27
|
case order_color
|
28
28
|
when :cyan, :red
|
29
|
-
order_id =
|
30
|
-
order_type = 'Buy'
|
29
|
+
order_id = order_meta_data[:buy_order_id]
|
31
30
|
when :green, :magenta, :yellow
|
32
|
-
order_id =
|
33
|
-
order_type = 'Sell'
|
31
|
+
order_id = order_meta_data[:sell_order_id]
|
34
32
|
when :black
|
35
33
|
order_id = 'Expired'
|
36
|
-
order_type = 'Expired'
|
37
34
|
else
|
38
35
|
order_id = 'N/A'
|
39
|
-
|
36
|
+
end
|
37
|
+
|
38
|
+
order_id_details = "- ID: #{order_id}"
|
39
|
+
|
40
|
+
order_history_arr = event_history.order_book[:order_history].select do |order|
|
41
|
+
order if order[:id] == order_id
|
42
|
+
end
|
43
|
+
|
44
|
+
order_type_ln = '- Type: N/A'
|
45
|
+
order_status_ln = '- Status: N/A'
|
46
|
+
order_hist_created_ln = '- Creation Date: N/A'
|
47
|
+
order_hist_finished_ln = '- Finished Date: N/A'
|
48
|
+
if order_history_arr.any?
|
49
|
+
order_history = order_history_arr.first
|
50
|
+
order_type = order_history[:type].capitalize
|
51
|
+
time_in_force = order_history[:time_in_force].upcase
|
52
|
+
order_status = order_history[:status].upcase
|
53
|
+
created_at = order_history[:created_at]
|
54
|
+
order_hist_created_ln = "- Creation Date: #{created_at}"
|
55
|
+
|
56
|
+
order_side = order_history[:side].capitalize
|
57
|
+
case order_side.to_sym
|
58
|
+
when :Buy
|
59
|
+
expire_time = order_history[:expire_time]
|
60
|
+
done_at = order_history[:done_at]
|
61
|
+
order_hist_finished_ln = "- Expiring Date: #{expire_time}"
|
62
|
+
when :Sell
|
63
|
+
done_at = order_history[:done_at]
|
64
|
+
end
|
65
|
+
order_hist_finished_ln = "- Finished Date: #{done_at}" if done_at
|
66
|
+
|
67
|
+
order_type_ln = "- Type: #{order_type} #{order_side} #{time_in_force}"
|
68
|
+
order_status_ln = "- Status: #{order_status}"
|
40
69
|
end
|
41
70
|
|
42
71
|
risk_alloc_out = Cryptum.beautify_large_number(
|
43
|
-
value:
|
72
|
+
value: order_meta_data[:risk_alloc]
|
44
73
|
)
|
45
74
|
invest_out = Cryptum.beautify_large_number(
|
46
|
-
value:
|
75
|
+
value: order_meta_data[:invest]
|
47
76
|
)
|
48
77
|
price_out = Cryptum.beautify_large_number(
|
49
|
-
value:
|
78
|
+
value: order_meta_data[:price]
|
50
79
|
)
|
51
80
|
size_out = Cryptum.beautify_large_number(
|
52
|
-
value:
|
81
|
+
value: order_meta_data[:size]
|
53
82
|
)
|
54
83
|
target_price_out = Cryptum.beautify_large_number(
|
55
|
-
value:
|
84
|
+
value: order_meta_data[:target_price]
|
56
85
|
)
|
57
86
|
profit_out = Cryptum.beautify_large_number(
|
58
|
-
value:
|
87
|
+
value: order_meta_data[:profit]
|
59
88
|
)
|
60
|
-
plan_no = "#{
|
61
|
-
|
62
|
-
created_at = order[:created_at]
|
89
|
+
plan_no = "#{order_meta_data[:plan_no]}|"
|
63
90
|
|
64
91
|
invest = "$#{invest_out} @ "
|
65
92
|
tick = "$#{price_out} = "
|
66
93
|
size = "*#{size_out} + "
|
67
|
-
tpm_out = "#{
|
94
|
+
tpm_out = "#{order_meta_data[:tpm]}% = "
|
68
95
|
targ_tick = "$#{target_price_out}"
|
69
|
-
profit = "|Profit: $#{
|
96
|
+
profit = "|Profit: $#{order_meta_data[:profit]}"
|
70
97
|
|
71
|
-
|
72
|
-
|
73
|
-
|
98
|
+
meta_ln = "- Metadata: #{invest}#{tick}#{size}#{tpm_out}#{targ_tick}#{profit}"
|
99
|
+
meta_ln = '- Metadata:'
|
100
|
+
meta_color_ln = " - Color: #{order_color}"
|
74
101
|
|
75
102
|
# UI
|
76
103
|
col_just1 = (Curses.cols - Cryptum::UI.col_first) - 1
|
@@ -102,7 +129,7 @@ module Cryptum
|
|
102
129
|
string: ''.ljust(col_just1, ' ')
|
103
130
|
)
|
104
131
|
|
105
|
-
header_str = "- ORDER ##{
|
132
|
+
header_str = "- ORDER ##{order_meta_data[:plan_no]} DETAILS -"
|
106
133
|
order_execute_details_win.setpos(
|
107
134
|
out_line_no,
|
108
135
|
Cryptum::UI.col_center(str: header_str)
|
@@ -127,6 +154,18 @@ module Cryptum
|
|
127
154
|
string: order_id_details.ljust(col_just1, ' ')
|
128
155
|
)
|
129
156
|
|
157
|
+
# ROW 4
|
158
|
+
out_line_no += 1
|
159
|
+
order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
|
160
|
+
order_execute_details_win.clrtoeol
|
161
|
+
|
162
|
+
Cryptum::UI.colorize(
|
163
|
+
ui_win: order_execute_details_win,
|
164
|
+
color: order_color,
|
165
|
+
style: style,
|
166
|
+
string: order_type_ln.ljust(col_just1, ' ')
|
167
|
+
)
|
168
|
+
|
130
169
|
# ROW 5
|
131
170
|
out_line_no += 1
|
132
171
|
order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
|
@@ -136,10 +175,46 @@ module Cryptum
|
|
136
175
|
ui_win: order_execute_details_win,
|
137
176
|
color: order_color,
|
138
177
|
style: style,
|
139
|
-
string:
|
178
|
+
string: order_status_ln.ljust(col_just1, ' ')
|
140
179
|
)
|
141
180
|
|
142
|
-
# ROW
|
181
|
+
# ROW 6
|
182
|
+
out_line_no += 1
|
183
|
+
order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
|
184
|
+
order_execute_details_win.clrtoeol
|
185
|
+
|
186
|
+
Cryptum::UI.colorize(
|
187
|
+
ui_win: order_execute_details_win,
|
188
|
+
color: order_color,
|
189
|
+
style: style,
|
190
|
+
string: order_hist_created_ln.ljust(col_just1, ' ')
|
191
|
+
)
|
192
|
+
|
193
|
+
# ROW 7
|
194
|
+
out_line_no += 1
|
195
|
+
order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
|
196
|
+
order_execute_details_win.clrtoeol
|
197
|
+
|
198
|
+
Cryptum::UI.colorize(
|
199
|
+
ui_win: order_execute_details_win,
|
200
|
+
color: order_color,
|
201
|
+
style: style,
|
202
|
+
string: order_hist_finished_ln.ljust(col_just1, ' ')
|
203
|
+
)
|
204
|
+
|
205
|
+
# ROW 8
|
206
|
+
out_line_no += 1
|
207
|
+
order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
|
208
|
+
order_execute_details_win.clrtoeol
|
209
|
+
|
210
|
+
Cryptum::UI.colorize(
|
211
|
+
ui_win: order_execute_details_win,
|
212
|
+
color: order_color,
|
213
|
+
style: style,
|
214
|
+
string: meta_ln.ljust(col_just1, ' ')
|
215
|
+
)
|
216
|
+
|
217
|
+
# ROW 9
|
143
218
|
out_line_no += 1
|
144
219
|
order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
|
145
220
|
order_execute_details_win.clrtoeol
|
@@ -148,7 +223,7 @@ module Cryptum
|
|
148
223
|
ui_win: order_execute_details_win,
|
149
224
|
color: order_color,
|
150
225
|
style: style,
|
151
|
-
string:
|
226
|
+
string: meta_color_ln.ljust(col_just1, ' ')
|
152
227
|
)
|
153
228
|
|
154
229
|
# Clear to OK ROW
|
@@ -80,21 +80,27 @@ module Cryptum
|
|
80
80
|
|
81
81
|
event_history.red_pill = true if crypto_invested_percent.to_f > autotrade_percent
|
82
82
|
|
83
|
-
if
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
83
|
+
if event_history.recalculate_order_plan || (
|
84
|
+
crypto_invested_percent.to_f <= autotrade_percent &&
|
85
|
+
autotrade_percent.positive? && (
|
86
|
+
order_plan.empty? || (
|
87
|
+
indicator_status.action_signal == :buy &&
|
88
|
+
indicator_status.last_action_signal == :sell
|
89
|
+
)
|
88
90
|
)
|
89
91
|
)
|
90
92
|
|
91
93
|
event_history.red_pill = false
|
92
|
-
|
93
|
-
|
94
|
+
if indicator_status.action_signal == :buy &&
|
95
|
+
indicator_status.last_action_signal == :sell
|
96
|
+
|
97
|
+
order_plan = []
|
98
|
+
# Reset time between orders
|
99
|
+
event_history.time_between_orders = event_history.time_between_orders_reset
|
100
|
+
event_history.plan_no += 1
|
101
|
+
end
|
94
102
|
|
95
|
-
order_plan = []
|
96
103
|
plan_no_slice = 1
|
97
|
-
event_history.plan_no += 1
|
98
104
|
plan_no = event_history.plan_no
|
99
105
|
# Sum up currently invested amount so we don't
|
100
106
|
# exceed autotrade % for next order plan generation
|
@@ -124,8 +130,14 @@ module Cryptum
|
|
124
130
|
next unless fiat_budget >= min_market_funds.to_f
|
125
131
|
|
126
132
|
slice_alloc = risk_alloc * allocation_decimal
|
127
|
-
|
128
|
-
|
133
|
+
this_plan_no = "#{plan_no}.#{plan_no_slice}"
|
134
|
+
if event_history.recalculate_order_plan
|
135
|
+
order_slice = order_plan.find do |order|
|
136
|
+
order[:plan_no] == this_plan_no
|
137
|
+
end
|
138
|
+
end
|
139
|
+
order_slice ||= {}
|
140
|
+
order_slice[:plan_no] = this_plan_no
|
129
141
|
order_slice[:fiat_available] = format('%0.2f', fiat_budget)
|
130
142
|
order_slice[:risk_alloc] = format('%0.2f', risk_alloc)
|
131
143
|
order_slice[:allocation_decimal] = format(
|
@@ -142,11 +154,12 @@ module Cryptum
|
|
142
154
|
order_slice[:return] = format('%0.2f', fiat_returning)
|
143
155
|
order_slice[:profit] = format('%0.2f', profit)
|
144
156
|
|
145
|
-
order_plan.push(order_slice)
|
157
|
+
order_plan.push(order_slice) unless event_history.recalculate_order_plan
|
146
158
|
fiat_budget -= fiat_investing
|
147
159
|
plan_no_slice += 1
|
148
160
|
end
|
149
161
|
event_history.order_book[:order_plan] = order_plan
|
162
|
+
event_history.recalculate_order_plan = false
|
150
163
|
end
|
151
164
|
|
152
165
|
red_pill_alert = '| RED PILL ALERT |'
|
@@ -42,12 +42,11 @@ module Cryptum
|
|
42
42
|
return_out = Cryptum.beautify_large_number(
|
43
43
|
value: order[:return]
|
44
44
|
)
|
45
|
-
autotrade_details = "1.
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
profit = " equal to #{tpm_out}% $#{return_out} will be returned. With $#{invest_out} invested the profit equals $#{profit_out}."
|
45
|
+
autotrade_details = "1. Autotrade is set to #{autotrade_percent}% of $#{fiat_avail_out}, making $#{risk_alloc_out} available for this slice in the order plan."
|
46
|
+
slice_alloc_details = "2. With $#{risk_alloc_out} available and a slice allocation of #{order[:allocation_percent]}%, $#{slice_alloc_out} OR AN ORDER MINIMUM of $#{invest_out} will"
|
47
|
+
invest_details = ' be allocated for this slice (whichever is highest).'
|
48
|
+
tpm_details = "3. With a slice allocation of $#{invest_out}, plus a TPM equal to #{tpm_out}%, $#{return_out} will be returned once sold."
|
49
|
+
profit = " With $#{invest_out} invested the gross profit equals $#{profit_out}, minus any transaction fees."
|
51
50
|
|
52
51
|
# UI
|
53
52
|
col_just1 = (Curses.cols - Cryptum::UI.col_first) - 1
|
@@ -104,18 +103,6 @@ module Cryptum
|
|
104
103
|
string: autotrade_details.ljust(col_just1, ' ')
|
105
104
|
)
|
106
105
|
|
107
|
-
# ROW 4
|
108
|
-
out_line_no += 1
|
109
|
-
order_plan_details_win.setpos(out_line_no, Cryptum::UI.col_first)
|
110
|
-
order_plan_details_win.clrtoeol
|
111
|
-
|
112
|
-
Cryptum::UI.colorize(
|
113
|
-
ui_win: order_plan_details_win,
|
114
|
-
color: order_color,
|
115
|
-
style: style,
|
116
|
-
string: risk_alloc_details.ljust(col_just1, ' ')
|
117
|
-
)
|
118
|
-
|
119
106
|
# ROW 5
|
120
107
|
out_line_no += 1
|
121
108
|
order_plan_details_win.setpos(out_line_no, Cryptum::UI.col_first)
|
data/lib/cryptum/version.rb
CHANGED
data/lib/cryptum.rb
CHANGED
@@ -158,10 +158,10 @@ module Cryptum
|
|
158
158
|
# Cryptum Statistics Only Apply to
|
159
159
|
# Live Sessions
|
160
160
|
if event_history
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
161
|
+
File.write(
|
162
|
+
order_book_file,
|
163
|
+
JSON.pretty_generate(event_history.order_book)
|
164
|
+
)
|
165
165
|
end
|
166
166
|
|
167
167
|
Curses.close_screen
|
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.
|
4
|
+
version: 0.0.273
|
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-
|
11
|
+
date: 2022-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|