cryptum 0.0.442 → 0.0.444
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.yml +3 -3
- data/lib/cryptum/event/history.rb +1 -1
- data/lib/cryptum/order_book/generate.rb +1 -1
- data/lib/cryptum/order_book/market_trend.rb +1 -1
- data/lib/cryptum/ui/order/execute.rb +10 -8
- data/lib/cryptum/ui/ticker.rb +1 -1
- data/lib/cryptum/version.rb +1 -1
- data/lib/cryptum/web_sock/event_machine.rb +3 -6
- 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: 537b7ef6bd68e8cf4d8d45d2f313478b251eedac37c2cee5604ed5a00c1af54e
|
4
|
+
data.tar.gz: 5651b234e49855aafb436ffdb0fec701b1d57b48d626dc5d0d0e6b357e48df2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 941bd956696ee1f61b0c3225a71a36839719ae996dca6cf50e484d47f1890dc59d26ba4be1c21c009ab2047c0c42259075e5de0af3923f9b7c5d473b58865f1e
|
7
|
+
data.tar.gz: 0554fe71c6b8c91c56854567136585a0561eb84fe8e8640e029b188da85666b49d766104ed4327e4eaddf4ecc93fd21a16c08e0641ffab3392c280eb68ce5f70
|
data/.rubocop.yml
CHANGED
@@ -6,7 +6,7 @@ Layout/LineLength:
|
|
6
6
|
Lint/UselessRescue:
|
7
7
|
Enabled: false
|
8
8
|
Metrics/AbcSize:
|
9
|
-
Max:
|
9
|
+
Max: 442.8
|
10
10
|
Metrics/BlockLength:
|
11
11
|
Max: 138
|
12
12
|
Metrics/BlockNesting:
|
@@ -14,13 +14,13 @@ Metrics/BlockNesting:
|
|
14
14
|
Metrics/ClassLength:
|
15
15
|
Max: 134
|
16
16
|
Metrics/CyclomaticComplexity:
|
17
|
-
Max:
|
17
|
+
Max: 88
|
18
18
|
Metrics/MethodLength:
|
19
19
|
Max: 418
|
20
20
|
Metrics/ModuleLength:
|
21
21
|
Max: 428
|
22
22
|
Metrics/PerceivedComplexity:
|
23
|
-
Max:
|
23
|
+
Max: 86
|
24
24
|
Style/HashSyntax:
|
25
25
|
EnforcedShorthandSyntax: never
|
26
26
|
|
@@ -80,7 +80,7 @@ module Cryptum
|
|
80
80
|
self.reconnected = false
|
81
81
|
self.red_pill = false
|
82
82
|
self.recalculate_order_plan = false
|
83
|
-
self.start_time = Time.now.strftime('%Y-%m-%d %H:%M:%S
|
83
|
+
self.start_time = Time.now.strftime('%Y-%m-%d %H:%M:%S%z')
|
84
84
|
|
85
85
|
# -------------------------------------------------- #
|
86
86
|
# SAUCE 3 (SAUCE 4 RELATES TO SAUCE 3)
|
@@ -81,7 +81,7 @@ module Cryptum
|
|
81
81
|
event_history.order_book[:market_trend][:buy] = 0
|
82
82
|
event_history.order_book[:market_trend][:sell] = 0
|
83
83
|
event_history.order_book[:last_trend_reset] = Time.now.strftime(
|
84
|
-
'%Y-%m-%d %H:%M:%S
|
84
|
+
'%Y-%m-%d %H:%M:%S%z'
|
85
85
|
)
|
86
86
|
|
87
87
|
event_history
|
@@ -65,7 +65,7 @@ module Cryptum
|
|
65
65
|
if event_history.order_book[:order_plan].length.positive?
|
66
66
|
if event_history.order_ready
|
67
67
|
event_history.order_book[:last_order_exec] = Time.now.strftime(
|
68
|
-
'%Y-%m-%d %H:%M:%S
|
68
|
+
'%Y-%m-%d %H:%M:%S%z'
|
69
69
|
)
|
70
70
|
end
|
71
71
|
|
@@ -165,7 +165,7 @@ module Cryptum
|
|
165
165
|
end
|
166
166
|
end
|
167
167
|
|
168
|
-
# Update
|
168
|
+
# Update Orders w/ Colors
|
169
169
|
if event_type == :open &&
|
170
170
|
event_side == :buy
|
171
171
|
|
@@ -183,7 +183,7 @@ module Cryptum
|
|
183
183
|
order_history_meta.each do |meta|
|
184
184
|
next unless meta[:buy_order_id] == buy_order_id
|
185
185
|
|
186
|
-
meta[:done_at] = Time.now.strftime('%Y-%m-%d %H:%M:%S
|
186
|
+
meta[:done_at] = Time.now.strftime('%Y-%m-%d %H:%M:%S%z')
|
187
187
|
meta[:color] = :white
|
188
188
|
end
|
189
189
|
end
|
@@ -231,7 +231,7 @@ module Cryptum
|
|
231
231
|
order_history_meta.each do |meta|
|
232
232
|
next unless meta[:sell_order_id] == sell_order_id
|
233
233
|
|
234
|
-
meta[:done_at] = Time.now.strftime('%Y-%m-%d %H:%M:%S
|
234
|
+
meta[:done_at] = Time.now.strftime('%Y-%m-%d %H:%M:%S%z')
|
235
235
|
|
236
236
|
# Reinitiate GTFO if the previous GTFO Order Expires.
|
237
237
|
terminal_win.key_press_event.key_g = true if meta[:color] == :magenta
|
@@ -267,7 +267,9 @@ module Cryptum
|
|
267
267
|
learning_arr.push(learning)
|
268
268
|
end
|
269
269
|
|
270
|
-
|
270
|
+
oh_sold = order_history.find { |oh| oh[:id] == sell_order_id }
|
271
|
+
meta[:done_at] = oh_sold[:done_at] unless oh_sold.nil?
|
272
|
+
meta[:done_at] ||= Time.now.strftime('%Y-%m-%d %H:%M:%S%z')
|
271
273
|
meta[:color] = :green
|
272
274
|
|
273
275
|
# Obtain buy && sell order details from order history
|
@@ -463,13 +465,13 @@ module Cryptum
|
|
463
465
|
unless buy_created_at_hash_arr.empty?
|
464
466
|
order_exec_last_ln = Time.parse(
|
465
467
|
buy_created_at_hash_arr.first[:created_at]
|
466
|
-
).strftime('%Y-%m-%d %H:%M:%S
|
468
|
+
).strftime('%Y-%m-%d %H:%M:%S%z')
|
467
469
|
end
|
468
470
|
when :green, :white
|
469
471
|
if meta[:done_at]
|
470
472
|
order_exec_last_ln = Time.parse(
|
471
473
|
meta[:done_at]
|
472
|
-
).strftime('%Y-%m-%d %H:%M:%S
|
474
|
+
).strftime('%Y-%m-%d %H:%M:%S%z')
|
473
475
|
end
|
474
476
|
when :magenta, :yellow
|
475
477
|
sell_created_at_hash_arr = order_history.select do |oh|
|
@@ -479,7 +481,7 @@ module Cryptum
|
|
479
481
|
unless sell_created_at_hash_arr.empty?
|
480
482
|
order_exec_last_ln = Time.parse(
|
481
483
|
sell_created_at_hash_arr.first[:created_at]
|
482
|
-
).strftime('%Y-%m-%d %H:%M:%S
|
484
|
+
).strftime('%Y-%m-%d %H:%M:%S%z')
|
483
485
|
end
|
484
486
|
end
|
485
487
|
|
data/lib/cryptum/ui/ticker.rb
CHANGED
@@ -36,7 +36,7 @@ module Cryptum
|
|
36
36
|
# if last_sequence + 1 < sequence
|
37
37
|
# sequence_diff = sequence - last_sequence
|
38
38
|
# File.open('/tmp/cryptum-errors.txt', 'a') do |f|
|
39
|
-
# f.puts Time.now.strftime('%Y-%m-%d %H:%M:%S
|
39
|
+
# f.puts Time.now.strftime('%Y-%m-%d %H:%M:%S%z')
|
40
40
|
# f.puts "Module: #{self}"
|
41
41
|
# f.puts 'Messages likely dropped:'
|
42
42
|
# f.puts "This Sequence: #{sequence}"
|
data/lib/cryptum/version.rb
CHANGED
@@ -216,12 +216,9 @@ module Cryptum
|
|
216
216
|
EM.add_periodic_timer(option_choice.market_trend_reset) do
|
217
217
|
# NOTE: To ensure the integrity of event_history is maintained,
|
218
218
|
# changes to its contents _MUST_ stay in this block.
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
# '%Y-%m-%d %H:%M:%S.%N%z'
|
223
|
-
# )
|
224
|
-
event_history = Cryptum::OrderBook::MarketTrend.reset(event_history: event_history)
|
219
|
+
event_history = Cryptum::OrderBook::MarketTrend.reset(
|
220
|
+
event_history: event_history
|
221
|
+
)
|
225
222
|
|
226
223
|
# Reload Bot Conf (i.e. Risk Allocation)
|
227
224
|
# Recalculate Order Plan, and Write to File
|