cryptum 0.0.405 → 0.0.406
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cryptum/ui/order/execute.rb +11 -1
- 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: 05b55ff889f701b5b9251d5402e5035b85afea07941b6fbee8669ecd7f595cff
|
4
|
+
data.tar.gz: e30d334ab26991773b705344488954457e5ab7ac1a275267f77b4bc32b025938
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf629833581fb93f5df8015080f211c999f920df965c1ca2704101d191f1eaac5e391d85ec6179f5e8a636764832c887da7e8802a0b99af1d8152bef84559519
|
7
|
+
data.tar.gz: d9278fc8041bd2376dd08eae0c6a255c8fb7e39e40ee8c12ebf21cf63af9b6a4589b2ebf59acbffda1213ba099e44916a0dc888679d997ead8f4cc7e1946100f
|
@@ -249,9 +249,19 @@ module Cryptum
|
|
249
249
|
|
250
250
|
meta[:done_at] = Time.now.strftime('%Y-%m-%d %H:%M:%S.%N%z')
|
251
251
|
meta[:color] = :green
|
252
|
+
|
253
|
+
# Obtain buy && sell order details from order history
|
254
|
+
# using buy && sell IDs from respective meta object
|
255
|
+
# and append to JSON log to allow for machine learning.
|
256
|
+
buy_order_id = meta[:buy_order_id]
|
257
|
+
learning = meta
|
258
|
+
order_history_buy_details = order_history.select {|oh| oh[:id] == buy_order_id }
|
259
|
+
order_history_sell_details = order_history.select {|oh| oh[:id] == sell_order_id }
|
260
|
+
learning[:buy_details] = order_history_buy_details.first
|
261
|
+
learning[:sell_details] = order_history_sell_details.first
|
252
262
|
Cryptum::Log.append(
|
253
263
|
level: :learning,
|
254
|
-
msg:
|
264
|
+
msg: learning,
|
255
265
|
which_self: self,
|
256
266
|
event_history: event_history
|
257
267
|
)
|
data/lib/cryptum/version.rb
CHANGED