cryptum 0.0.434 → 0.0.436

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b81370975378882cf9d11b55666c23eaea3a61cff3f08d1956972a5e095f159
4
- data.tar.gz: e3743593d07506caecb9e2fafbca28ac5202d0c31a5058e2aa5add17b983c25e
3
+ metadata.gz: 78e5097bce59e7bd90fc84a90b797160708198257a80873063394f3df043ead3
4
+ data.tar.gz: 138a10078e544af2ffc8627378986b2f9df06c7f360c45830385e12550ebab92
5
5
  SHA512:
6
- metadata.gz: 2b7cf20d9c9709a11efcac82ec138b303552f8fd1e9b5fb5784a768eda511fe97bf8253180cf1d5c3aa49e407eecc481cd367aec318a506748986a10d9c2ac97
7
- data.tar.gz: 32a5579e81be9bb4daedf9075a07afe2d25940a87497f05e28fcba4b5dc9433bfd8ca87e5838bf99d1b0c7196a05f54cd7f9d4ab8349a8dd0f42bcac327d85f0
6
+ metadata.gz: 25a3d7bc40279ba899dc69e920aed71c0c2bb3687b466135ede510d96afac45fce58553483a9e143cf878f2a66e4ed93b8ba941dde0dd5cfa5e8e7751ef837d0
7
+ data.tar.gz: 6610510ac42fce2aa362eb8447881154eb185169815c82de718dfd34f1e2474d50b59cb71ad09d70427c388112ec2c73bc778131e85ed93deb55195493c77f9a
data/.rubocop.yml CHANGED
@@ -12,7 +12,7 @@ Metrics/BlockLength:
12
12
  Metrics/BlockNesting:
13
13
  Max: 4
14
14
  Metrics/ClassLength:
15
- Max: 132
15
+ Max: 134
16
16
  Metrics/CyclomaticComplexity:
17
17
  Max: 86
18
18
  Metrics/MethodLength:
@@ -11,6 +11,7 @@ module Cryptum
11
11
  :event_type,
12
12
  :first_event,
13
13
  :highest_selling_price,
14
+ :last_purchase_price,
14
15
  :lowest_selling_price,
15
16
  :market_trend_event,
16
17
  :open_sell_orders,
@@ -52,6 +53,7 @@ module Cryptum
52
53
  self.bullish_trend = true
53
54
  self.first_event = true
54
55
  self.highest_selling_price = 0.00
56
+ self.last_purchase_price = 0.00
55
57
  self.lowest_selling_price = 0.00
56
58
  self.open_sell_orders = 0
57
59
  self.open_sell_orders_max = 500
@@ -84,11 +84,14 @@ module Cryptum
84
84
 
85
85
  this_order = event_history.order_book[:order_plan].first
86
86
 
87
- # If price is greater than the lowest selling limit order,
88
- # force it to be slightly less
89
- lowest_selling_price = event_history.lowest_selling_price
90
-
91
- limit_price = lowest_selling_price - quote_increment.to_f if lowest_selling_price.positive? && lowest_selling_price < limit_price
87
+ # If price is greater than the lowest selling
88
+ # limit order, force it to be slightly less
89
+ last_order = order_history_meta.reverse.find { |o| o[:color] == 'yellow' }
90
+ # lowest_selling_price = event_history.lowest_selling_price
91
+ last_purchase_price = event_history.last_purchase_price
92
+ event_history.last_purchase_price = last_order[:price].to_f if last_order
93
+
94
+ limit_price = last_purchase_price - quote_increment.to_f if last_purchase_price.positive? && last_purchase_price < limit_price
92
95
 
93
96
  price = format(
94
97
  "%0.#{fiat_smallest_decimal}f",
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.434'
4
+ VERSION = '0.0.436'
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.434
4
+ version: 0.0.436
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.