- Forums
- Help
- Please tell me which time point the data retrieved when the API was called is based on?
Please tell me which time point the data retrieved when the API was called is based on?
Author:
guigui17f, Created: 2017-10-31 18:38:15, Updated: 2017-10-31 18:48:57
Can you give a brief explanation of the time points on which GetTicker and GetRecords are based when retesting?
For example, I encountered this very strange problem, with this code:
function main (() {
while (true) {
var records = exchange.GetRecords ();
records.pop ((();
Log ((records.length);
Sleep ((60000);
I'm not sure.
I'm not sure.
The last output record has always been 0:
But if you omit the pop ((() call:
function main (() {
while (true) {
var records = exchange.GetRecords ();
// records.pop ();
Log ((records.length);
Sleep ((60000);
I'm not sure.
I'm not sure.
The final output is normal:
If there is no whilst loop, then it is OK to keep the pop ((() call:
function main (() {
var records = exchange.GetRecords ();
records.pop ((();
Log ((records.length);
Sleep ((60000);
I'm not sure.
Can you answer that?
More
- Why do bots that run ZBs report errors?
- Solved // why GetDepth only returns the correct result on the first call and does not change on subsequent calls
- The first, second, third buy, second, third buy, second, third buy, second, third buy, second, third buy, second, third buy, second, third buy, second, third buy, second, third buy, second, third buy, second buy, second buy, second buy, second buy, second buy, second buy, second buy, second buy, second buy, second buy, second buy, second buy, second buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy, third buy.
- Inventors quantify support for huobi and OKEX coins and USDT transactions?
- Open a withdrawal function that is integrated into the digital currency trading library
- How do you calculate the maximum funding capacity of a strategy by measuring the returns, volatility, etc. of a strategy?
- Shannon’s Demon
- It's not the technology that's complicated, it's the human mind!
- Bitfinex's interface access is slow, what do you guys have recommendations for server placement?
- Bitfinex is running erroneously, help analyze, thank you!
- The code for the Bitcoin coin.
- Why is there only four pairs of BCH_USD, BTC_USD, ETH_USD, and LTC_USD in bitfinex?
- The advantages and disadvantages of the three major categories of machine learning algorithms
- In the meantime, I'm going to start a new blog, and I'm going to start a new blog, and I'm going to start a new blog.
- Mechanism of final viewing
- Submitted Bug: An interaction button without a default parameter value when creating a policy failed to save
- Can the retargeting system select other currencies?
- Please translate the buy plan page
- Bitfinex has three markets, how do you get the robot to choose?
- Options from a dynamic perspective are a win-win
ZeroThe arrays that GetRecords returns are actually the same variables that are maintained at the lower level, so they cannot be changed directly.
guigui17fMaybe it's due to the features of the js language? I copied it with slice ((() once and it's okay, I don't understand why...
Inventors quantify - small dreamsTry this deep copy function, deep copy every time records are retrieved, and then you can modify the variables after the copy.
What's up?
var cloneObj = function ((obj) { // Deep copy of the object function
var str, newobj = obj.constructor === Array? [] : {};
if (typeof obj!== 'object') {
return;
} else if (JSON) {
str = JSON.stringify ((obj); // object to be serialized
newobj = JSON.parse ((str); // is rendered
} else {
for (var i in obj) {
newobj[i] = type of obj[i] === 'object'?
cloneObj ((obj[i])): obj[i]; cloneObj is a clone of Obj (i) and Obj is a clone of Obj.
I'm not sure.
I'm not sure.
return newobj;
I'm not sure.
What's up?
Inventors quantify - small dreamsslice ((() This is a complete copy, not a reference. The reference operation is actually the same variable, and the next time you modify it, it will have an impact.
guigui17fIt turns out that this is the case. It is recommended to explain in the API documentation to prevent misuse.