cryptum 0.0.343 → 0.0.345

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: 02c2b62902a2b501d2c85af3dd61def11d0b1e28e89787a4da96540323f6b32d
4
- data.tar.gz: 32db0b748869532f2e7a5662cec1c9eaa3d5dcdd3d2db57ea50468056669a769
3
+ metadata.gz: 2476e8d459d2cedb77447a65564b2ea564917e82ab806c03c617ed289be1f247
4
+ data.tar.gz: 5e30077ba732f84341c56811acb2613d39f6a244e05a0a3aacf67171a53e9331
5
5
  SHA512:
6
- metadata.gz: 170b724a61be52c129c3b37a54e193ed166e83c19511197acede93898cc7597f4fb13a1e49501a562f3b9b84000b982c990f0b41831fc28ab3b3a6111fd1da6d
7
- data.tar.gz: 6f404de1535cebc08cbea75d9a0f32b402e8814b4ebe2aa0bf4b7470705ceb87560259396c42057a4624a5022191b1ea498a5c8ff9baef37e62c92e62b77e602
6
+ metadata.gz: 2bfa1a93abce00e987a79964d87dbce1a08fb5276b260791820c344a1c4080c4b276f11290029327149fbaf4108d3b6890593bfbd2e08461b6d3555bdd787183
7
+ data.tar.gz: a9609ebc72a394b2368533dacf37a639cb37106c4619c3a9d036b64def573ff8dd35d5c07d406a92708136d91d561bd4d7188932807b1c909663ff982394b579
data/Gemfile CHANGED
@@ -31,7 +31,7 @@ gem 'rubocop-rake', '0.6.0'
31
31
  gem 'rubocop-rspec', '2.16.0'
32
32
  gem 'ruby-prof', '1.4.3'
33
33
  gem 'rvm', '1.11.3.9'
34
- gem 'sinatra', '3.0.4'
34
+ gem 'sinatra', '3.0.5'
35
35
  gem 'thin', '1.8.1'
36
36
  gem 'tty-prompt', '0.23.1'
37
37
  gem 'tty-spinner', '0.9.3'
@@ -45,8 +45,10 @@ module Cryptum
45
45
  # order_difference_out = Cryptum.beautify_large_number(
46
46
  # value: order_difference
47
47
  # ).to_i
48
+ motivation = 'BUYING THE DIP'
49
+ motivation = 'FOMO' if event_history.bullish_trend
48
50
  indicator_hash[:color] = :green
49
- indicator_hash[:ui] = "BUYS UP BY #{order_difference.to_i}"
51
+ indicator_hash[:ui] = "#{motivation} | BUYS UP BY #{order_difference.to_i}"
50
52
  indicator_hash[:status] = "B#{Cryptum.up_arrow}"
51
53
  elsif buy_total < sell_total
52
54
  order_difference = sell_total - buy_total
@@ -54,13 +56,16 @@ module Cryptum
54
56
  # order_difference_out = Cryptum.beautify_large_number(
55
57
  # value: order_difference
56
58
  # ).to_i
59
+ motivation = 'GETTING THE F* OUT'
60
+ motivation = 'TAKING PROFITS' if event_history.bullish_trend
57
61
  indicator_hash[:color] = :red
58
- indicator_hash[:ui] = "SELLS UP BY #{order_difference.to_i}"
62
+ indicator_hash[:ui] = "#{motivation} | SELLS UP BY #{order_difference.to_i}"
59
63
  indicator_hash[:status] = "S#{Cryptum.up_arrow}"
60
64
  else
61
65
  # This Condition is Met When candle_buy_tot == candle_sell_tot
66
+ motivation = 'WAIT / WATCH'
62
67
  indicator_hash[:color] = :yellow
63
- indicator_hash[:ui] = 'BUYS == SELLS'
68
+ indicator_hash[:ui] = "#{motivation} | BUYS == SELLS"
64
69
  indicator_hash[:status] = "F#{Cryptum.up_arrow}"
65
70
  end
66
71
 
@@ -39,7 +39,7 @@ module Cryptum
39
39
  trend_arrow = Cryptum.down_arrow
40
40
  end
41
41
 
42
- market_trend_out = "Market Trend #{trend_arrow} | #{order_trend_out}"
42
+ market_trend_out = "Market Trend #{trend_arrow} #{order_trend_out}"
43
43
 
44
44
  # UI
45
45
  col_just1 = (Curses.cols - Cryptum::UI.col_first) - 1
@@ -49,6 +49,14 @@ module Cryptum
49
49
  order_history_meta = event_history.order_book[:order_history_meta]
50
50
  order_history = event_history.order_book[:order_history] if option_choice.autotrade
51
51
 
52
+ margin_percent_open_24h = (1 - (open_24h / ticker_price)) * 100
53
+ cast_margin_to_sec = margin_percent_open_24h * 0.1
54
+
55
+ # Reset times to max or default depending on
56
+ # BULL or BEAR market trend
57
+ event_history.bullish_trend = true if cast_margin_to_sec.positive?
58
+ event_history.bullish_trend = false if cast_margin_to_sec.negative?
59
+
52
60
  if event_history.order_book[:order_plan].length.positive?
53
61
  if event_history.order_ready
54
62
  event_history.order_book[:last_order_exec] = Time.now.strftime(
@@ -57,22 +65,12 @@ module Cryptum
57
65
  end
58
66
 
59
67
  # BUY
60
- margin_percent_open_24h = (1 - (open_24h / ticker_price)) * 100
61
- cast_margin_to_sec = margin_percent_open_24h * 0.1
62
-
63
68
  # Reset times to max or default depending on
64
69
  # BULL or BEAR market trend
65
- if cast_margin_to_sec.positive?
66
- event_history.bullish_trend = true
67
- event_history.time_between_orders = event_history.time_between_orders_max
68
- end
69
-
70
- if cast_margin_to_sec.negative? &&
71
- event_history.bullish_trend
70
+ event_history.time_between_orders = event_history.time_between_orders_max if cast_margin_to_sec.positive?
72
71
 
73
- event_history.bullish_trend = false
74
- event_history.time_between_orders = event_history.time_between_orders_reset
75
- end
72
+ event_history.time_between_orders = event_history.time_between_orders_reset if cast_margin_to_sec.negative? &&
73
+ event_history.bullish_trend
76
74
 
77
75
  if event_history.order_ready &&
78
76
  indicator_status.action_signal == :buy &&
@@ -166,7 +166,7 @@ module Cryptum
166
166
  plan_no_slice += 1
167
167
  end
168
168
  order_plan.last[:last_slice] = true if order_plan.any?
169
- op_last_slice_invest = order_plan.last[:invest].to_f
169
+ op_last_slice_invest = order_plan.last[:invest].to_f if order_plan.any?
170
170
  order_plan.last[:invest] = fiat_budget if order_plan.any? &&
171
171
  op_last_slice_invest > fiat_budget &&
172
172
  fiat_budget > min_market_funds.to_f
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.343'
4
+ VERSION = '0.0.345'
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.343
4
+ version: 0.0.345
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-16 00:00:00.000000000 Z
11
+ date: 2022-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -296,14 +296,14 @@ dependencies:
296
296
  requirements:
297
297
  - - '='
298
298
  - !ruby/object:Gem::Version
299
- version: 3.0.4
299
+ version: 3.0.5
300
300
  type: :runtime
301
301
  prerelease: false
302
302
  version_requirements: !ruby/object:Gem::Requirement
303
303
  requirements:
304
304
  - - '='
305
305
  - !ruby/object:Gem::Version
306
- version: 3.0.4
306
+ version: 3.0.5
307
307
  - !ruby/object:Gem::Dependency
308
308
  name: thin
309
309
  requirement: !ruby/object:Gem::Requirement