cryptum 0.0.442 → 0.0.444

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: beb3d7bb0d7bbd857513f0018035e966b79e785133e51ae604713c6eec65db3c
4
- data.tar.gz: 6af841ee74d4be8c3f1f2580796ca3815e79497ae7016866388df42d9e75d6c2
3
+ metadata.gz: 537b7ef6bd68e8cf4d8d45d2f313478b251eedac37c2cee5604ed5a00c1af54e
4
+ data.tar.gz: 5651b234e49855aafb436ffdb0fec701b1d57b48d626dc5d0d0e6b357e48df2f
5
5
  SHA512:
6
- metadata.gz: 3c688946f82913c5af07633226adca0ee5390fb5342a0df7b4c81dd994185baba2d7d82380719f3624f00786ceee7b81d132b5f9578bef605c6d376dc17becea
7
- data.tar.gz: 5f6b2f5043bb5de8c4876c51ab8835aedaa4ea47ecadda5a190f5192a02026d4bfe164f0c2b7dcaef2b5be8540061c3447c85d200f8aab4e40d78621bbd0a986
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: 436.3
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: 86
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: 84
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.%N%z')
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)
@@ -29,7 +29,7 @@ module Cryptum
29
29
  end
30
30
  this_product = this_product_arr.last
31
31
 
32
- ftimestr = '%Y-%m-%d %H:%M:%S.%N%z'
32
+ ftimestr = '%Y-%m-%d %H:%M:%S%z'
33
33
 
34
34
  order_book = {
35
35
  path: order_book_file,
@@ -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.%N%z'
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.%N%z'
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 Completed Sell Orders w/ Green
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.%N%z')
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.%N%z')
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
- meta[:done_at] = Time.now.strftime('%Y-%m-%d %H:%M:%S.%N%z')
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.%N%z')
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.%N%z')
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.%N%z')
484
+ ).strftime('%Y-%m-%d %H:%M:%S%z')
483
485
  end
484
486
  end
485
487
 
@@ -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.%N%z')
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}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.442'
4
+ VERSION = '0.0.444'
5
5
  end
@@ -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
- # event_history.order_book[:market_trend][:buy] = 0
220
- # event_history.order_book[:market_trend][:sell] = 0
221
- # event_history.order_book[:last_trend_reset] = Time.now.strftime(
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
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.442
4
+ version: 0.0.444
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.