cryptum 0.0.313 → 0.0.315

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: 1af2b52f852e9bbf4444145d1ac3a0e65d2c2cbb2bad6f9b38937bfbe6b3ad11
4
- data.tar.gz: ceb7f155e11fe50e2e310e56f7b5dca5bec277830acb62393cb4650791198794
3
+ metadata.gz: 5782ff4633552d6cde3f64425b5b51f03582a75d6c11554583468c8f63250720
4
+ data.tar.gz: 9f2dd4006140a57225b7cfbf6ea4a58bce3953de8ffd2ddc408e65699ed89bb9
5
5
  SHA512:
6
- metadata.gz: 01bd5b1d9b7ed32b82ba267a793ae62d6ae45cac9cc26db42100ca31239d23d6ad209fd48259075d877f0160954d64284011cc828afb258a7dcb7ec69fe6477f
7
- data.tar.gz: 0f592c80e061b21e352b068d31019def360be9f67a7d4eac26f6844b876e366e267a3b6e6e89a55a5763269d6d8c6deaaecdabd1e29033a35f8bde11ae7a2473
6
+ metadata.gz: 1bb9a76cd89fdecda6135b5e68371b062a71b565e8e786f330361a2b21e9cf5a65f4b29cd2bfa496ac7ac3acd28883686779af458be1e92588b273d9e8b5ccfa
7
+ data.tar.gz: 6b581cb215d04766cbdc1d20cbeda2b34bc577ad9c8bd6b407b74184a376a958f2a7f718de4dc4e956bba39ced88ea27bae602d98346bb041c65eaba2d4d5804
@@ -122,7 +122,8 @@ module Cryptum
122
122
  when 60
123
123
  option_choice.market_trend_reset_label = '1m'
124
124
  else
125
- option_choice.market_trend_reset_label = option_choice.market_trend_reset
125
+ usage = true
126
+ reason = :market_trend_reset
126
127
  end
127
128
 
128
129
  if usage
@@ -132,7 +133,7 @@ module Cryptum
132
133
  when :repo_root
133
134
  puts "ERROR: #{option_choice.repo_root} does not exist.\n\n"
134
135
  when :market_trend_reset
135
- puts "ERROR: #{option_choice.market_trend_reset} Must be a positive integer between 60-86_400.\n\n"
136
+ puts "ERROR: #{option_choice.market_trend_reset} - Possible values are: 604_800 || 86_400 || 14_400 || 10_800 || 7_200 || 3_600 || 2_700 || 1_800 || 900 || 300 || 180 || 60\n\n"
136
137
  end
137
138
 
138
139
  puts `#{option_choice.driver_name} --help`
@@ -112,21 +112,68 @@ module Cryptum
112
112
  # Refactor TPM to be 0.01 > than fee tier,
113
113
  # particularly as fee tier goes up or down
114
114
  fees = event_history.order_book[:fees]
115
- taker_rate = 0.5
115
+ maker_rate = 0.4
116
+ maker_rate = fees[:maker_fee_rate].to_f unless fees.empty?
117
+ maker_fee = format('%0.2f', maker_rate * 100)
118
+
119
+ taker_rate = 0.6
116
120
  taker_rate = fees[:taker_fee_rate].to_f unless fees.empty?
117
121
  taker_fee = format('%0.2f', taker_rate * 100)
118
- default_net_tpm = 3
122
+ # BE EXTREMELY CAREFUL CHANGING THIS VALUE AS IT DICTATES
123
+ # THE TARGET PRICE AND SUBSEQUENT TIME IT TAKES FOR AN OPEN
124
+ # SELL ORDER TO BE TRIGGERED!!! SHOULD NEVER BE > 1
125
+ default_net_tpm = 1
119
126
 
120
127
  if ai_enabled
128
+ # Set default_net_tpm if AI is true in bot_conf.
121
129
  low_24h = event_history.order_book[:low_24h].to_f
122
130
  high_24h = event_history.order_book[:high_24h].to_f
123
- ai_net_tpm = (1 - (low_24h / high_24h)) * 100
131
+
132
+ case option_choice.market_trend_reset
133
+ when 604_800
134
+ # 1W Chart
135
+ ai_net_tpm = ((1 - (low_24h / high_24h)) * 100) * 7
136
+ when 86_400
137
+ # 1D Chart
138
+ ai_net_tpm = (1 - (low_24h / high_24h)) * 100
139
+ when 14_400
140
+ # 4H Chart
141
+ ai_net_tpm = ((1 - (low_24h / high_24h)) * 100) / 6
142
+ when 10_800
143
+ # 3H Chart
144
+ ai_net_tpm = ((1 - (low_24h / high_24h)) * 100) / 8
145
+ when 7_200
146
+ # 2H Chart
147
+ ai_net_tpm = ((1 - (low_24h / high_24h)) * 100) / 12
148
+ when 3_600
149
+ # 1H Chart
150
+ ai_net_tpm = ((1 - (low_24h / high_24h)) * 100) / 24
151
+ when 2_700
152
+ # 45m Chart
153
+ ai_net_tpm = (((1 - (low_24h / high_24h)) * 100) / 24) * 0.75
154
+ when 1_800
155
+ # 30m Chart
156
+ ai_net_tpm = (((1 - (low_24h / high_24h)) * 100) / 24) * 0.5
157
+ when 900
158
+ # 15m Chart
159
+ ai_net_tpm = (((1 - (low_24h / high_24h)) * 100) / 24) * 0.25
160
+ when 300
161
+ # 5m Chart
162
+ ai_net_tpm = (((1 - (low_24h / high_24h)) * 100) / 24) * 0.083
163
+ when 180
164
+ # 3m Chart
165
+ ai_net_tpm = (((1 - (low_24h / high_24h)) * 100) / 24) * 0.05
166
+ when 60
167
+ # 1m Chart
168
+ ai_net_tpm = (((1 - (low_24h / high_24h)) * 100) / 24) * 0.017
169
+ end
170
+
124
171
  default_net_tpm = ai_net_tpm if ai_net_tpm > default_net_tpm
125
172
  end
126
173
 
127
174
  min_gross_tpm = format(
128
175
  '%0.2f',
129
- (taker_fee.to_f * 2) + default_net_tpm
176
+ (maker_fee.to_f + taker_fee.to_f) + default_net_tpm
130
177
  )
131
178
 
132
179
  if ai_enabled && min_gross_tpm != gross_tpm.to_s
@@ -378,7 +378,7 @@ module Cryptum
378
378
  style = :bold
379
379
  if event_history.order_execute_win_active
380
380
  line_color = :blue
381
- header_color = :yellow
381
+ header_color = :blue
382
382
  header_style = :reverse
383
383
  end
384
384
 
@@ -412,6 +412,15 @@ module Cryptum
412
412
  string: header_str
413
413
  )
414
414
 
415
+ order_execute_win.setpos(out_line_no, Cryptum::UI.col_fourth)
416
+ order_execute_win.clrtoeol
417
+ Cryptum::UI.colorize(
418
+ ui_win: order_execute_win,
419
+ color: header_color,
420
+ style: header_style,
421
+ string: ''.ljust(col_just4, ' ')
422
+ )
423
+
415
424
  # ROWS 3-10
416
425
  remaining_blank_rows = 0
417
426
  remaining_blank_rows = max_rows_to_display if order_history_meta.empty?
@@ -538,6 +547,15 @@ module Cryptum
538
547
  string: header_str
539
548
  )
540
549
 
550
+ order_execute_win.setpos(out_line_no, Cryptum::UI.col_fourth)
551
+ order_execute_win.clrtoeol
552
+ Cryptum::UI.colorize(
553
+ ui_win: order_execute_win,
554
+ color: header_color,
555
+ style: header_style,
556
+ string: ''.ljust(col_just4, ' ')
557
+ )
558
+
541
559
  # ROW 11
542
560
  out_line_no += 1
543
561
  Cryptum::UI.line(
@@ -224,7 +224,7 @@ module Cryptum
224
224
  style = :bold
225
225
  if event_history.order_plan_win_active
226
226
  line_color = :blue
227
- header_color = :yellow
227
+ header_color = :blue
228
228
  header_style = :reverse
229
229
  end
230
230
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.313'
4
+ VERSION = '0.0.315'
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.313
4
+ version: 0.0.315
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.