cryptum 0.0.347 → 0.0.349

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: 361bea330d813c6882f2ef103686a502c1b44217e75cd165ed02edc388827bbd
4
- data.tar.gz: c5c3054d099deaec60d810b42fd9878878e99c0367e2d22346a871607e3cdb9a
3
+ metadata.gz: c0c000f85fb12c1e336e3cecf43e6f0c115adb8318509159f7c7da386af96039
4
+ data.tar.gz: 582a40ad9d1251912f95560db88a4a91cc83f8815c723470e0161a6c887651bd
5
5
  SHA512:
6
- metadata.gz: 3708dff657b574bfb45322a147e60e2ee9c00f2b679a874a9a49fe1d72a9956f381a457f5ee74b289c68b4577454587ae5e47e3f16e1098ff4000f7b1e492858
7
- data.tar.gz: a66ae834378131a367d56a4730916f7c48864cf6693cdd2de930dfcb4677fd7c11c8d88afe2604fd76990d3b19c2c511835b732efc440f261851934e279fcc52
6
+ metadata.gz: 7746a9725be9fec5bf6e27b69695d772c1ebeca5d69c18ff8d924fff34c321938c90547bc6548386db1f1a67dc2fa2298c335f0e7c97dae30ffb394ab6568937
7
+ data.tar.gz: 5e4bdb60efca76cc53d4ba81df2dcacd49e5175075e61e36668dd82cc62903156ce0f13174d7e6e370ca906dc8a23bbb601204f6db322d714c4f2aa50a5001dd
data/Gemfile CHANGED
@@ -29,7 +29,7 @@ gem 'rspec', '3.12.0'
29
29
  gem 'rubocop', '1.40.0'
30
30
  gem 'rubocop-rake', '0.6.0'
31
31
  gem 'rubocop-rspec', '2.16.0'
32
- gem 'ruby-prof', '1.4.3'
32
+ gem 'ruby-prof', '1.4.4'
33
33
  gem 'rvm', '1.11.3.9'
34
34
  gem 'sinatra', '3.0.5'
35
35
  gem 'thin', '1.8.1'
@@ -42,32 +42,39 @@ module Cryptum
42
42
  if buy_total > sell_total
43
43
  order_difference = buy_total - sell_total
44
44
  # Too Expensive
45
- # order_difference_out = Cryptum.beautify_large_number(
45
+ # order_difference = Cryptum.beautify_large_number(
46
46
  # value: order_difference
47
47
  # ).to_i
48
- motivation = 'BTD'
49
- motivation = 'FOMO' if event_history.bullish_trend
50
- indicator_hash[:color] = :green
51
- indicator_hash[:ui] = "#{motivation} | BUYS UP BY #{order_difference.to_i}"
48
+ motivation = 'BUYING DIP'
49
+ indicator_hash[:color] = :red
50
+ if event_history.bullish_trend
51
+ motivation = 'FOMO' if event_history.bullish_trend
52
+ indicator_hash[:color] = :green
53
+ end
54
+ trend = "BUYS #{Cryptum.up_arrow} BY #{order_difference.to_i}"
52
55
  indicator_hash[:status] = "B#{Cryptum.up_arrow}"
53
56
  elsif buy_total < sell_total
54
57
  order_difference = sell_total - buy_total
55
58
  # Too Expensive
56
- # order_difference_out = Cryptum.beautify_large_number(
59
+ # order_difference = Cryptum.beautify_large_number(
57
60
  # value: order_difference
58
61
  # ).to_i
59
- motivation = 'GTFO'
60
- motivation = 'TPROF' if event_history.bullish_trend
62
+ motivation = 'REKT'
61
63
  indicator_hash[:color] = :red
62
- indicator_hash[:ui] = "#{motivation} | SELLS UP BY #{order_difference.to_i}"
64
+ if event_history.bullish_trend
65
+ motivation = 'PROFITING' if event_history.bullish_trend
66
+ indicator_hash[:color] = :green
67
+ end
68
+ trend = "SELLS #{Cryptum.up_arrow} BY #{order_difference.to_i}"
63
69
  indicator_hash[:status] = "S#{Cryptum.up_arrow}"
64
70
  else
65
71
  # This Condition is Met When candle_buy_tot == candle_sell_tot
66
- motivation = 'WAIT / WATCH'
72
+ motivation = 'FLAT'
67
73
  indicator_hash[:color] = :yellow
68
- indicator_hash[:ui] = "#{motivation} | BUYS == SELLS"
74
+ trend = 'BUYS == SELLS'
69
75
  indicator_hash[:status] = "F#{Cryptum.up_arrow}"
70
76
  end
77
+ indicator_hash[:ui] = "Market is #{motivation} | #{trend}"
71
78
 
72
79
  indicator_status.market_trend = indicator_hash
73
80
  rescue StandardError => e
@@ -24,22 +24,8 @@ module Cryptum
24
24
  indicator_status: indicator_status
25
25
  )
26
26
 
27
- color = indicator_hash[:color]
28
- order_trend_out = indicator_hash[:ui]
29
-
30
- case color
31
- when :green
32
- order_trend_color = :green
33
- trend_arrow = Cryptum.up_arrow
34
- when :yellow
35
- order_trend_color = :yellow
36
- trend_arrow = Cryptum.flat_arrow
37
- when :red
38
- order_trend_color = :red
39
- trend_arrow = Cryptum.down_arrow
40
- end
41
-
42
- market_trend_out = "Market Trend #{trend_arrow} #{order_trend_out}"
27
+ market_trend_color = indicator_hash[:color]
28
+ market_trend_out = indicator_hash[:ui]
43
29
 
44
30
  # UI
45
31
  col_just1 = (Curses.cols - Cryptum::UI.col_first) - 1
@@ -59,7 +45,7 @@ module Cryptum
59
45
 
60
46
  Cryptum::UI.colorize(
61
47
  ui_win: market_trend_win,
62
- color: order_trend_color,
48
+ color: market_trend_color,
63
49
  string: ''.ljust(col_just1, ' ')
64
50
  )
65
51
 
@@ -69,7 +55,7 @@ module Cryptum
69
55
  )
70
56
  Cryptum::UI.colorize(
71
57
  ui_win: market_trend_win,
72
- color: order_trend_color,
58
+ color: market_trend_color,
73
59
  style: :bold,
74
60
  string: market_trend_out
75
61
  )
@@ -77,7 +63,7 @@ module Cryptum
77
63
  market_trend_win.setpos(out_line_no, Cryptum::UI.col_fourth)
78
64
  Cryptum::UI.colorize(
79
65
  ui_win: market_trend_win,
80
- color: order_trend_color,
66
+ color: market_trend_color,
81
67
  string: ''.ljust(col_just4, ' ')
82
68
  )
83
69
 
@@ -57,6 +57,9 @@ module Cryptum
57
57
  event_history.bullish_trend = true if cast_margin_to_sec.positive?
58
58
  event_history.bullish_trend = false if cast_margin_to_sec.negative?
59
59
 
60
+ buy_total = event_history.order_book[:market_trend][:buy].to_i
61
+ sell_total = event_history.order_book[:market_trend][:sell].to_i
62
+
60
63
  if event_history.order_book[:order_plan].length.positive?
61
64
  if event_history.order_ready
62
65
  event_history.order_book[:last_order_exec] = Time.now.strftime(
@@ -67,10 +70,11 @@ module Cryptum
67
70
  # BUY
68
71
  # Reset times to max or default depending on
69
72
  # BULL or BEAR market trend
70
- event_history.time_between_orders = event_history.time_between_orders_max if cast_margin_to_sec.positive?
73
+ event_history.time_between_orders = event_history.time_between_orders_max if buy_total >= sell_total &&
74
+ !event_history.bullish_trend
71
75
 
72
- event_history.time_between_orders = event_history.time_between_orders_reset if cast_margin_to_sec.negative? &&
73
- event_history.bullish_trend
76
+ event_history.time_between_orders = event_history.time_between_orders_reset if sell_total > buy_total &&
77
+ !event_history.bullish_trend
74
78
 
75
79
  if event_history.order_ready &&
76
80
  indicator_status.action_signal == :buy &&
@@ -40,6 +40,9 @@ module Cryptum
40
40
  value: format('%0.2f', order_exec_time_remaining)
41
41
  )
42
42
 
43
+ buy_total = event_history.order_book[:market_trend][:buy].to_i
44
+ sell_total = event_history.order_book[:market_trend][:sell].to_i
45
+
43
46
  color = :white
44
47
  color = indicator_status.market_trend[:color] if indicator_status.market_trend
45
48
  case color
@@ -50,7 +53,7 @@ module Cryptum
50
53
  intent = "- SEE ORDER HISTORY #{Cryptum.down_arrow} -"
51
54
  else
52
55
  speed = 'FAST'
53
- speed = 'SLOW' if event_history.bullish_trend
56
+ speed = 'SLOW' if buy_total >= sell_total
54
57
 
55
58
  intent = "- #{speed} BUY: #{order_countdown} of #{time_between_order_exec_out} -"
56
59
  intent = '- BUYING PAUSED -' if event_history.red_pill
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.347'
4
+ VERSION = '0.0.349'
5
5
  end
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.347
4
+ version: 0.0.349
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-17 00:00:00.000000000 Z
11
+ date: 2022-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -268,14 +268,14 @@ dependencies:
268
268
  requirements:
269
269
  - - '='
270
270
  - !ruby/object:Gem::Version
271
- version: 1.4.3
271
+ version: 1.4.4
272
272
  type: :runtime
273
273
  prerelease: false
274
274
  version_requirements: !ruby/object:Gem::Requirement
275
275
  requirements:
276
276
  - - '='
277
277
  - !ruby/object:Gem::Version
278
- version: 1.4.3
278
+ version: 1.4.4
279
279
  - !ruby/object:Gem::Dependency
280
280
  name: rvm
281
281
  requirement: !ruby/object:Gem::Requirement