cryptum 0.0.257 → 0.0.259
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +14 -11
- data/lib/cryptum/event/history.rb +5 -6
- data/lib/cryptum/option/choice.rb +2 -1
- data/lib/cryptum/option.rb +11 -0
- data/lib/cryptum/order_book/market_trend.rb +2 -16
- data/lib/cryptum/ui/ticker.rb +1 -1
- data/lib/cryptum/version.rb +1 -1
- data/lib/cryptum/web_sock/event_machine.rb +17 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab14ca560e814d115f113801ad78732ba8d10acce087f6eaadc143233424ffa4
|
4
|
+
data.tar.gz: 47bc5482fba211e04bf7ef299fafd323cf5388908d5786779cda36885748d198
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb7dd04b5337366f545a283d6b1dc184c1680279aa88f2d423ad4544374f018c2ec5cef61a15f1770bb39f69d0092898d8af198329b80c6b005321ae3c249df0
|
7
|
+
data.tar.gz: 949378bda3b6959556f3f888795780e46fe5e1e857814254273f4658ad5a4b81a81c0b86aa55b8e325e026a5ed51e67082cdc5740d2df12e23c25afeb63d0ff6
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2022-12-01
|
3
|
+
# on 2022-12-01 23:59:06 UTC using RuboCop version 1.39.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -103,7 +103,7 @@ Layout/TrailingWhitespace:
|
|
103
103
|
- 'lib/cryptum/ui/order_plan.rb'
|
104
104
|
- 'lib/cryptum/ui/order_timer.rb'
|
105
105
|
|
106
|
-
# Offense count:
|
106
|
+
# Offense count: 52
|
107
107
|
Lint/UselessAssignment:
|
108
108
|
Exclude:
|
109
109
|
- 'bin/cryptum-forecast'
|
@@ -113,6 +113,7 @@ Lint/UselessAssignment:
|
|
113
113
|
- 'lib/cryptum/event/buy.rb'
|
114
114
|
- 'lib/cryptum/event/cancel.rb'
|
115
115
|
- 'lib/cryptum/order_book/generate.rb'
|
116
|
+
- 'lib/cryptum/order_book/market_trend.rb'
|
116
117
|
- 'lib/cryptum/ui/market_trend.rb'
|
117
118
|
- 'lib/cryptum/ui/order_execution.rb'
|
118
119
|
- 'lib/cryptum/ui/order_plan.rb'
|
@@ -123,13 +124,13 @@ Lint/UselessAssignment:
|
|
123
124
|
# Offense count: 39
|
124
125
|
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes.
|
125
126
|
Metrics/AbcSize:
|
126
|
-
Max:
|
127
|
+
Max: 387
|
127
128
|
|
128
129
|
# Offense count: 7
|
129
130
|
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
|
130
131
|
# AllowedMethods: refine
|
131
132
|
Metrics/BlockLength:
|
132
|
-
Max:
|
133
|
+
Max: 141
|
133
134
|
|
134
135
|
# Offense count: 4
|
135
136
|
# Configuration parameters: CountBlocks.
|
@@ -156,6 +157,14 @@ Metrics/ModuleLength:
|
|
156
157
|
Metrics/PerceivedComplexity:
|
157
158
|
Max: 75
|
158
159
|
|
160
|
+
# Offense count: 1
|
161
|
+
# This cop supports safe autocorrection (--autocorrect).
|
162
|
+
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
|
163
|
+
# SupportedStyles: assign_to_condition, assign_inside_condition
|
164
|
+
Style/ConditionalAssignment:
|
165
|
+
Exclude:
|
166
|
+
- 'lib/cryptum/option.rb'
|
167
|
+
|
159
168
|
# Offense count: 1
|
160
169
|
# Configuration parameters: AllowedConstants.
|
161
170
|
Style/Documentation:
|
@@ -207,12 +216,6 @@ Style/RedundantReturn:
|
|
207
216
|
Exclude:
|
208
217
|
- 'lib/cryptum.rb'
|
209
218
|
|
210
|
-
# Offense count: 4
|
211
|
-
# This cop supports safe autocorrection (--autocorrect).
|
212
|
-
Style/RedundantSelf:
|
213
|
-
Exclude:
|
214
|
-
- 'lib/cryptum/event/history.rb'
|
215
|
-
|
216
219
|
# Offense count: 1
|
217
220
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
218
221
|
Style/StringChars:
|
@@ -244,7 +247,7 @@ Style/TrailingCommaInArrayLiteral:
|
|
244
247
|
Exclude:
|
245
248
|
- 'lib/cryptum/matrix.rb'
|
246
249
|
|
247
|
-
# Offense count:
|
250
|
+
# Offense count: 14
|
248
251
|
# This cop supports safe autocorrection (--autocorrect).
|
249
252
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
|
250
253
|
# URISchemes: http, https
|
@@ -18,7 +18,6 @@ module Cryptum
|
|
18
18
|
:plan_no,
|
19
19
|
:reconnected,
|
20
20
|
:red_pill,
|
21
|
-
:reset_market_trend,
|
22
21
|
:start_time,
|
23
22
|
:ticker_event,
|
24
23
|
:time_between_orders,
|
@@ -49,19 +48,19 @@ module Cryptum
|
|
49
48
|
self.start_time = start_time
|
50
49
|
self.reconnected = false
|
51
50
|
self.red_pill = false
|
52
|
-
self.reset_market_trend = false
|
53
51
|
self.order_plan_win_active = true
|
54
52
|
self.order_plan_index_offset = 0
|
55
53
|
self.order_plan_max_rows_to_display = 7
|
56
|
-
self.order_plan_row_to_select =
|
54
|
+
self.order_plan_row_to_select = order_plan_index_offset
|
57
55
|
self.order_execute_win_active = false
|
58
56
|
self.order_execute_index_offset = 0
|
59
57
|
self.order_execute_max_rows_to_display = 6
|
60
|
-
self.order_execute_row_to_select =
|
58
|
+
self.order_execute_row_to_select = order_execute_index_offset
|
61
59
|
|
62
|
-
#
|
60
|
+
# TODO: Implement market_trend_reset / 144
|
61
|
+
# Default = 10 minutes
|
63
62
|
self.time_between_orders = 600
|
64
|
-
self.time_between_orders_reset =
|
63
|
+
self.time_between_orders_reset = time_between_orders
|
65
64
|
|
66
65
|
# 1 hour
|
67
66
|
self.time_between_orders_max = 3_600
|
data/lib/cryptum/option.rb
CHANGED
@@ -95,6 +95,17 @@ module Cryptum
|
|
95
95
|
reason = :market_trend_reset
|
96
96
|
end
|
97
97
|
|
98
|
+
case option_choice.market_trend_reset
|
99
|
+
when 86_400
|
100
|
+
option_choice.market_trend_reset_label = 'D'
|
101
|
+
when 3_600
|
102
|
+
option_choice.market_trend_reset_label = '1h'
|
103
|
+
when 60
|
104
|
+
option_choice.market_trend_reset_label = '1m'
|
105
|
+
else
|
106
|
+
option_choice.market_trend_reset_label = option_choice.market_trend_reset
|
107
|
+
end
|
108
|
+
|
98
109
|
if usage
|
99
110
|
case reason
|
100
111
|
when :symbol
|
@@ -14,15 +14,6 @@ module Cryptum
|
|
14
14
|
event = opts[:event]
|
15
15
|
indicator_status = opts[:indicator_status]
|
16
16
|
|
17
|
-
# Decent for debugging.
|
18
|
-
# puts event.inspect
|
19
|
-
|
20
|
-
if event_history.reset_market_trend
|
21
|
-
event_history.order_book[:market_trend][:buy] = 0
|
22
|
-
event_history.order_book[:market_trend][:sell] = 0
|
23
|
-
event_history.reset_market_trend = false
|
24
|
-
end
|
25
|
-
|
26
17
|
buy_or_sell = event[:changes].first[0].to_s.to_sym
|
27
18
|
case buy_or_sell
|
28
19
|
when :buy
|
@@ -134,17 +125,12 @@ module Cryptum
|
|
134
125
|
)
|
135
126
|
end
|
136
127
|
|
137
|
-
# Reload Bot Conf (i.e. Risk Allocation)
|
138
|
-
terminal_win.key_press_event.key_r = true
|
139
|
-
|
140
128
|
# Reset Market Trend Counter
|
141
|
-
event_history.
|
129
|
+
event_history.order_book[:market_trend][:buy] = 0
|
130
|
+
event_history.order_book[:market_trend][:sell] = 0
|
142
131
|
event_history.order_book[:last_trend_reset] = Time.now.strftime(
|
143
132
|
'%Y-%m-%d %H:%M:%S.%N%z'
|
144
133
|
)
|
145
|
-
|
146
|
-
# Write Order Book to Disk
|
147
|
-
terminal_win.key_press_event.key_w = true
|
148
134
|
rescue StandardError => e
|
149
135
|
raise e
|
150
136
|
end
|
data/lib/cryptum/ui/ticker.rb
CHANGED
@@ -18,7 +18,7 @@ module Cryptum
|
|
18
18
|
quote_increment = this_product[:quote_increment]
|
19
19
|
fiat_smallest_decimal = quote_increment.to_s.split('.')[-1].length
|
20
20
|
|
21
|
-
symbol_out = "#{this_product[:id]}.#{option_choice.
|
21
|
+
symbol_out = "#{this_product[:id]}.#{option_choice.market_trend_reset_label}"
|
22
22
|
fiat = this_product[:quote_currency].to_sym
|
23
23
|
fiat_symbol = '?'
|
24
24
|
fiat_symbol = '$' if fiat == :USD
|
data/lib/cryptum/version.rb
CHANGED
@@ -197,8 +197,18 @@ module Cryptum
|
|
197
197
|
key_press_event: terminal_win.key_press_event
|
198
198
|
)
|
199
199
|
|
200
|
-
|
201
|
-
|
200
|
+
if order_countdown.zero? ||
|
201
|
+
order_countdown.negative?
|
202
|
+
|
203
|
+
# Ready to Submit a BUY order
|
204
|
+
event_history.order_ready = true
|
205
|
+
|
206
|
+
# Reload Bot Conf (i.e. Risk Allocation)
|
207
|
+
terminal_win.key_press_event.key_r = true
|
208
|
+
|
209
|
+
# Write Order Book to Disk
|
210
|
+
terminal_win.key_press_event.key_w = true
|
211
|
+
end
|
202
212
|
end
|
203
213
|
|
204
214
|
EM.add_periodic_timer(option_choice.market_trend_reset) do
|
@@ -208,6 +218,11 @@ module Cryptum
|
|
208
218
|
event_history: event_history,
|
209
219
|
bot_conf: bot_conf
|
210
220
|
)
|
221
|
+
# Reload Bot Conf (i.e. Risk Allocation)
|
222
|
+
terminal_win.key_press_event.key_r = true
|
223
|
+
|
224
|
+
# Write Order Book to Disk
|
225
|
+
terminal_win.key_press_event.key_w = true
|
211
226
|
end
|
212
227
|
end
|
213
228
|
rescue Faye::WebSocket::API::ErrorEvent,
|
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.
|
4
|
+
version: 0.0.259
|
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-
|
11
|
+
date: 2022-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|