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 +4 -4
- data/lib/abot/info.rb +5 -0
- data/lib/abot/info/coin.rb +8 -0
- data/lib/abot/info/decorators/coin_decorator.rb +8 -0
- data/lib/abot/info/table.rb +2 -0
- data/lib/abot/info/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: d3b9aeef83407bb23ab6b32e573f11ce4b057f317154f4394feb126bc37abd6f
|
4
|
+
data.tar.gz: 4bf3c572f8efd5e92b13ace3ac581297119b11c6499ee868b7375746a1d28f67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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',
|
data/lib/abot/info/coin.rb
CHANGED
@@ -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
|
data/lib/abot/info/table.rb
CHANGED
data/lib/abot/info/version.rb
CHANGED