-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_xrpeur.py
46 lines (41 loc) · 1.47 KB
/
run_xrpeur.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import ccxt
import ttm
import keyring
#
# Init
#
data_folder = 'output/xrp_eur_keep_value'
exchange = ttm.exchange.BinanceFix({
'enableRateLimit': True,
'apiKey': keyring.get_password('binance', 'apiKey'),
'secret': keyring.get_password('binance', 'secret'),
})
strategy = ttm.strategy.KeepValue(
pair='XRP/EUR',
initial_target_value=100.0, # EUR
minimal_move=12.0, # percent
tick_period=60,
timeframe='5m',
sell_modifier=0.9556842, # 0.9778421
buy_modifier=1.0443158, # 1.0221579
)
storage = ttm.storage.JSONFile(data_folder + '/storage.json') # storage for strategy data
cache = ttm.storage.JSONFile('cache.json') # storage for performance optimalisation
logger = ttm.logger.Multi(
ttm.logger.Console(min_priority=0),
ttm.logger.CSVFile(data_folder + '/log-all.csv', min_priority=0),
ttm.logger.CSVFile(data_folder + '/log.csv', min_priority=1),
ttm.logger.Gmail(to='[email protected]', login='[email protected]', min_priority=2), # register gmail password to keyring first: https://github.com/kootenpv/yagmail#username-and-password
ttm.logger.Telegram(
token=keyring.get_password('telegram', 'xrpeurToken'), # secures the Telegram bot
password=keyring.get_password('telegram', 'chatbotPassword'), # secures the TTM bot
root_folder=data_folder,
),
)
logger.set_pair('XRP/EUR')
bot = ttm.bot.Real(exchange, strategy, storage, cache, logger)
# bot.set_exceptions_file(data_folder + '/exceptions.log')
#
# Run
#
bot.run()