Skip to content

Commit

Permalink
trade time or skip
Browse files Browse the repository at this point in the history
  • Loading branch information
molebot committed Sep 24, 2015
1 parent 3b4c218 commit 7292c6a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions demoMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
import ctypes
import sys
import zmq
from datetime import datetime
from time import sleep

from demoEngine import MainEngine
from demoUi import *

acc={}
#----------------------------------------------------------------------
def main():
Expand Down Expand Up @@ -64,8 +67,25 @@ def main():

sys.exit(app.exec_())

def isTrade(_d):
if _d.hour==9 and _d.minute>=15:
return True
elif _d.hour==15 and _d.minute<15:
return True
elif _d.hour==11 and _d.minute<30:
return True
elif _d.hour in [10,13,14]:
return True
else:
return False

if __name__ == '__main__':
_now = datetime.now()
while not isTrade(_now):
sleep(1)
print(_now)
_now = datetime.now()

while 1:
try:
main()
Expand Down
Binary file modified mdconnection/TradingDay.con
Binary file not shown.
2 changes: 1 addition & 1 deletion setting.vn.dat
Original file line number Diff line number Diff line change
Expand Up @@ -99606,7 +99606,7 @@ p2
cdatetime
date
p3
(S'\x07\xdf\t\x16'
(S'\x07\xdf\t\x18'
tRp4
sS'dictInstrument'
p5
Expand Down
Binary file modified tdconnection/Private.con
Binary file not shown.
Binary file modified tdconnection/Public.con
Binary file not shown.
Binary file modified tdconnection/QueryRsp.con
Binary file not shown.
Binary file modified tdconnection/TradingDay.con
Binary file not shown.

0 comments on commit 7292c6a

Please sign in to comment.