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 time
|
||||||
import psutil
|
import psutil
|
||||||
|
|
||||||
#login to server
|
# login to server
|
||||||
|
|
||||||
def gconnect():
|
def gconnect():
|
||||||
imap = glogin.connect()
|
imap = glogin.connect()
|
||||||
|
|
@ -59,13 +59,13 @@ def get_signal():
|
||||||
try:
|
try:
|
||||||
if 'strategy says sell now' in message.get_subject() or last_alert == 'buy':
|
if 'strategy says sell now' in message.get_subject() or last_alert == 'buy':
|
||||||
print('sell signal found')
|
print('sell signal found')
|
||||||
print(message.get_subject())
|
# print(message.get_subject())
|
||||||
print('got sell signal')
|
print('got sell signal')
|
||||||
return "sell"
|
return "sell"
|
||||||
|
|
||||||
elif 'strategy says buy now' in message.get_subject():
|
elif 'strategy says buy now' in message.get_subject():
|
||||||
print('buy signal found')
|
print('buy signal found')
|
||||||
print(message.get_subject())
|
# print(message.get_subject())
|
||||||
return "buy"
|
return "buy"
|
||||||
except:
|
except:
|
||||||
print('failed')
|
print('failed')
|
||||||
|
|
@ -76,12 +76,11 @@ last_uid = 0
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|
||||||
print('in loop')
|
|
||||||
|
|
||||||
global uid
|
global uid
|
||||||
gconnect()
|
gconnect()
|
||||||
print(uid)
|
print(uid)
|
||||||
signal = get_signal()
|
signal = get_signal()
|
||||||
|
print(time.ctime())
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
|
|
@ -100,5 +99,5 @@ while True:
|
||||||
except:
|
except:
|
||||||
print(' fail')
|
print(' fail')
|
||||||
|
|
||||||
time.sleep(500)
|
time.sleep(600)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue