cryptum 0.0.373 → 0.0.375
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 +4 -4
- data/.rubocop_todo.yml +7 -2
- data/README.md +5 -2
- data/lib/cryptum/event/history.rb +111 -12
- data/lib/cryptum/option.rb +1 -1
- data/lib/cryptum/ui/order_execution.rb +2 -1
- data/lib/cryptum/ui/order_timer.rb +1 -1
- data/lib/cryptum/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77b1b6e404a5b14add7a262c2b04b370321d566bad8cb8d9fdac7a0e288437df
|
4
|
+
data.tar.gz: cbffd4853c9051aa098e18685b8e698c25d667078b84f709f90e432b528dafde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebb46350bedbd06367e60c55ef2f445d15bbaa2635e4cc2eada3e5c8679d5858c100eaea8e7a3144413683b87a451e45886446437dbbadf87126e13e1789f7ff
|
7
|
+
data.tar.gz: 6183a1a1104e5afce857e67116d0e533d6b07f6826bd3e876f26ce94dbe3f855777b7cd4ea829f396b7c30fd050a7125a6e7e859c4386cd9e876f1786dd57701
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2023-
|
3
|
+
# on 2023-03-29 14:29:26 UTC using RuboCop version 1.48.1.
|
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
|
@@ -15,6 +15,11 @@ Lint/UselessAssignment:
|
|
15
15
|
Lint/UselessRescue:
|
16
16
|
Enabled: false
|
17
17
|
|
18
|
+
# Offense count: 1
|
19
|
+
# Configuration parameters: CountComments, CountAsOne.
|
20
|
+
Metrics/ClassLength:
|
21
|
+
Max: 131
|
22
|
+
|
18
23
|
# Offense count: 4
|
19
24
|
# This cop supports safe autocorrection (--autocorrect).
|
20
25
|
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
|
@@ -24,7 +29,7 @@ Style/ConditionalAssignment:
|
|
24
29
|
- 'lib/cryptum/event/pane.rb'
|
25
30
|
- 'lib/cryptum/ui/order_execute_details.rb'
|
26
31
|
|
27
|
-
# Offense count:
|
32
|
+
# Offense count: 23
|
28
33
|
# Configuration parameters: AllowedConstants.
|
29
34
|
Style/Documentation:
|
30
35
|
Enabled: false
|
data/README.md
CHANGED
@@ -69,13 +69,16 @@ USAGE: cryptum [opts]
|
|
69
69
|
--[no-]reset-session-countdown
|
70
70
|
-r, --session-root=PATH <Optional - Directory with etc && order_books (Defaults to ~/cryptum)>
|
71
71
|
-S, --[no-]sandbox <Optional - Use Coinbase Sandbox Environment for Testing Ideas>
|
72
|
-
-tSECONDS, <Optional - Seconds Between Market Trend Reset (Default
|
72
|
+
-tSECONDS, <Optional - Seconds Between Market Trend Reset (Default 86_400 i.e. 1 day)>
|
73
73
|
--time-between-market-trend-reset
|
74
|
+
```
|
74
75
|
|
76
|
+
Example usage to trade on weekly instead of default daily:
|
77
|
+
```
|
75
78
|
$ cryptum --symbol btc-usd \
|
76
79
|
--autotrade \
|
77
80
|
--session-root ~/cryptum \
|
78
|
-
--time-between-market-trend-reset
|
81
|
+
--time-between-market-trend-reset 604_800
|
79
82
|
```
|
80
83
|
|
81
84
|
By default, cryptum resets the market trend (i.e. number of buys vs number of sells) every day (i.e. 86400 seconds). As Maker & Taker fees drop in value, it may be useful to change the market trend reset value to something lower:
|
@@ -44,7 +44,7 @@ module Cryptum
|
|
44
44
|
:recalculate_order_plan
|
45
45
|
|
46
46
|
def initialize(opts = {})
|
47
|
-
|
47
|
+
option_choice = opts[:option_choice]
|
48
48
|
start_time = opts[:start_time]
|
49
49
|
order_book = opts[:order_book]
|
50
50
|
|
@@ -78,20 +78,119 @@ module Cryptum
|
|
78
78
|
self.start_time = start_time
|
79
79
|
|
80
80
|
# -------------------------------------------------- #
|
81
|
-
# SAUCE 4
|
82
|
-
|
83
|
-
|
84
|
-
|
81
|
+
# SAUCE 3 (SAUCE 4 RELATES TO SAUCE 3)
|
82
|
+
case option_choice.market_trend_reset_label
|
83
|
+
when '1W'
|
84
|
+
# SLOW BUY = 1 day
|
85
|
+
self.time_between_orders_max = 86_400
|
85
86
|
|
86
|
-
|
87
|
-
|
88
|
-
|
87
|
+
# FAST BUY = 4 hours
|
88
|
+
self.time_between_orders = 14_400
|
89
|
+
self.time_between_orders_reset = time_between_orders
|
89
90
|
|
90
|
-
|
91
|
-
|
91
|
+
# 1 hour
|
92
|
+
self.time_between_orders_min = 3_600
|
93
|
+
when '1D'
|
94
|
+
# SLOW BUY = 4 hours
|
95
|
+
self.time_between_orders_max = 14_400
|
92
96
|
|
93
|
-
|
94
|
-
|
97
|
+
# FAST BUY = 3 hours
|
98
|
+
self.time_between_orders = 10_800
|
99
|
+
self.time_between_orders_reset = time_between_orders
|
100
|
+
|
101
|
+
# 45 minutes
|
102
|
+
self.time_between_orders_min = 2_700
|
103
|
+
when '4h'
|
104
|
+
# SLOW BUY = 3 hours
|
105
|
+
self.time_between_orders_max = 10_800
|
106
|
+
|
107
|
+
# FAST BUY = 2 hours
|
108
|
+
self.time_between_orders = 7_200
|
109
|
+
self.time_between_orders_reset = time_between_orders
|
110
|
+
|
111
|
+
# 30 minutes
|
112
|
+
self.time_between_orders_min = 1_800
|
113
|
+
when '3h'
|
114
|
+
# SLOW BUY = 2 hours
|
115
|
+
self.time_between_orders_max = 7_200
|
116
|
+
|
117
|
+
# FAST BUY = 1 hour
|
118
|
+
self.time_between_orders = 3_600
|
119
|
+
self.time_between_orders_reset = time_between_orders
|
120
|
+
|
121
|
+
# 15 minutes
|
122
|
+
self.time_between_orders_min = 900
|
123
|
+
when '2h'
|
124
|
+
# SLOW BUY = 1 hour
|
125
|
+
self.time_between_orders_max = 3_600
|
126
|
+
|
127
|
+
# FAST BUY = 45 minutes
|
128
|
+
self.time_between_orders = 2_700
|
129
|
+
self.time_between_orders_reset = time_between_orders
|
130
|
+
|
131
|
+
# 5 minutes
|
132
|
+
self.time_between_orders_min = 300
|
133
|
+
when '1h'
|
134
|
+
# SLOW BUY = 45 minutes
|
135
|
+
self.time_between_orders_max = 2_700
|
136
|
+
|
137
|
+
# FAST BUY = 30 minutes
|
138
|
+
self.time_between_orders = 1_800
|
139
|
+
self.time_between_orders_reset = time_between_orders
|
140
|
+
|
141
|
+
# 3 minutes
|
142
|
+
self.time_between_orders_min = 180
|
143
|
+
when '45m'
|
144
|
+
# SLOW BUY = 30 minutes
|
145
|
+
self.time_between_orders_max = 1_800
|
146
|
+
|
147
|
+
# FAST BUY = 15 minutes
|
148
|
+
self.time_between_orders = 900
|
149
|
+
self.time_between_orders_reset = time_between_orders
|
150
|
+
|
151
|
+
# 1 minute
|
152
|
+
self.time_between_orders_min = 60
|
153
|
+
when '30m'
|
154
|
+
# SLOW BUY = 15 minutes
|
155
|
+
self.time_between_orders_max = 900
|
156
|
+
|
157
|
+
# FAST BUY = 5 minutes
|
158
|
+
self.time_between_orders = 300
|
159
|
+
self.time_between_orders_reset = time_between_orders
|
160
|
+
|
161
|
+
# 1 minute
|
162
|
+
self.time_between_orders_min = 60
|
163
|
+
when '15m'
|
164
|
+
# SLOW BUY = 5 minutes
|
165
|
+
self.time_between_orders_max = 300
|
166
|
+
|
167
|
+
# FAST BUY = 3 minutes
|
168
|
+
self.time_between_orders = 180
|
169
|
+
self.time_between_orders_reset = time_between_orders
|
170
|
+
|
171
|
+
# 1 minute
|
172
|
+
self.time_between_orders_min = 60
|
173
|
+
when '5m'
|
174
|
+
# SLOW BUY = 3 minutes
|
175
|
+
self.time_between_orders_max = 180
|
176
|
+
|
177
|
+
# FAST BUY = 1 minute
|
178
|
+
self.time_between_orders = 60
|
179
|
+
self.time_between_orders_reset = time_between_orders
|
180
|
+
|
181
|
+
# 1 minute
|
182
|
+
self.time_between_orders_min = 60
|
183
|
+
when '3m', '1m'
|
184
|
+
# SLOW BUY = 1 minute
|
185
|
+
self.time_between_orders_max = 60
|
186
|
+
|
187
|
+
# FAST BUY = 1 minute
|
188
|
+
self.time_between_orders = 60
|
189
|
+
self.time_between_orders_reset = time_between_orders
|
190
|
+
|
191
|
+
# 1 minute
|
192
|
+
self.time_between_orders_min = 60
|
193
|
+
end
|
95
194
|
# -------------------------------------------------- #
|
96
195
|
end
|
97
196
|
rescue Interrupt
|
data/lib/cryptum/option.rb
CHANGED
@@ -62,7 +62,7 @@ module Cryptum
|
|
62
62
|
options.on(
|
63
63
|
'-tSECONDS',
|
64
64
|
'--time-between-market-trend-reset=SECONDS',
|
65
|
-
'<Optional - Seconds Between Market Trend Reset (Default
|
65
|
+
'<Optional - Seconds Between Market Trend Reset (Default 86_400 i.e. 1 day)>'
|
66
66
|
) { |t| option_choice.market_trend_reset = t.to_i }
|
67
67
|
end.parse!
|
68
68
|
|
@@ -99,6 +99,7 @@ module Cryptum
|
|
99
99
|
f.puts "Last Order: #{last_order}"
|
100
100
|
f.puts "Last Purchase Price: #{last_purchase_price}"
|
101
101
|
f.puts "Limit Price (Should be <= quote_increment-- ^): #{limit_price}"
|
102
|
+
f.puts "\n\n\n"
|
102
103
|
end
|
103
104
|
|
104
105
|
price = format(
|
@@ -163,7 +164,7 @@ module Cryptum
|
|
163
164
|
order_history_meta.push(this_order)
|
164
165
|
end
|
165
166
|
|
166
|
-
# SAUCE 3
|
167
|
+
# SAUCE 4 (SAUCE 3 RELATES TO SAUCE 4)
|
167
168
|
# Time between orders
|
168
169
|
# Increment n Seconds between buys to
|
169
170
|
# account for bearish and bullish trends
|
@@ -65,7 +65,7 @@ module Cryptum
|
|
65
65
|
# TODO: add condition to check if open sell orders exist.
|
66
66
|
# If so intent should be something like, "- SEE ORDER HISTORY -"
|
67
67
|
# Otherwise, intent should be something like, "- WAIT FOR MARKET TREND SHIFT -"
|
68
|
-
intent = "- SEE ORDER HISTORY #{Cryptum.down_arrow} -"
|
68
|
+
intent = "- #{Cryptum.down_arrow} SEE ORDER HISTORY #{Cryptum.down_arrow} -"
|
69
69
|
else
|
70
70
|
speed = 'FAST'
|
71
71
|
speed = 'SLOW' if buy_total >= sell_total
|
data/lib/cryptum/version.rb
CHANGED
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.375
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -523,7 +523,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
523
523
|
- !ruby/object:Gem::Version
|
524
524
|
version: '0'
|
525
525
|
requirements: []
|
526
|
-
rubygems_version: 3.4.
|
526
|
+
rubygems_version: 3.4.10
|
527
527
|
signing_key:
|
528
528
|
specification_version: 4
|
529
529
|
summary: Coinbase Pro High-Frequency Trading Bot
|