-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_iotausdt.py
46 lines (41 loc) · 1.47 KB
/
run_iotausdt.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/iota_usdt_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='IOTA/USDT',
initial_target_value=111.0, # USDT
minimal_move=10.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='nanuqcz@gmail.com', login='nanuqcz@gmail.com', 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', 'iotausdtToken'), # secures the Telegram bot
password=keyring.get_password('telegram', 'chatbotPassword'), # secures the TTM bot
root_folder=data_folder,
),
)
logger.set_pair('IOTA/USDT')
bot = ttm.bot.Real(exchange, strategy, storage, cache, logger)
# bot.set_exceptions_file(data_folder + '/exceptions.log')
#
# Run
#
bot.run()