abot-info 0.1.1 → 0.1.2

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: 127b62eb518c63d6b7ba0bbcccc85ef22964b44555d92a1dae386dd48dcae3ae
4
- data.tar.gz: b82f5cb6291ee3e612982fda79fb5430694f6fd0127f41ecaae9f9e1c57620af
3
+ metadata.gz: d3b9aeef83407bb23ab6b32e573f11ce4b057f317154f4394feb126bc37abd6f
4
+ data.tar.gz: 4bf3c572f8efd5e92b13ace3ac581297119b11c6499ee868b7375746a1d28f67
5
5
  SHA512:
6
- metadata.gz: 03e4168d791452a1faccaa0ac91754101df5d9db3e7f1916dd116686cede9d4df51d9c89c71623c8c08804ab03c3726ce4b0579026e0ba9577c49162bdd165fe
7
- data.tar.gz: f74ff5924ec5bb3270e4503f5c30dacbda788837a48543deafc255a43e665c4b7211fed1a97d04e145480fb7364926697f084c6c804ef88edc10173dd321ef1c
6
+ metadata.gz: d01c954849a411dd94f1817d41237854d873aed81cbd2f9348c5fced45ab5dcab3a0422c23a6dd4f7819a42f24ad33225a817ebb3e71185025ad814f00a3a0df
7
+ data.tar.gz: 8cd4eb38ad00c13ee38e68f69acf849b880dd82aebc0505b380f86a88a6888d413c4553b44d4d1c1a6cb8584f66a5f5f1fa2b795e49547856f6efbfdb2d104b9
data/lib/abot/info.rb CHANGED
@@ -43,6 +43,9 @@ module Abot
43
43
  " timer: Время с покупки\n" \
44
44
  " current_profit: Текущая прибыль\n" \
45
45
  " potential_profit: Потенциальная прибыль\n",
46
+ " potential_profit: Потенциальная прибыль\n",
47
+ " current_price_perc_of_order: Текущая цена (подсчет процента от ордера за продажу)\n" \
48
+ " max_price_perc_of_order: Максимальная цена за 24ч (подсчет процента от ордера за продажу)\n" \
46
49
  )
47
50
  parser.add_option(
48
51
  :del, '--del=COLUMN1,COLUMN2,COLUMN3',
@@ -60,6 +63,8 @@ module Abot
60
63
  " timer: Время с покупки\n" \
61
64
  " current_profit: Текущая прибыль\n" \
62
65
  " potential_profit: Потенциальная прибыль\n",
66
+ " current_price_perc_of_order: Текущая цена (подсчет процента от ордера за продажу)\n" \
67
+ " max_price_perc_of_order: Максимальная цена за 24ч (подсчет процента от ордера за продажу)\n"
63
68
  )
64
69
  parser.add_option(
65
70
  :db_path, '--db_path=DB_PATH',
@@ -74,6 +74,10 @@ module Abot
74
74
  @percent_to_order ||= ((sell_price / current_price - 1) * 100)
75
75
  end
76
76
 
77
+ def percent_from_order
78
+ @percent_from_order ||= ((1 - current_price / sell_price) * 100)
79
+ end
80
+
77
81
  def percent_from_min_to_average
78
82
  @percent_to_min ||= ((min_price / next_average_price - 1) * 100)
79
83
  end
@@ -82,6 +86,10 @@ module Abot
82
86
  @percent_to_max ||= ((sell_price / max_price - 1) * 100)
83
87
  end
84
88
 
89
+ def percent_from_max
90
+ @percent_from_max ||= ((1 - max_price / sell_price) * 100)
91
+ end
92
+
85
93
  def min_price
86
94
  @min_price ||= account.symbol_min_price(symbol)
87
95
  end
@@ -64,6 +64,10 @@ module Abot
64
64
  "#{current_price} (#{percent_to_order.round(2)}%)"
65
65
  end
66
66
 
67
+ def decorated_current_price_perc_of_order
68
+ "#{current_price} (#{percent_from_order.round(2)}%)"
69
+ end
70
+
67
71
  def decorated_min_price
68
72
  "#{min_price} (#{percent_from_min_to_average.round(2)}%)"
69
73
  end
@@ -72,6 +76,10 @@ module Abot
72
76
  "#{max_price} (#{percent_to_max.round(2)}%)"
73
77
  end
74
78
 
79
+ def decorated_max_price_perc_of_order
80
+ "#{max_price} (#{percent_from_max.round(2)}%)"
81
+ end
82
+
75
83
  def decorated_current_quote
76
84
  current_quote.round(2)
77
85
  end
@@ -22,6 +22,8 @@ module Abot
22
22
  potential_profit: "Пот.\nпрофит",
23
23
  buy_date: "Дата покупки",
24
24
  timer: 'Время',
25
+ current_price_perc_of_order: 'Тек.цена',
26
+ max_price_perc_of_order: 'Максимум 24h',
25
27
  }.freeze
26
28
  HEADINGS_COINS_TABLE_DEFAULT = %i[
27
29
  name
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Abot
4
4
  module Info
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abot-info
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - w_dmitrii