cryptum 0.0.341 → 0.0.343

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bad3d8b138eecbde91088b1feb705b0002df2f8b29bd9b1f232eec1001fa1d03
4
- data.tar.gz: 9f0b981a0aeb0a369634a6866cef17a4085a5b8aadcac4ddc180f86096f7a553
3
+ metadata.gz: 02c2b62902a2b501d2c85af3dd61def11d0b1e28e89787a4da96540323f6b32d
4
+ data.tar.gz: 32db0b748869532f2e7a5662cec1c9eaa3d5dcdd3d2db57ea50468056669a769
5
5
  SHA512:
6
- metadata.gz: 8c52440f76f5a2f92fd5a7aa4cfe4fd70177a09286c8d8b807233b4a221c6c24dd2e165a5ab023ceba51d267e03218b170445590ec9685d800f5a6ddbe17cb5f
7
- data.tar.gz: f3934b02ab277516fd147b797a22a5f3e653f61ccdbaf91c229b00f2881e99d6f31f379d34f05d115eafc61987faed2fd03d31992aa0ecf0e5e3b1f1c906acac
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
- buy_or_sell = event[:changes].first[0].to_s.to_sym
18
- case buy_or_sell
19
- when :buy
20
- event_history.order_book[:market_trend][:buy] += 1
21
- when :sell
22
- event_history.order_book[:market_trend][:sell] += 1
23
- else
24
- raise "UNKNOWN Value in event[:changes] => #{buy_or_sell}"
25
- end
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.341'
4
+ VERSION = '0.0.343'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.341
4
+ version: 0.0.343
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.