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 +4 -4
- data/lib/cryptum/option.rb +3 -2
- data/lib/cryptum/order_book/market_trend.rb +51 -4
- data/lib/cryptum/ui/order_execution.rb +19 -1
- data/lib/cryptum/ui/order_plan.rb +1 -1
- data/lib/cryptum/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5782ff4633552d6cde3f64425b5b51f03582a75d6c11554583468c8f63250720
|
4
|
+
data.tar.gz: 9f2dd4006140a57225b7cfbf6ea4a58bce3953de8ffd2ddc408e65699ed89bb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bb9a76cd89fdecda6135b5e68371b062a71b565e8e786f330361a2b21e9cf5a65f4b29cd2bfa496ac7ac3acd28883686779af458be1e92588b273d9e8b5ccfa
|
7
|
+
data.tar.gz: 6b581cb215d04766cbdc1d20cbeda2b34bc577ad9c8bd6b407b74184a376a958f2a7f718de4dc4e956bba39ced88ea27bae602d98346bb041c65eaba2d4d5804
|
data/lib/cryptum/option.rb
CHANGED
@@ -122,7 +122,8 @@ module Cryptum
|
|
122
122
|
when 60
|
123
123
|
option_choice.market_trend_reset_label = '1m'
|
124
124
|
else
|
125
|
-
|
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}
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
(
|
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 = :
|
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(
|
data/lib/cryptum/version.rb
CHANGED