Skip to content

Commit 966d344

Browse files
committed
Add manual net deposit override configuration
1 parent 8b870df commit 966d344

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

config.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pair = "BTC/USD"
1010
symbol = "XBTUSD"
1111

1212
# bot properties
13+
net_deposits_in_base_currency = 0
1314
daily_report = True
1415
trade_report = True
1516
short_in_percent = 50

maverage.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ def __init__(self):
3838

3939
try:
4040
props = config['config']
41-
self.bot_version = '0.7.20'
41+
self.bot_version = '0.8.0'
4242
self.exchange = str(props['exchange']).strip('"').lower()
4343
self.api_key = str(props['api_key']).strip('"')
4444
self.api_secret = str(props['api_secret']).strip('"')
4545
self.test = bool(str(props['test']).strip('"').lower() == 'true')
4646
self.pair = str(props['pair']).strip('"')
4747
self.symbol = str(props['symbol']).strip('"')
48+
self.net_deposits_in_base_currency = abs(float(props['net_deposits_in_base_currency']))
4849
self.leverage_default = abs(float(props['leverage_default']))
4950
self.apply_leverage = bool(str(props['apply_leverage']).strip('"').lower() == 'true')
5051
self.daily_report = bool(str(props['daily_report']).strip('"').lower() == 'true')
@@ -576,6 +577,8 @@ def get_net_deposits():
576577
Get deposits and withdraws to calculate the net deposits in crypto.
577578
return: net deposits
578579
"""
580+
if CONF.net_deposits_in_base_currency:
581+
return CONF.net_deposits_in_base_currency
579582
try:
580583
currency = CONF.base if CONF.base != 'BTC' else 'XBt'
581584
if CONF.exchange == 'bitmex':

maverage_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,7 @@ def create_default_conf():
10591059
conf.symbol = 'XBTEUR'
10601060
conf.base = 'BTC'
10611061
conf.quote = 'EUR'
1062+
conf.net_deposits_in_base_currency = 0
10621063
conf.satoshi_factor = 0.00000001
10631064
conf.bot_version = '0.0.1'
10641065
conf.leverage_default = 2

test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pair = "BTC/USD"
1010
symbol = "XBTUSD"
1111

1212
# bot properties
13+
net_deposits_in_base_currency = 0
1314
daily_report = True
1415
trade_report = True
1516
short_in_percent = 50

0 commit comments

Comments
 (0)