cryptum 0.0.278 → 0.0.281
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/lib/cryptum/event/cancel.rb +0 -21
- data/lib/cryptum/order_book/market_trend.rb +24 -17
- 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: 99b8305a25439dced16901f0569fa4dd9a2cac394be0757f01796cb461ff3c63
|
4
|
+
data.tar.gz: 489296de373d30ff837f4a67ef1059a13f1b2646482f55db44a365dfb7c82145
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f37bb82b77e23f4341898a5dc4c629ad1517b281bcdb56ccd8eb4c34230de0fc5ec786054142ed8280c7782239c780ed0693fae3a88196b78c4605c9937c347d
|
7
|
+
data.tar.gz: 24a53cf5141f675308efca558149fbdbaea99587de3ae701ab063cfff5c21f16e4ccd9d10928e592c8e337fc033de2d08f78d12d14d507c0809f7a37d8b537dd
|
data/lib/cryptum/event/cancel.rb
CHANGED
@@ -15,27 +15,6 @@ module Cryptum
|
|
15
15
|
# order_type = opts[:order_type]
|
16
16
|
# order_action = opts[:order_action]
|
17
17
|
|
18
|
-
# Consume Latest Order History Justification from
|
19
|
-
# Order Book & cancel orders tagged as pie
|
20
|
-
# event_history = Cryptum::API.cancel_synced_oj_and_oh(
|
21
|
-
# option_choice: option_choice,
|
22
|
-
# env: env,
|
23
|
-
# event_history: event_history,
|
24
|
-
# order_type: order_type,
|
25
|
-
# order_action: order_action
|
26
|
-
# )
|
27
|
-
|
28
|
-
# event_history
|
29
|
-
# event_history.order_canceled = true
|
30
|
-
# event_history.event_notes = "{ \"event_type\": \"#{event_history.event_type}\", \"cancel\": \"#{event_history.order_canceled}\", \"submitted\": \"#{event_history.order_submitted}\" }" if option_choice.proxy
|
31
|
-
|
32
|
-
# Cryptum::API.cancel_all_open_orders(
|
33
|
-
# env: env,
|
34
|
-
# option_choice: option_choice,
|
35
|
-
# order_type: order_type,
|
36
|
-
# event_notes: event_history.event_notes
|
37
|
-
# )
|
38
|
-
|
39
18
|
terminal_win.key_press_event.key_c = false
|
40
19
|
Cryptum::API.cancel_all_open_orders(
|
41
20
|
env: env,
|
@@ -70,33 +70,40 @@ module Cryptum
|
|
70
70
|
|
71
71
|
ai_enabled = bot_conf[:artifical_intelligence]
|
72
72
|
gross_tpm = bot_conf[:target_profit_margin_percent].to_f
|
73
|
+
order_history = event_history.order_book[:order_history]
|
74
|
+
order_history_meta = event_history.order_book[:order_history_meta]
|
73
75
|
|
76
|
+
# VERY EXPENSIVE
|
74
77
|
# Only retain past 24 hours of
|
75
78
|
# order history meta for bought, sold, and expired
|
76
79
|
# keep open limit sell orders indefintely
|
77
|
-
|
78
|
-
order_history_meta
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
80
|
+
# before_twenty_four_hrs_ago = Time.now - 86_400
|
81
|
+
# order_history_meta.delete_if do |ohm|
|
82
|
+
# order_history.find do |oh|
|
83
|
+
# next unless oh[:done_at]
|
84
|
+
|
85
|
+
# Time.parse(oh[:done_at]) < before_twenty_four_hrs_ago && (
|
86
|
+
# oh[:id] == ohm[:buy_order_id] ||
|
87
|
+
# oh[:id] == ohm[:sell_order_id]
|
88
|
+
# ) && (
|
89
|
+
# ohm[:color].to_sym == :white ||
|
90
|
+
# ohm[:color].to_sym == :green ||
|
91
|
+
# ohm[:color].to_sym == :cyan ||
|
92
|
+
# ohm[:color].to_sym == :red
|
93
|
+
# )
|
94
|
+
# end
|
95
|
+
# end
|
90
96
|
|
91
97
|
# Only keep order history meta for those
|
92
98
|
# hashes that exist in the last order history
|
93
99
|
# response
|
94
100
|
order_history_meta.keep_if do |ohm|
|
95
101
|
order_history.find do |oh|
|
96
|
-
oh[:id] == ohm[:buy_order_id] ||
|
97
|
-
|
98
|
-
|
99
|
-
|
102
|
+
(oh[:id] == ohm[:buy_order_id] || oh[:id] == ohm[:sell_order_id]) && (
|
103
|
+
ohm[:color].to_sym == :white ||
|
104
|
+
ohm[:color].to_sym == :green ||
|
105
|
+
ohm[:color].to_sym == :yellow
|
106
|
+
)
|
100
107
|
end
|
101
108
|
end
|
102
109
|
event_history.order_book[:order_history_meta] = order_history_meta
|
data/lib/cryptum/version.rb
CHANGED