|
@@ -11,12 +11,18 @@ from threading import Thread
|
|
|
import db_config
|
|
|
|
|
|
def csqCallback(quantdata):
|
|
|
- try:
|
|
|
- fileName = "/www/wwwroot/csqdata/bond/" + str(round(time.time() * 1000000)) + ".txt"
|
|
|
- with open(fileName, 'w', encoding="utf-8") as file:
|
|
|
- file.write(str(quantdata.Data))
|
|
|
- except Exception as e:
|
|
|
- print(str(e))
|
|
|
+ current_time = datetime.strftime(datetime.now(),"%H:%M:%S")
|
|
|
+ time1 = "09:15:00"
|
|
|
+ time2 = "11:30:00"
|
|
|
+ time3 = "13:00:00"
|
|
|
+ time4 = "15:00:00"
|
|
|
+ if (current_time > time1 and current_time < time2) or (current_time > time3 and current_time < time4):
|
|
|
+ try:
|
|
|
+ fileName = "/www/wwwroot/csqdata/bond/" + str(round(time.time() * 1000000)) + ".txt"
|
|
|
+ with open(fileName, 'w', encoding="utf-8") as file:
|
|
|
+ file.write(str(quantdata.Data))
|
|
|
+ except Exception as e:
|
|
|
+ print(str(e))
|
|
|
|
|
|
|
|
|
class BondRestData:
|