cryptum 0.0.407 → 0.0.408
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/bin/cryptum +1 -1
- data/lib/cryptum/event/history.rb +1 -0
- data/lib/cryptum/option/choice.rb +1 -1
- data/lib/cryptum/option/parser.rb +3 -3
- data/lib/cryptum/order_book/generate.rb +12 -14
- 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: 7697401b1b7ec81f2d65243808327c90231db0f893129bc9964766228bf88900
|
4
|
+
data.tar.gz: 1974a5be8c924874a519736d3c44dc385c8692725c9ec3be5a2d58c5dcf534f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9aee8f8313e63e1f9446425e80f09e371c09d4dfe33b49f20aa41a6fbeebff87a69636ecbf684775e0b2d80f17b9447d9a874dd6fec70ff61e27865639ba69f8
|
7
|
+
data.tar.gz: 97262bfda3133cdbc7d20d3b20259f54f0420dfea493e1ca1e30192df57642ebd07a4a09a5c5274ce769c34be3a892338b2bcc8515f763416c41d69bda0ad04a
|
data/README.md
CHANGED
@@ -65,7 +65,7 @@ USAGE: cryptum [opts]
|
|
65
65
|
-s, --symbol=SYMBOL <Required - Crypto Symbol.(e.g. btc-usd, eth-usd, etc.)
|
66
66
|
-l, --[no-]list-products <Optional - List Supported Crypto Currency Products and Exit>
|
67
67
|
-p, --proxy=PROXY <Optional - HTTP Proxy e.g. "http://127.0.0.1:8080">
|
68
|
-
-R, --[no-]reset-
|
68
|
+
-R, --[no-]reset-timers <Optional - Reset Market Trend & Order Countdown at Session Init (Defaults to false)>
|
69
69
|
-r, --session-root=PATH <Optional - Directory with etc && order_books (Defaults to ~/cryptum)>
|
70
70
|
-S, --[no-]sandbox <Optional - Use Coinbase Sandbox Environment for Testing Ideas>
|
71
71
|
-t, --trend-reset-time=TIME <Optional - Time Between Market Trend Reset (Default 1D)>
|
data/bin/cryptum
CHANGED
@@ -27,7 +27,7 @@ event_history = Cryptum::OrderBook::Generate.new(
|
|
27
27
|
|
28
28
|
# Initialize Curses UI
|
29
29
|
terminal_win = Cryptum::UI.init(event_history: event_history)
|
30
|
-
terminal_win.key_press_event.key_w = true if option_choice.
|
30
|
+
terminal_win.key_press_event.key_w = true if option_choice.reset_timers
|
31
31
|
|
32
32
|
# Connect to WebSocket
|
33
33
|
# Refresh UI and Trigger Events as Messages via Web Socket are Received.
|
@@ -33,9 +33,9 @@ module Cryptum
|
|
33
33
|
|
34
34
|
options.on(
|
35
35
|
'-R',
|
36
|
-
'--[no-]reset-
|
37
|
-
'<Optional - Reset Market Trend Countdown at Session Init (Defaults to false)>'
|
38
|
-
) { |r| option_choice.
|
36
|
+
'--[no-]reset-timers',
|
37
|
+
'<Optional - Reset Market Trend & Order Countdown at Session Init (Defaults to false)>'
|
38
|
+
) { |r| option_choice.reset_timers = r }
|
39
39
|
|
40
40
|
options.on(
|
41
41
|
'-rPATH',
|
@@ -29,6 +29,8 @@ module Cryptum
|
|
29
29
|
end
|
30
30
|
this_product = this_product_arr.last
|
31
31
|
|
32
|
+
ftimestr = '%Y-%m-%d %H:%M:%S.%N%z'
|
33
|
+
|
32
34
|
order_book = {
|
33
35
|
path: order_book_file,
|
34
36
|
symbol: symbol,
|
@@ -45,8 +47,8 @@ module Cryptum
|
|
45
47
|
fiat_portfolio: [],
|
46
48
|
fees: [],
|
47
49
|
order_plan: [],
|
48
|
-
last_trend_reset: Time.now.strftime(
|
49
|
-
last_order_exec: Time.now.strftime(
|
50
|
+
last_trend_reset: Time.now.strftime(ftimestr),
|
51
|
+
last_order_exec: Time.now.strftime(ftimestr),
|
50
52
|
market_trend: {
|
51
53
|
buy: 0,
|
52
54
|
buy_start: '--',
|
@@ -63,11 +65,6 @@ module Cryptum
|
|
63
65
|
# Instantiate Event History attr_accessible
|
64
66
|
# Object to Keep Track of Everything as Events
|
65
67
|
# are Parsed.
|
66
|
-
event_history = Cryptum::Event::History.new(
|
67
|
-
option_choice: option_choice,
|
68
|
-
order_book: order_book
|
69
|
-
)
|
70
|
-
|
71
68
|
if File.exist?(order_book_file)
|
72
69
|
order_book = JSON.parse(
|
73
70
|
File.read(order_book_file),
|
@@ -75,17 +72,18 @@ module Cryptum
|
|
75
72
|
)
|
76
73
|
end
|
77
74
|
|
75
|
+
event_history = Cryptum::Event::History.new(
|
76
|
+
option_choice: option_choice,
|
77
|
+
order_book: order_book
|
78
|
+
)
|
78
79
|
event_history.order_book = order_book
|
79
|
-
|
80
|
+
|
81
|
+
if option_choice.reset_timers
|
80
82
|
event_history.order_book[:order_plan] = []
|
81
83
|
event_history.order_book[:market_trend][:buy] = 0
|
82
84
|
event_history.order_book[:market_trend][:sell] = 0
|
83
|
-
event_history.order_book[:last_trend_reset] = Time.now.strftime(
|
84
|
-
|
85
|
-
)
|
86
|
-
event_history.order_book[:last_order_exec] = Time.now.strftime(
|
87
|
-
'%Y-%m-%d %H:%M:%S.%N%z'
|
88
|
-
)
|
85
|
+
event_history.order_book[:last_trend_reset] = Time.now.strftime(ftimestr)
|
86
|
+
event_history.order_book[:last_order_exec] = Time.now.strftime(ftimestr)
|
89
87
|
end
|
90
88
|
|
91
89
|
event_history
|
data/lib/cryptum/version.rb
CHANGED