SetData-data
This JSON is used to set the data to be loaded by the exchange.SetData() function. This JSON data uses an array structure, where each element is also an array with the format [time, data].
Attributes
| Name | Type | Description |
time | number | The timestamp of the data, used to mark the time corresponding to this data entry. |
data | string / number / bool / object / array / any (any type supported by the platform) | data is the specific data content corresponding to a certain time in the data loaded by the |
See Also
Remarks
Example of loading data in the backtesting system and retrieving data when the strategy backtest is running:
javascript
/*backtest
start: 2020-01-21 00:00:00
end: 2020-02-12 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Bitfinex","currency":"BTC_USD"}]
*/
function main() {
exchange.SetData("test", [[1579536000000, _D(1579536000000)], [1579622400000, _D(1579622400000)], [1579708800000, _D(1579708800000)]])
while(true) {
Log(exchange.GetData("test"))
Sleep(1000 * 60 * 60 * 24)
}
}