Open Lucky21110 opened 5 years ago
if subject.startswith('TradingViewアラート:'):
action = subject.replace('TradingViewアラート:', '')
self.__action(action)
change this text TradingViewアラート:
to TradingView Alert:
in strategy.py
@noda-sin Seems like tradingview strategy doesn't work and the get_messages function in gmail_sub.py was stucked in loop and didn't return result to on_message function in strategy.py i've added logger.info in all def function in gmail_sub.py just to check if there's any function stuck in loop
i've found a fix for why tradingview strategy doesn't work. You have to modify epoch search time by reducing it by 1 second.
Edit __get_messages function in gmail_sub.py
def __get_messages(self):
#logger.info('gmailsub __get_messages is running')
if self.last_time is None:
after = calendar.timegm(datetime.now(timezone.utc).timetuple()) - 1
else:
after = self.last_time + 1
now = calendar.timegm(datetime.now(timezone.utc).timetuple()) - 1
resp = get_messages_list(self.user_id,
from_address=self.from_address,
after=after)
messages = []
self.last_time = now
if 'messages' not in resp:
return messages
for m in resp['messages']:
detail = get_message_detail(m['id'], self.user_id)
messages.append(detail)
return messages
2021-01-20 01:51:13,968 - INFO - Bot Mode : Trade 2021-01-20 01:51:13,968 - INFO - Starting Bot 2021-01-20 01:51:13,968 - INFO - Strategy : TV 2021-01-20 01:51:22,621 - INFO - Balance : 0.00442344 XBT 2021-01-20 01:51:58,261 - INFO - ========= New Order ============== 2021-01-20 01:51:58,261 - INFO - ID : Long_YBphj/cXTAKgiXFCJQAD1A 2021-01-20 01:51:58,261 - INFO - Type : Market 2021-01-20 01:51:58,262 - INFO - Side : Buy 2021-01-20 01:51:58,262 - INFO - Qty : 329 2021-01-20 01:51:58,262 - INFO - Limit : 0 2021-01-20 01:51:58,262 - INFO - Stop : 0 2021-01-20 01:51:58,263 - INFO - rPnl : -0.000128 XBT 2021-01-20 01:51:58,263 - INFO - ====================================== 2021-01-20 01:52:16,231 - INFO - Close Position : (orderID, orderType, side, orderQty, limit, stop) = (f31d1d34-8269-414b-a617-ce1cd90aafd9, Market, Sell, 329, 37273.5, None) 2021-01-20 01:52:16,232 - INFO - Close All Position 2021-01-20 01:52:18,853 - INFO - Close Position : (orderID, orderType, side, orderQty, limit, stop) = (072c56af-bf29-45c8-b651-736a71b2cf09, Market, , None, None, None) 2021-01-20 01:52:18,853 - INFO - Close All Position
Hello,
I have setup everyting and I have placed file as the documentation say
How I can troubleshoot ?
Regards