How to limit the quantity of transactions in a week using js

Author: Half of an eight., Created: 2018-04-08 19:48:07, Updated:

How to limit the quantity of transactions in a week using js 1. Whether the time stamp can be obtained from the exchange and whether it has a function. 2. How to tell if two time frames are a week apart

Please give me some guidance.


More

Half of an eight.It's been solved, thank you.

Half of an eight.Thank you for replying, new data (().getTime (() is obtained in real time, the data has no practical meaning when retesting, don't know if there is a time loop when taking ticker data?

The Little Dream1, time stamps Some exchanges provide market data, some do not. Otherwise, time stamps can be obtained themselves, var timeStamp = new Date (().getTime (()) 2, time stamp ratio minus the error value, see if it is greater than a millisecond of a week. For example, if the time between two time points is greater than 1 minute: endTimeStamp - beginTimeStamp > 1000 * 60 ‖. As for limiting the number of transactions per week, you need to design your own implementation.