The resource loading... loading...

How does the FMZ platform enable robots to automatically monitor error reports and, if there is a mistake, strategize through API extensions?

Author: mingren1992, Created: 2019-11-05 16:32:11, Updated:

For example, some exchanges often have uncontrollable errors that cause the robot to stop. So I wanted to monitor the error report via the FMZ platform exit or onerror function, and then restart automatically through the API extension. 1, JS's try catch method, but catch less than some interface error reports etc. 2, the host's sweep function exit, which can be executed, but cannot be restarted to enter the main function. 3,js function.onerror, root is not responding.

So is there a more appropriate way to monitor for API errors and continue to operate?


More

Laughingfunction GetTicker ((() {// Obtain and store market information Sleep ((200); The var ticker; For ((var j=0; j<3; j++) { var goGetTicker = exchanges[e].Go (("GetTicker");// asynchronously to buy If ((!goGetTicker) return 0;// The network is not working ticker = goGetTicker.wait ((2500);// Asynchronous waiting for results, 1 second over time. Interval = 1000 if (typeof) === "undefined") ticker = goGetTicker.wait (Interval *DB);// overtime and wait 2 seconds If (ticker) { HuoCenKline (ticker) is a Chinese blogger who is currently working on a blog. return ticker;// correct export orders=[]; with orders=null; the former orders.length=0; the latter orders.length will be wrong! I'm not sure. Sleep else ((Math.pow(DB,j) *Interval*DB);//rest DB = 2 where j + 1 second squared 14 + 4.5 * 3 = 27.52 seconds maximum waiting time I'm not sure. return 0;// Interface not working }// set the timeout

congcong009Did you all choose js? I chose python, now the head is big, there are no rich libraries and references for js, cry.

nxtplayerI need to write an additional script to run independently, such as scanning every 10 minutes to see if the robot is still running. Now my commodity futures are to use the script to close the deal, shut down the robot on weekends, and start the robot automatically.

The grassYou can make mistakes, and the interface error does not affect the policy running. https://www.fmz.com/bbs-topic/4158

congcong009There's a lot of libraries, like basic libraries, punctuation libraries, options libraries, all of which are based on JS, and you're right, there's a lot of JS in reference too.

nxtplayerI wrote it directly in Python and then deployed it to the server remotely.

mingren1992The Python library is a little bit richer, right?

mingren1992Thank you very much. I'm Chao Biha, I'm managing the API of the robot. I'll write this code too. The key is that I'm a key hire host, not so much at the back end, how is the code of the admin robot on the server?

nxtplayerThe platform has an API for managing bots, so write one and run it on the server.

mingren1992Thank you, where is this script written and run? I think FMZ just has a main to write a strategy, and this script specifically runs on the FMZ platform?

The grassYou're saying GetOrder is wrong, how can it possibly stop, return null indicates no order information or network error, and then process it.

mingren1992It just seems to have solved that problem. Onexit can solve that problem.

mingren1992Yes, I've actually read the first tutorial, but it didn't solve my problem. The key is: 1. the retry function only applies to functions such asgetticker after the FMZ package, I use more IO, I can't retry. 2. try catch, for example setorder, no catch at all, the statement in the catch is not executed. 3.

The grassIt's normal to make mistakes, and it's okay to make mistakes.

mingren1992I received, thank you, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please, please.

mingren1992I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry, I'm sorry,