mirror of
https://github.com/Death916/emailtrade.git
synced 2026-04-10 03:04:40 -07:00
some cleanup
This commit is contained in:
parent
a0f6021dde
commit
76ac01b532
1 changed files with 5 additions and 6 deletions
11
getsignal.py
11
getsignal.py
|
|
@ -7,7 +7,7 @@ import subprocess
|
|||
import time
|
||||
import psutil
|
||||
|
||||
#login to server
|
||||
# login to server
|
||||
|
||||
def gconnect():
|
||||
imap = glogin.connect()
|
||||
|
|
@ -59,13 +59,13 @@ def get_signal():
|
|||
try:
|
||||
if 'strategy says sell now' in message.get_subject() or last_alert == 'buy':
|
||||
print('sell signal found')
|
||||
print(message.get_subject())
|
||||
# print(message.get_subject())
|
||||
print('got sell signal')
|
||||
return "sell"
|
||||
|
||||
elif 'strategy says buy now' in message.get_subject():
|
||||
print('buy signal found')
|
||||
print(message.get_subject())
|
||||
# print(message.get_subject())
|
||||
return "buy"
|
||||
except:
|
||||
print('failed')
|
||||
|
|
@ -76,12 +76,11 @@ last_uid = 0
|
|||
|
||||
while True:
|
||||
|
||||
print('in loop')
|
||||
|
||||
global uid
|
||||
gconnect()
|
||||
print(uid)
|
||||
signal = get_signal()
|
||||
print(time.ctime())
|
||||
|
||||
try:
|
||||
|
||||
|
|
@ -100,5 +99,5 @@ while True:
|
|||
except:
|
||||
print(' fail')
|
||||
|
||||
time.sleep(500)
|
||||
time.sleep(600)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue