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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2842c46e8b14915040844986740e4800f36f16273efaffbc9c289f5849f79c3
4
- data.tar.gz: 1b2814d1903d85ab941952765ddbe3a7ac1667a555542bcfbdf0b8651475a833
3
+ metadata.gz: 7697401b1b7ec81f2d65243808327c90231db0f893129bc9964766228bf88900
4
+ data.tar.gz: 1974a5be8c924874a519736d3c44dc385c8692725c9ec3be5a2d58c5dcf534f5
5
5
  SHA512:
6
- metadata.gz: 7a8f277a8e7de4488e1cf99f47b535e5bf3b01381e61ab115bc127caafa419f36cf899b26a6c736801d99418bfb0454339c3c8dd40a45f2923b1a28674d09003
7
- data.tar.gz: ff802e8e4268a4767a18a136438d688abd8e633244768d828fb13aff6e498ae422ce8d112af690582dfd0fdf6cae3045c6f32a920c20baa8594468fe396b99cf
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-trend-countdown <Optional - Reset Market Trend Countdown at Session Init (Defaults to false)>
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.reset_session_countdown
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.
@@ -78,6 +78,7 @@ module Cryptum
78
78
 
79
79
  # -------------------------------------------------- #
80
80
  # SAUCE 3 (SAUCE 4 RELATES TO SAUCE 3)
81
+ # TODO: Consider --reset-trend-countdown
81
82
  case option_choice.market_trend_reset_label
82
83
  when '1W'
83
84
  # SLOW BUY = 1 day
@@ -8,7 +8,7 @@ module Cryptum
8
8
  attr_accessor :driver_name,
9
9
  :list_products,
10
10
  :proxy,
11
- :reset_session_countdown,
11
+ :reset_timers,
12
12
  :session_root,
13
13
  :sandbox,
14
14
  :symbol,
@@ -33,9 +33,9 @@ module Cryptum
33
33
 
34
34
  options.on(
35
35
  '-R',
36
- '--[no-]reset-trend-countdown',
37
- '<Optional - Reset Market Trend Countdown at Session Init (Defaults to false)>'
38
- ) { |r| option_choice.reset_session_countdown = r }
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('%Y-%m-%d %H:%M:%S.%N%z'),
49
- last_order_exec: Time.now.strftime('%Y-%m-%d %H:%M:%S.%N%z'),
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
- if option_choice.reset_session_countdown
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
- '%Y-%m-%d %H:%M:%S.%N%z'
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.407'
4
+ VERSION = '0.0.408'
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.407
4
+ version: 0.0.408
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.