将互联网时间数据导入metatrader4

时间:2018-09-17 13:59:55

标签: mql4 metatrader4 mql5 mt4

我发现如果服务器时间设置错误,const outfitRequestsSchema = new mongoose.Schema({ user: { type: mongoose.Schema.Types.ObjectId, ref: 'User' }, title: { type: String }, maxCost: { type: Number }, outfitChoices: [{ type: mongoose.Schema.Types.ObjectId, ref: 'OutfitChoice' }] }, {usePushEach: true}); 函数将不准确,尤其是对于使用夏令时获取其他时区的情况。

有什么方法可以将时间数据从互联网上抓取到专家顾问中?我找到了WebRequest函数,但我不太了解这些参数。

笔记本电脑上的时钟与application.post('/outfit-choices', (req, resp, next) => { OutfitRequest.findById(req.body.outfitRequest) .then(outfitRequest => { console.log(outfitRequest); const outfitChoice = new OutfitChoice(req.body); outfitChoice.save().then(outfitChoice => { outfitRequest.outfitChoices.push(outfitChoice._id); outfitRequest.save() .then(outfitRequestNew => { console.log(outfitRequestNew); this.render(resp, next); }) .catch(next); }).catch(next); }) .catch(next); }); 同步。在mt4中也可以这样做吗?还有其他网站,例如render(response: restify.Response, next: restify.Next) { return (document) => { if (document) { this.emit('beforeRender', document); response.json(document); } else { response.send(404); } return next(); } }

谢谢

1 个答案:

答案 0 :(得分:1)

您可以使用WebRequest函数,然后解析输出。虽然很多愚蠢的工作。如果您的笔记本电脑已同步,则可以使用TimeLocal()函数询问当前本地时间,并获取笔记本电脑的时间。它在测试器中不起作用(实际上,除TimeCurrent()以外,其他都不能按照官方文档中的说明正常工作。)

如果要访问“ time.is”网站,则必须查找类似于“ 20:42:15”的行,并从该行中提取当前时间(在我的情况下为20:42)。您应该使用GET请求,所以请使用第一个WebRequest函数。 请记住,WebRequest是异步的,因此需要花费一些时间去网站然后解析数据等,并且您在等待进一步的操作之前等待答复,因此可能需要每周左右调用一次该函数。