cryptum 0.0.373 → 0.0.374

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad583e315522b51751a336aff7cff06e1f9efa4a6b0227ebaf21149835ef03f4
4
- data.tar.gz: e269e281bb9de22cf6049cb965e20566d0a0fcce00d45ef7d7c94129017b54f2
3
+ metadata.gz: a78297f3f507363560f8127ddbe5a801975c0d9741d0b06eb255260388cf9393
4
+ data.tar.gz: 49279724c8c8bbda01f2a987f32f94fae70fddaa003941ff3a05dd7fd8bbbe0f
5
5
  SHA512:
6
- metadata.gz: dc070fb8cac58f2c2bec2444c667c1aba3c6c7078c3d72fe3d5de92bd42ebd2a2b1b1920ab8bc3f4d7fb2fbfafb27d9546eff148fb05d738bee0151ebb470e8b
7
- data.tar.gz: 8d948d008ac22ff81af033efb9367e3600c8bb2b41c8a84286dd8ed571ddb63e4b11671dfd922f61b946c6f5814e92daf80ebf57836e548d69796a7d4de935c1
6
+ metadata.gz: da4280d0b8c0d77526d999437e1643828cf00510722186d3c6408a679e1577c905956fb27ba2550ada2505af3baebd11f9242b73cf331467876f8589517b80fb
7
+ data.tar.gz: f52c1f848a9fe79f6861c989e985e73d5797b90a860288d49d7f68a249e923872fffc7446545f46220eea8c1a20f6adccada401c97cb81fa1cf91dd8edb3af36
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-01-10 17:06:46 UTC using RuboCop version 1.43.0.
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: 22
32
+ # Offense count: 23
28
33
  # Configuration parameters: AllowedConstants.
29
34
  Style/Documentation:
30
35
  Enabled: false
@@ -44,7 +44,7 @@ module Cryptum
44
44
  :recalculate_order_plan
45
45
 
46
46
  def initialize(opts = {})
47
- # option_choice = opts[:option_choice]
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
- # TODO: develop algorithm to calculate
83
- # FAST BUY && SLOW BUY values taking
84
- # market_trend_reset values into account
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
- # FAST BUY = 4 hours
87
- self.time_between_orders = 14_400
88
- self.time_between_orders_reset = time_between_orders
87
+ # FAST BUY = 4 hours
88
+ self.time_between_orders = 14_400
89
+ self.time_between_orders_reset = time_between_orders
89
90
 
90
- # SLOW BUY = 1 day
91
- self.time_between_orders_max = 86_400
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
- # 1 hour
94
- self.time_between_orders_min = 3_600
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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.373'
4
+ VERSION = '0.0.374'
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.373
4
+ version: 0.0.374
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-28 00:00:00.000000000 Z
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.9
526
+ rubygems_version: 3.4.10
527
527
  signing_key:
528
528
  specification_version: 4
529
529
  summary: Coinbase Pro High-Frequency Trading Bot