国内期貨の自動起動と停止を制御するために使われており,一日でも正常に動作する可能性がありますが,時々以下の問題が発生します.
Traceback (most recent call last): File “”, line 982, in init_ctx File “”, line 119, in File “”, line 65, in main File “”, line 27, in api URLError:
部分コードは以下の通り: if currentime (() >0.2100 and currentime (()) <0.2359 and currentwday (()!=6 and currentwday (()!=0 and status==False:# 週末以外の毎日 8:55から3:01まで ロボットを起動する status=True LogStatus(“0.2100–0.2359,Restart”) robotftrade=api(‘RestartRobot’,RobotFTrade) ログ ((“robotftrade実行開始,api==”,robotftrade) swtradetrade=api(‘RestartRobot’,swTrade) ログ ((“swtradetrade実行開始,api==”,swtradetrade) Sleep(10000) if currentime ((() <0.0855 or currentwday ((() == 6 or currentwday (()) == 0 and status == True: # 8時55分より小さいか,土曜日か日曜日か ロボットを停止する status=False LogStatus(“0.0000–0.900 or weekend,StopRobot”) robotftrade=api(‘StopRobot’,RobotFTrade) ログ ((“robotftrade執行停止,api==”,robotftrade) swtradetrade=api(‘StopRobot’,swTrade) ログ ((“swtradetrade実行停止,api==”,swtradetrade) Sleep(10000)