cryptum 0.0.339 → 0.0.342
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 +22 -8
- data/lib/cryptum/ui/order_plan.rb +5 -0
- 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: db5e1c987c7141702b6339e049b643f5b1db8c26e1f980324e88d553232ba7e3
|
4
|
+
data.tar.gz: cb490c80378fb97909a1546adad4916c9223cf84c9601b742611c97eeb3957c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce8189f0d68456ea0ee95fa9989d3666de19e2c4651bb53a64402d305042e37ac69f1042598db1d12d84ce76d33ad4de2183a691cae02f193a5cbba8557d6577
|
7
|
+
data.tar.gz: 64172f28596d4caf9d3dfd5a13be6c78181f6ea5bcf8e4649661e4ddb85f55723a97a5e312d3e199e1771ab286e3b6cda0325fbd2a45c082e4bb0ba2c4adff2c
|
@@ -14,14 +14,28 @@ module Cryptum
|
|
14
14
|
event = opts[:event]
|
15
15
|
indicator_status = opts[:indicator_status]
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
# Compatible w/ l2update websocket channel
|
18
|
+
# buy_or_sell = event[:changes].first[0].to_s.to_sym
|
19
|
+
# case buy_or_sell
|
20
|
+
# when :buy
|
21
|
+
# event_history.order_book[:market_trend][:buy] += 1
|
22
|
+
# when :sell
|
23
|
+
# event_history.order_book[:market_trend][:sell] += 1
|
24
|
+
# else
|
25
|
+
# raise "UNKNOWN Value in event[:changes] => #{buy_or_sell}"
|
26
|
+
# end
|
27
|
+
|
28
|
+
# Compatible w/ l2update_batch websocket channel
|
29
|
+
event[:changes].each do |change|
|
30
|
+
buy_or_sell = change.first.to_s.to_sym
|
31
|
+
case buy_or_sell
|
32
|
+
when :buy
|
33
|
+
event_history.order_book[:market_trend][:buy] += 1
|
34
|
+
when :sell
|
35
|
+
event_history.order_book[:market_trend][:sell] += 1
|
36
|
+
else
|
37
|
+
raise "UNKNOWN Value in event[:changes] => #{buy_or_sell}"
|
38
|
+
end
|
25
39
|
end
|
26
40
|
|
27
41
|
indicator_hash = {}
|
@@ -166,6 +166,11 @@ module Cryptum
|
|
166
166
|
plan_no_slice += 1
|
167
167
|
end
|
168
168
|
order_plan.last[:last_slice] = true if order_plan.any?
|
169
|
+
op_last_slice_invest = order_plan.last[:invest].to_f
|
170
|
+
order_plan.last[:invest] = fiat_budget if order_plan.any? &&
|
171
|
+
op_last_slice_invest > fiat_budget &&
|
172
|
+
fiat_budget > min_market_funds.to_f
|
173
|
+
|
169
174
|
event_history.order_book[:order_plan] = order_plan
|
170
175
|
end
|
171
176
|
|
data/lib/cryptum/version.rb
CHANGED