Description
Describe the bug
I have been trying this bot awhile and just noticed a case that bot bought API3 at highest price 4.982
and sold with -1.534 profit
.
The Binance API says it released at Fri Jan 21 2022 06:28:04 GMT+0000
but bot noticed this at 06:28:29
(Telegram mesage timestamp).
{
"id": 80650,
"code": "43b644d339394646bf65bf5c1e70d031",
"title": "Binance Will List API3 (API3)",
"type": 1,
"releaseDate": 1642746484252
},
Actual behavior
Telegram message logs:
06:28:29
: New announcement detected: API3
06:28:33
: New announcement detected: API3
06:28:34
: starting buy placeorder with : announcementcoin='API3' | globals.pairing='USDT' | volume=33.0 | amount=6.623845845042151 x price='4.982' | side = buy | status='cancelled'
06:28:34
: Order on API3 closed
06:30:42
: sold API3 with -1.534 profit | -3.031% PNL
Expected behavior
I'm not sure how we should tackle this problem but how about:
- Check if difference between
releaseDate
andtime.now
greater or equal than%d {seconds, minutes}
- Check if price got
%%d
pump (during the starting buy stage) compared to%d {seconds, minutes}
ago - The following above conditions should work in
or
mode
Screenshots
https://www.tradingview.com/x/lLso7vnj/
Logs
-
Additional context
My config:
---
TRADE_OPTIONS:
KUCOIN_ANNOUNCEMENTS: True
QUANTITY: 50
PAIRING: USDT
TEST: True
SL: -3
TP: 2
ENABLE_TSL: True
TSL: -4
TTP: 2
LOGGING:
LOG_LEVEL: DEBUG
LOG_FILE: bot.log
LOG_TO_CONSOLE: True
TELEGRAM:
ENABLED: True
NOTIFICATIONS:
STARTUP: True # welcome message
COIN_ANNOUNCEMENT: True # detected new announcement
COIN_NOT_SUPPORTED: True # coin is not on gate.io
BUY_START: True # when entering position
BUY_ORDER_CREATED: True # when buy order is created
BUY_FILLED: True # when the buy order got filled
SELL_START: True # when starting to sell
SELL_FILLED: True # when sold
Activity