cryptum 0.0.323 → 0.0.325
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cryptum/event/history.rb +7 -0
- data/lib/cryptum/option.rb +0 -1
- data/lib/cryptum/order_book/market_trend.rb +51 -51
- data/lib/cryptum/ui/order_timer.rb +1 -1
- data/lib/cryptum/version.rb +1 -1
- data/lib/cryptum/web_sock/event_machine.rb +7 -1
- 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: 10328af02cf519e0d0909c39eebeef68636167861ce9c29f853cf3226aa3fe5f
|
4
|
+
data.tar.gz: 8acc998468938e4b9b368ebb23dcfdbe50e1f2365095be73ba2b4f3b552e8ef9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 033467601d7fbfabb46747e51093f14c28320ad5cdb3fed2b35a5d75d0b576d7bb4d44de9b0239cba3a292b61fda8f99a1c1976e00225c46bae7cacfd677333f
|
7
|
+
data.tar.gz: bcaf51a3743fcabab91e43c539d558d9d281fbfc3e79bc1d7ff35b4ca46b44f754106e82f392ab27839f43915bdff1076c32ec0d2bdd18adb2db18c1acae93f4
|
@@ -77,6 +77,12 @@ module Cryptum
|
|
77
77
|
self.recalculate_order_plan = false
|
78
78
|
self.start_time = start_time
|
79
79
|
|
80
|
+
# -------------------------------------------------- #
|
81
|
+
# SAUCE 4
|
82
|
+
# TODO: develop algorithm to calculate
|
83
|
+
# FAST BUY && SLOW BUY values taking
|
84
|
+
# market_trend_reset values into account
|
85
|
+
|
80
86
|
# FAST BUY = 10 minutes
|
81
87
|
self.time_between_orders = 600
|
82
88
|
self.time_between_orders_reset = time_between_orders
|
@@ -86,6 +92,7 @@ module Cryptum
|
|
86
92
|
|
87
93
|
# 5 seconds
|
88
94
|
self.time_between_orders_min = 5
|
95
|
+
# -------------------------------------------------- #
|
89
96
|
end
|
90
97
|
rescue Interrupt
|
91
98
|
# Exit Gracefully if CTRL+C is Pressed During Session
|
data/lib/cryptum/option.rb
CHANGED
@@ -148,7 +148,6 @@ module Cryptum
|
|
148
148
|
option_choice = opts[:option_choice]
|
149
149
|
env = opts[:env]
|
150
150
|
|
151
|
-
puts `#{option_choice.driver_name} --help`
|
152
151
|
puts "\n#{option_choice.driver_name} Supports the Following Products:"
|
153
152
|
products = Cryptum::API.get_products(
|
154
153
|
option_choice: option_choice,
|
@@ -62,57 +62,57 @@ module Cryptum
|
|
62
62
|
raise e
|
63
63
|
end
|
64
64
|
|
65
|
-
public_class_method def self.reset(opts = {})
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
rescue StandardError => e
|
114
|
-
|
115
|
-
end
|
65
|
+
# public_class_method def self.reset(opts = {})
|
66
|
+
# # IT IS ABSOLUTELY CRITICAL THIS METHOD IS AS FAST AS POSSIBLE
|
67
|
+
# # TO AVOID TICKER PRICE SYNCING ISSUES.
|
68
|
+
# event_history = opts[:event_history]
|
69
|
+
|
70
|
+
# # order_history = event_history.order_book[:order_history]
|
71
|
+
# # order_history_meta = event_history.order_book[:order_history_meta]
|
72
|
+
|
73
|
+
# # Only retain past 24 hours of
|
74
|
+
# # order history meta for bought, sold, and expired
|
75
|
+
# # keep open limit sell orders indefintely
|
76
|
+
# # before_twenty_four_hrs_ago = Time.now - 86_400
|
77
|
+
# # order_history_meta.delete_if do |ohm|
|
78
|
+
# # order_history.find do |oh|
|
79
|
+
# # next unless oh[:done_at]
|
80
|
+
|
81
|
+
# # Time.parse(oh[:done_at]) < before_twenty_four_hrs_ago && (
|
82
|
+
# # oh[:id] == ohm[:buy_order_id] ||
|
83
|
+
# # oh[:id] == ohm[:sell_order_id]
|
84
|
+
# # ) && (
|
85
|
+
# # ohm[:color].to_sym == :white ||
|
86
|
+
# # ohm[:color].to_sym == :green ||
|
87
|
+
# # ohm[:color].to_sym == :cyan ||
|
88
|
+
# # ohm[:color].to_sym == :red
|
89
|
+
# # )
|
90
|
+
# # end
|
91
|
+
# # end
|
92
|
+
|
93
|
+
# # Only keep order history meta for those
|
94
|
+
# # hashes that exist in the last order history
|
95
|
+
# # response
|
96
|
+
# # order_history_meta.keep_if do |ohm|
|
97
|
+
# # order_history.find do |oh|
|
98
|
+
# # (oh[:id] == ohm[:buy_order_id] || oh[:id] == ohm[:sell_order_id]) && (
|
99
|
+
# # ohm[:color].to_sym == :white ||
|
100
|
+
# # ohm[:color].to_sym == :green ||
|
101
|
+
# # ohm[:color].to_sym == :yellow
|
102
|
+
# # )
|
103
|
+
# # end
|
104
|
+
# # end
|
105
|
+
# # event_history.order_book[:order_history_meta] = order_history_meta
|
106
|
+
|
107
|
+
# # Reset Market Trend Counter
|
108
|
+
# event_history.order_book[:market_trend][:buy] = 0
|
109
|
+
# event_history.order_book[:market_trend][:sell] = 0
|
110
|
+
# event_history.order_book[:last_trend_reset] = Time.now.strftime(
|
111
|
+
# '%Y-%m-%d %H:%M:%S.%N%z'
|
112
|
+
# )
|
113
|
+
# rescue StandardError => e
|
114
|
+
# raise e
|
115
|
+
# end
|
116
116
|
|
117
117
|
# Display Usage for this Module
|
118
118
|
|
@@ -72,7 +72,7 @@ module Cryptum
|
|
72
72
|
ui_win: order_timer_win,
|
73
73
|
color: :white,
|
74
74
|
style: :bold,
|
75
|
-
string: "#{option_choice.market_trend_reset_label}
|
75
|
+
string: "#{option_choice.market_trend_reset_label} M. Trend Rst: #{trend_countdown}"
|
76
76
|
)
|
77
77
|
|
78
78
|
# COLUMN 2
|
data/lib/cryptum/version.rb
CHANGED
@@ -216,7 +216,13 @@ module Cryptum
|
|
216
216
|
end
|
217
217
|
|
218
218
|
EM.add_periodic_timer(option_choice.market_trend_reset) do
|
219
|
-
|
219
|
+
# NOTE: To ensure the integrity of event_history is maintained,
|
220
|
+
# changes to its contenta _MUST_ stay in thos block.
|
221
|
+
event_history.order_book[:market_trend][:buy] = 0
|
222
|
+
event_history.order_book[:market_trend][:sell] = 0
|
223
|
+
event_history.order_book[:last_trend_reset] = Time.now.strftime(
|
224
|
+
'%Y-%m-%d %H:%M:%S.%N%z'
|
225
|
+
)
|
220
226
|
|
221
227
|
# Reload Bot Conf (i.e. Risk Allocation)
|
222
228
|
# Recalculate Order Plan, and Write to File
|
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.325
|
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-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|