cryptum 0.0.407 → 0.0.409

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: 72778ff2894ca9c7b077fdbcb786892e5ce518b408446bf48a7283eff801f641
4
+ data.tar.gz: 8806dbbf4bb6168ec18f57341a558b7e99961d4ad7cafacf73cc6adc0258387a
5
5
  SHA512:
6
- metadata.gz: 7a8f277a8e7de4488e1cf99f47b535e5bf3b01381e61ab115bc127caafa419f36cf899b26a6c736801d99418bfb0454339c3c8dd40a45f2923b1a28674d09003
7
- data.tar.gz: ff802e8e4268a4767a18a136438d688abd8e633244768d828fb13aff6e498ae422ce8d112af690582dfd0fdf6cae3045c6f32a920c20baa8594468fe396b99cf
6
+ metadata.gz: eed72e7066b9581e1b5b07242d4398274da59924f57dfcd586c009cffe29a3b54ffb9474e0089f7db3fc1300d8085c3ffcd842d578b5ed61c06e86419e6dac0f
7
+ data.tar.gz: b5899b80baf35c92348e2c687baf6746bc7ff50606246cc94857d6b1d8f3066b4bd4ec19150fa33b7ae433f8cb43886459629853f0ad84e4f3fd366e2794b1ed
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,18 +72,24 @@ 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)
87
+
88
+ msg = 'Market Trend and Order Timers Reset'
89
+ else
90
+ msg = 'Market Trend and Order Timers Preserved from Previous Session'
89
91
  end
92
+ Cryptum::Log.append(level: :info, msg: msg, which_self: self, event_history: event_history)
90
93
 
91
94
  event_history
92
95
  rescue Interrupt, StandardError => e
@@ -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.409'
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.409
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.