cryptum 0.0.451 → 0.0.452

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5751edf041ccf1b015706553b994f229a45f8c47f0238dca33b566102ff253b
4
- data.tar.gz: 75a62906adbb8b3d1589c96b708319c3633a8f7efb68dcb995e84a717a36abe2
3
+ metadata.gz: 6d6c8c355fd03538785ac48aec8903bcab7cbf8e5836c58b04a54d7097226f1f
4
+ data.tar.gz: 7ac941cbc7664c6f7a93ab0b9435baa2b18092a06e0aafb1a04cac5734ee2933
5
5
  SHA512:
6
- metadata.gz: e54da51a666394f3ce4632f0bf14afe0ef28a0d71c25ad413403bc8938bf8278081b1c6d8637a07f5f4ab8dd877aad950defa6910ae15bea92a8da0c51d7e9f2
7
- data.tar.gz: 9fd5c8f3778cc064e993ea52ef1357c5bcb61718f4397b9d1c8ba1f373c4863a0023d680dc96174461f8e167345929a93441014c92b7a9ede807fd0716278947
6
+ metadata.gz: 856f94579e0da11c2413c956a86bbc7e8f5edc68d362fab33fcbfefb07b031cd26904dbca57ea915714f42fcad65e54ac6fdc452749ec7ce35037817454752b6
7
+ data.tar.gz: '009270dbf188f8fa91b689154d9e09d6036aee635cf3ed67295c041c290c4571d475c54b73958746b19cf3df6d7ae48aca4d44e47d088a304d9a27dc3337d953'
@@ -315,20 +315,33 @@ module Cryptum
315
315
  end
316
316
  order_hist_meta_sold_twenty_four = ohm_sold_twenty_four_arr.length
317
317
 
318
- # Snag all expired orders
319
- oh_meta_expired_arr = order_history_meta.select do |ohm|
320
- ohm[:color].to_sym == :white && ohm.key?(:done_at)
318
+ # Calculate Average Round Trip for Sold Orders
319
+ # (i.e. Time between buy && sell dates)
320
+ avg_round_trip_days_out = 0.0
321
+ unless oh_meta_sold_arr.empty?
322
+ round_trip_aggregate = 0
323
+ oh_meta_sold_arr.each do |ohm|
324
+ buy_date = Time.parse(ohm[:buy_details][:done_at])
325
+ sell_date = Time.parse(ohm[:sell_details][:done_at])
326
+ round_trip_aggregate += sell_date - buy_date
327
+ end
328
+ avg_round_trip_days = (round_trip_aggregate / oh_meta_sold_arr.length) / 86_400.0
329
+ avg_round_trip_days_out = format('%.2f', avg_round_trip_days)
321
330
  end
322
- order_hist_meta_expired = oh_meta_expired_arr.length
331
+ # Snag all expired orders
332
+ # oh_meta_expired_arr = order_history_meta.select do |ohm|
333
+ # ohm[:color].to_sym == :white && ohm.key?(:done_at)
334
+ # end
335
+ # order_hist_meta_expired = oh_meta_expired_arr.length
323
336
 
324
337
  # Snag all expired orders within past 24 hrs
325
- ohm_expire_twenty_four_arr = []
326
- unless oh_meta_expired_arr.empty?
327
- ohm_expire_twenty_four_arr = oh_meta_expired_arr.select do |o|
328
- Time.parse(o[:done_at]) >= twenty_four_hrs_ago
329
- end
330
- end
331
- order_hist_meta_24h_expired = ohm_expire_twenty_four_arr.length
338
+ # ohm_expire_twenty_four_arr = []
339
+ # unless oh_meta_expired_arr.empty?
340
+ # ohm_expire_twenty_four_arr = oh_meta_expired_arr.select do |o|
341
+ # Time.parse(o[:done_at]) >= twenty_four_hrs_ago
342
+ # end
343
+ # end
344
+ # order_hist_meta_24h_expired = ohm_expire_twenty_four_arr.length
332
345
 
333
346
  # Calculate gains within past 24 hrs
334
347
  # && Calculate gains YTD
@@ -551,7 +564,7 @@ module Cryptum
551
564
  header_str = "SELLING: #{total_to_sell} w tProf: $#{total_selling_profit_out} | "
552
565
  header_str += "SOLD 24h: #{order_hist_meta_sold_twenty_four} YTD: #{order_hist_meta_sold} | "
553
566
  header_str += "GAINS 24h: $#{gains_24h_out} YTD: $#{gains_out} | "
554
- header_str += "EXPIRED 24h: #{order_hist_meta_24h_expired} Tot: #{order_hist_meta_expired}"
567
+ header_str += "AVG RND TRIP DAYS: #{avg_round_trip_days_out}"
555
568
  order_execute_win.setpos(
556
569
  out_line_no,
557
570
  Cryptum::UI.col_center(str: header_str)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.451'
4
+ VERSION = '0.0.452'
5
5
  end
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.451
4
+ version: 0.0.452
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.