cryptum 0.0.341 → 0.0.343
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 +16 -9
- 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: 02c2b62902a2b501d2c85af3dd61def11d0b1e28e89787a4da96540323f6b32d
|
4
|
+
data.tar.gz: 32db0b748869532f2e7a5662cec1c9eaa3d5dcdd3d2db57ea50468056669a769
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 170b724a61be52c129c3b37a54e193ed166e83c19511197acede93898cc7597f4fb13a1e49501a562f3b9b84000b982c990f0b41831fc28ab3b3a6111fd1da6d
|
7
|
+
data.tar.gz: 6f404de1535cebc08cbea75d9a0f32b402e8814b4ebe2aa0bf4b7470705ceb87560259396c42057a4624a5022191b1ea498a5c8ff9baef37e62c92e62b77e602
|
@@ -14,15 +14,22 @@ module Cryptum
|
|
14
14
|
event = opts[:event]
|
15
15
|
indicator_status = opts[:indicator_status]
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
+
buy_count = event[:changes].select { |change| change.first == 'buy' }.length
|
30
|
+
sell_count = event[:changes].select { |change| change.first == 'sell' }.length
|
31
|
+
event_history.order_book[:market_trend][:buy] += buy_count
|
32
|
+
event_history.order_book[:market_trend][:sell] += sell_count
|
26
33
|
|
27
34
|
indicator_hash = {}
|
28
35
|
buy_total = event_history.order_book[:market_trend][:buy].to_i
|
data/lib/cryptum/version.rb
CHANGED