cryptum 0.0.324 → 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/order_book/market_trend.rb +51 -51
- 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: 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
|
@@ -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
|
|
data/lib/cryptum/version.rb
CHANGED