Server status

Posted By: mayark

Server status - 12/02/16 08:24

Hi Folks,

I am trying to figure out the last time connection to the brokers server was inactive. The scenario is this. See below entries in the log.


[86: Thu 01.12.16 02:40] 1.05945
[87: Thu 01.12.16 02:45] 1.05953
[88: Thu 01.12.16 02:53] 1.05967
[89: Thu 01.12.16 02:58] 1.05996
[90: Thu 01.12.16 03:03] 1.06001Value :: Buy ::

If my script trade in five minutes window and lets say it was offline 3 minutes. As in the log entries between 02:45 and 02:53. At 02:53 it becomes active again and continues on and put through a sale at 03:03.
That sale it put through is based on inaccurate information (because it was offline for sometime and accumulated incorrect information). My question is, is there a flag in zorro to check the server status to see if it goes offline ? (except the change of color of the server label on application). If there is one, then that would help avoid the above scenario.

Please leave your response here.
Many thanks.
mayark
Posted By: jcl

Re: Server status - 12/02/16 14:44

There is no flag, but you can check the status indirectly. Any new price quote triggers the tick() function. Store the time of the last tick and compare with the current time - then you can see how long the server was offline.
Posted By: mayark

Re: Server status - 12/03/16 00:18

Thank you very much for the answer. I will definitely try it.

mayark
© 2024 lite-C Forums