cryptum 0.0.400 → 0.0.401

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: 8d4ccaed7aa5df46e13b97e435ddbf04e77ceedc9e2f385057cd096ec2f8c8b0
4
- data.tar.gz: d1466bb66ac26757deb64c453df732496467a9a5dd5192d9aeb2df5b6d6d56a9
3
+ metadata.gz: 0e8b9a02dddfb1118d13518d0ebf16703f0a988f563ff6556090a055b67f82d0
4
+ data.tar.gz: ba8469969bd9f73d0df3abe8c233bcdf7aa128b8cc1442d94daaca15c8adbf91
5
5
  SHA512:
6
- metadata.gz: 7dd733c6bb7b6a9800a7041ddc2ab0e90944903b4567d5beab5188a0a81eec6706441406e352e4c208e5479976f230fcd12b6f16ca66a7638235ea56df3cc328
7
- data.tar.gz: 286bd79d23e28162b3cc43a385cf2601ff63e8bf3d2f9b18e22cb3b7c8347199b90368e3f1e3d22427c7296a7f631d130561d091c43d25616b228a0f1c16c8e5
6
+ metadata.gz: dac3148c7e98d46d05581021fb6d0df376fcc738913ec329f3511ab3e4ca5f8afe02387e2b42ccc21598734ecf01919e36722bc74f101d2de6adf1babc141692
7
+ data.tar.gz: 806f4873cdc8e57262f62c3ad8bd54568434222848f0905b7431ca3d1dacef00555d683c6d6ff1ef60f0856678dde6089c836c6d8ca02d9aa38c3bbabad332dc
data/README.md CHANGED
@@ -68,38 +68,38 @@ USAGE: cryptum [opts]
68
68
  -R, --[no-]reset-trend-countdown <Optional - Reset Market Trend 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
- -t, --trend-reset-time=SECONDS <Optional - Seconds Between Market Trend Reset (Default 86_400 i.e. 1 day)>
71
+ -t, --trend-reset-time=TIME <Optional - Time Between Market Trend Reset (Default 1D)>
72
72
  ```
73
73
 
74
74
  Example usage to trade on weekly instead of default daily:
75
75
  ```
76
76
  $ cryptum --symbol btc-usd \
77
77
  --session-root ~/cryptum \
78
- --trend-reset-time 604_800
78
+ --trend-reset-time 1W
79
79
  ```
80
80
 
81
81
  By default, cryptum resets the market trend (i.e. number of buys vs number of sells) every day (i.e. 86400 seconds). As Maker & Taker fees drop in value, it may be useful to change the market trend reset value to something lower (e.g. 4 hours):
82
82
  ```
83
83
  $ cryptum --symbol btc-usd \
84
84
  --session-root ~/cryptum \
85
- --trend-reset-time 14_400
86
- ```
87
-
88
- Possible values for `--trend-reset-time` reside in the seconds column:
89
- |Seconds |Description|UI Label|
90
- |----------|-----------|----------|
91
- |`604_800` |1 week |`1W` |
92
- |`86_400` |1 day |`1D` |
93
- |`14_400` |4 hours |`4h` |
94
- |`10_800` |3 hours |`3h` |
95
- |`7_200` |2 hours |`2h` |
96
- |`3_600` |1 hour |`1h` |
97
- |`2_700` |5 minutes |`45m` |
98
- |`1_800` |30 minutes |`30m` |
99
- |`900` |15 minutes |`15m` |
100
- |`300` |5 minutes |`5m` |
101
- |`180` |3 minutes |`3m` |
102
- |`60` |1 minute |`1m` |
85
+ --trend-reset-time 4h
86
+ ```
87
+
88
+ Possible values for `--trend-reset-time` reside in the UI Label column:
89
+ |Description|UI Label |
90
+ |-----------|----------|
91
+ |1 week |`1W` |
92
+ |1 day |`1D` |
93
+ |4 hours |`4h` |
94
+ |3 hours |`3h` |
95
+ |2 hours |`2h` |
96
+ |1 hour |`1h` |
97
+ |5 minutes |`45m` |
98
+ |30 minutes |`30m` |
99
+ |15 minutes |`15m` |
100
+ |5 minutes |`5m` |
101
+ |3 minutes |`3m` |
102
+ |1 minute |`1m` |
103
103
 
104
104
  If you choose a lower value than the default, the target profit margin's (i.e. TPM) will also be reduced (assuming the TPM is still higher than Maker + Taker fees). This may be desireable - although TPM is reduced, trading volume should increase resulting in better Maker & Taker fee tiers (i.e. lower cost / trade).
105
105
 
data/lib/cryptum/log.rb CHANGED
@@ -63,6 +63,7 @@ module Cryptum
63
63
  exit_gracefully = true
64
64
  else
65
65
  log_event += " => #{msg}"
66
+ log_event += " => #{msg.backtrace}" if msg.respond_to?('backtrace')
66
67
  end
67
68
 
68
69
  logger.add(logger.level, log_event, which_self)
@@ -22,38 +22,44 @@ module Cryptum
22
22
  reason = :session_root
23
23
  end
24
24
 
25
- option_choice.market_trend_reset = 86_400 if option_choice.market_trend_reset.to_i.zero?
26
- unless option_choice.market_trend_reset.to_i >= 60 &&
27
- option_choice.market_trend_reset <= 604_800
28
- usage = true
29
- reason = :market_trend_reset
30
- end
31
-
25
+ option_choice.market_trend_reset = '1D' if option_choice.market_trend_reset.nil?
32
26
  case option_choice.market_trend_reset
33
- when 604_800
27
+ when '1W'
34
28
  option_choice.market_trend_reset_label = '1W'
35
- when 86_400
29
+ option_choice.market_trend_reset = 604_800
30
+ when '1D'
36
31
  option_choice.market_trend_reset_label = '1D'
37
- when 14_400
32
+ option_choice.market_trend_reset = 86_400
33
+ when '4h'
38
34
  option_choice.market_trend_reset_label = '4h'
39
- when 10_800
35
+ option_choice.market_trend_reset = 14_400
36
+ when '3h'
40
37
  option_choice.market_trend_reset_label = '3h'
41
- when 7_200
38
+ option_choice.market_trend_reset = 10_800
39
+ when '2h'
42
40
  option_choice.market_trend_reset_label = '2h'
43
- when 3_600
41
+ option_choice.market_trend_reset = 7_200
42
+ when '1h'
44
43
  option_choice.market_trend_reset_label = '1h'
45
- when 2_700
44
+ option_choice.market_trend_reset = 3_600
45
+ when '45m'
46
46
  option_choice.market_trend_reset_label = '45m'
47
- when 1_800
47
+ option_choice.market_trend_reset = 2_700
48
+ when '30m'
48
49
  option_choice.market_trend_reset_label = '30m'
49
- when 900
50
+ option_choice.market_trend_reset = 1_800
51
+ when '15m'
50
52
  option_choice.market_trend_reset_label = '15m'
51
- when 300
53
+ option_choice.market_trend_reset = 900
54
+ when '5m'
52
55
  option_choice.market_trend_reset_label = '5m'
53
- when 180
56
+ option_choice.market_trend_reset = 300
57
+ when '3m'
54
58
  option_choice.market_trend_reset_label = '3m'
55
- when 60
59
+ option_choice.market_trend_reset = 180
60
+ when '1m'
56
61
  option_choice.market_trend_reset_label = '1m'
62
+ option_choice.market_trend_reset = 60
57
63
  else
58
64
  usage = true
59
65
  reason = :market_trend_reset
@@ -66,7 +72,7 @@ module Cryptum
66
72
  when :session_root
67
73
  puts "ERROR: #{option_choice.session_root} does not exist.\n\n"
68
74
  when :market_trend_reset
69
- puts "ERROR: #{option_choice.market_trend_reset} - Possible values are: 604_800 || 86_400 || 14_400 || 10_800 || 7_200 || 3_600 || 2_700 || 1_800 || 900 || 300 || 180 || 60\n\n"
75
+ puts "ERROR: #{option_choice.market_trend_reset} - Possible values are: 1W, 1D, 4h, 3h, 2h, 1h, 45m, 30m, 15m, 5m, 3m, 1m\n\n"
70
76
  end
71
77
 
72
78
  puts `#{option_choice.driver_name} --help`
@@ -35,7 +35,7 @@ module Cryptum
35
35
  '-R',
36
36
  '--[no-]reset-trend-countdown',
37
37
  '<Optional - Reset Market Trend Countdown at Session Init (Defaults to false)>'
38
- ) { |t| option_choice.reset_session_countdown = t }
38
+ ) { |r| option_choice.reset_session_countdown = r }
39
39
 
40
40
  options.on(
41
41
  '-rPATH',
@@ -47,13 +47,13 @@ module Cryptum
47
47
  '-S',
48
48
  '--[no-]sandbox',
49
49
  '<Optional - Use Coinbase Sandbox Environment for Testing Ideas>'
50
- ) { |n| option_choice.sandbox = n }
50
+ ) { |s| option_choice.sandbox = s }
51
51
 
52
52
  options.on(
53
- '-tSECONDS',
54
- '--trend-reset-time=SECONDS',
55
- '<Optional - Seconds Between Market Trend Reset (Default 86_400 i.e. 1 day)>'
56
- ) { |t| option_choice.market_trend_reset = t.to_i }
53
+ '-tTIME',
54
+ '--trend-reset-time=TIME',
55
+ '<Optional - Time Between Market Trend Reset (Default 1D)>'
56
+ ) { |t| option_choice.market_trend_reset = t }
57
57
  end.parse!
58
58
 
59
59
  Cryptum::Option::InputValidation.check(option_choice: option_choice)
@@ -376,8 +376,8 @@ module Cryptum
376
376
 
377
377
  # ROWS 3-10
378
378
  remaining_blank_rows = 0
379
- remaining_blank_rows = max_rows_to_display if order_history_meta.empty?
380
379
  max_rows_to_display = event_history.order_execute_max_rows_to_display
380
+ remaining_blank_rows = max_rows_to_display if order_history_meta.empty?
381
381
  first_row = event_history.order_execute_index_offset
382
382
  last_row = first_row + max_rows_to_display
383
383
  if last_row >= order_history_meta.length
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.400'
4
+ VERSION = '0.0.401'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.400
4
+ version: 0.0.401
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-04 00:00:00.000000000 Z
11
+ date: 2023-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable