Closed HebelHuber closed 2 years ago
updated to work with #8
Great idea. That way we get notified if any trade is made, and we don't need to check the files/logs.
Can this be merged please?
Great work @HebelHuber, can you add an option to lookup for the configurations from the config file.
Great work @HebelHuber, can you add an option to lookup for the configurations from the config file.
Sure. I also added a way to automatically disable if it is not or wrongly configured. Config looks like this now;
TRADE_OPTIONS:
# In your pairing coin
QUANTITY: 15
# BTCUSDT will be bought for example
PAIRING: USDT
TEST: True
# In %
SL: -3
TP: 2
ENABLE_TSL: True
TSL: -4
TTP: 2
LOGGING:
# Logging levels used in this program are ERROR, INFO, and DEBUG
LOG_LEVEL: INFO
LOG_FILE: bot.log
TELEGRAM:
BOT_TOKEN: my_token
BOT_CHAT_ID: my_chat_id
@CyberPunkMetalHead what's your opinion?
Are there similarities to https://github.com/CyberPunkMetalHead/gateio-crypto-trading-bot-binance-announcements-new-coins/pull/48?
It does the same thing, so there are similarities.
Okay, I think I have the LoggingHandler setup, also moved telegram creds to auth.yml. It seems like my formatter messed with main.py, gonna fix
Restored formatting main.py. Not so easy since there are a few lines that have weird whitespaces and other odditites... Since formatting is not the reason for this PR I reverted that and kept only the important changes.
@DominicFrei thanks.
I think everything should be adressed.
Using the logger now instead of going a roundabout way.
Now the logger can be instructed to also send to telegram by providing an extra parameter called TELEGRAM
.
logger.info("message",extra={'TELEGRAM': 'COIN_ANNOUNCEMENT'})
Then, only if this message type is set to True
in config, a message will be sent.
For telegram the loglevel is irrelevant, so that it can be used on info, warning, debug etc.
@Jrjy3 what do you think?
Good job, @HebelHuber ! Thanks for the contribution. :)
Thanks, happy to help!
Adds notifications via telegram bot.
Configuration is handled with the usual config file.
Configuration is done via environment variables.~~I have another PR to allow config via env vars #17 which i hope can be merged. Then i would unify configuration for telegram as well.~~