错误、漏洞、问题 - 页 2613 1...260626072608260926102611261226132614261526162617261826192620...3184 新评论 Vladimir Pastushak 2019.12.06 20:32 #26121 Vladimir Pastushak:关于GetMicrosecondCount()的问题 而在视频的最后,打印记录显示 OD 0 22:58:46.604 测试(EURUSD,M15) 66190 GJ 0 22:58:46.669 测试(EURUSD,M15) 65134 GQ 0 22:58:55.914 测试(EURUSD,M15) 67867 这个值和之前的值相差9秒,但是GetMicrosecondCount()显示67867毫秒。 PD 0 22:58:56.715 测试(EURUSD,M15) 66139 Maxim Kuznetsov 2019.12.06 20:57 #26122 Vladimir Pastushak: 另外,在视频的最后,打印记录显示 OD 0 22:58:46.604 测试(EURUSD,M15) 66190 GJ 0 22:58:46.669 测试(EURUSD,M15) 65134 GQ 0 22:58:55.914 测试(EURUSD,M15) 67867 这个值和之前的值相差9秒,但是GetMicrosecondCount()显示67867毫秒。 PD 0 22:58:56.715 测试(EURUSD,M15) 66139 溢出......计数器必须以模数进行比较 MetaQuotes 2019.12.06 21:00 #26123 Vladimir Pastushak:另外,在视频的最后,打印记录显示OD 0 22:58:46.604 测试(EURUSD,M15) 66190GJ 0 22:58:46.669 测试(EURUSD,M15) 65134GQ 0 22:58:55.914 测试(EURUSD,M15) 67867 这个值和之前的值相差9秒,但是GetMicrosecondCount()显示67867毫秒。PD 0 22:58:56.715 测试(EURUSD,M15) 66139 不幸的是,你没有显示你的完整代码。 你打算如何讨论百万分之一秒的测量,只呈现视频而完全忽视代码? 如果你肯定想讨论微秒计时器 测量的准确性,那么就运行这个例子。 void OnStart() { ulong ticks; //--- ticks=GetMicrosecondCount(); Sleep(40); Print("40 ms = ",GetMicrosecondCount()-ticks," msc"); //--- ticks=GetMicrosecondCount(); Sleep(10); Print("10 ms = ",GetMicrosecondCount()-ticks," msc"); } 40 ms = 40354 msc 10 ms = 10487 msc 没有测量误差。 GetMicrosecondCount()在系统的QueryPerformanceCounter上运行,为方便起见,嵌入了对应用程序启动时间的引用。 寻找你的定时代码中的错误。 Vladimir Pastushak 2019.12.07 06:45 #26124 MetaQuotes Software Corp.: 不幸的是,你没有显示你的完整代码。 你打算如何讨论测量百万分之一秒的问题,只提出一个视频,而完全忽略了代码? 如果你肯定想讨论微秒计时器测量的准确性,那么请运行这个例子。 没有测量误差。 GetMicrosecondCount()在系统的QueryPerformanceCounter上运行,为了方便起见,对应用程序开始时间的引用被放在里面。 在你自己的时间测量代码中寻找错误。 我使用了标准库。我稍后会公布代码,但那里没有什么新东西。 Gudgeon 2019.12.07 07:47 #26125 保持对货币和国家的选择也不是一个坏主意。 SEM 2019.12.07 14:11 #26126 在最后一次更新后,滞后测试器在视觉测试 模式下,30-60秒内挂起,在历史开始时抛出图表。 在创建对象时有一个错误,例如,创建一个按钮,位置在前台,创建一条线,位置在后台,但如果对象相交,当你试图按下按钮时,前台的线,虽然在视觉上首先是按钮。如果你在按钮上按住鼠标,就会弹出一个菜单,上面有创建的线的名称(它在与按钮有关的背景中)。 Михаил 2019.12.08 05:01 #26127 我希望能在优化完成之前看到正向优化 的结果。 我希望这些结果的显示方式与主优化的结果相同--立即显示在窗口中。而现在,根本就没有这样的窗口。 奇怪的是,为什么在同一个(本质上)过程中,有一个窗口而没有另一个窗口...... [删除] 2019.12.08 07:07 #26128 据我所知,在 "市场概览 "窗口中,符号现在有买入和卖出价格,没有被关闭? 图片2265。 Andrei Kossarev 2019.12.08 07:22 #26129 //+------------------------------------------------------------------+ //| Test.mq5 | //| Copyright 2019, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2019, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property indicator_chart_window #property indicator_plots 1 #property indicator_buffers 1 #include <Trident\TCoreMain.mqh> //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { ::EventSetMillisecondTimer(500); return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { ::EventKillTimer(); } void OnTimer() { ::EventKillTimer(); TestPhoto(); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //--- //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+ void TestPhoto() { string name; MqlDateTime dtLocal; TimeToStruct(TimeLocal(), dtLocal); string date = IntegerToString(dtLocal.year) + IntegerToString(dtLocal.mon, 2, '0') + IntegerToString(dtLocal.day, 2, '0'); string time = IntegerToString(dtLocal.hour, 2, '0') + "." + IntegerToString(dtLocal.min, 2, '0') + "." + IntegerToString(dtLocal.sec, 2, '0'); name = "ScreenShots/" + date + "/" + _Symbol + "_" +date + "_" + time + ".png"; if (!ChartScreenShot(0, name, 1920,1200, ALIGN_RIGHT)) return; ResetLastError(); for (int i=0; i < 100000; i++){ if (FileIsExist(name,false) && FileSize(name) > 0) break; } //--- int flags=FILE_READ|FILE_BIN|FILE_SHARE_READ; //--- int file=FileOpen(name,flags); if(file<0) { Print("Операция FileOpen неудачна, ошибка ",GetLastError()); return; } uchar photo[]; FileReadArray(file,photo); FileClose(file); Print(ArraySize(photo)); } 从指标中读取二进制文件不起作用!!!来自EA的类似代码工作起来没有问题 Andrei Kossarev 2019.12.08 07:23 #26130 //+------------------------------------------------------------------+ //| Test.mq5 | //| Copyright 2019, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2019, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property indicator_chart_window #property indicator_plots 1 #property indicator_buffers 1 #include <Trident\TCoreMain.mqh> //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { ::EventSetMillisecondTimer(500); return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { ::EventKillTimer(); } void OnTimer() { ::EventKillTimer(); TestPhoto(); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //--- //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+ void TestPhoto() { string name; MqlDateTime dtLocal; TimeToStruct(TimeLocal(), dtLocal); string date = IntegerToString(dtLocal.year) + IntegerToString(dtLocal.mon, 2, '0') + IntegerToString(dtLocal.day, 2, '0'); string time = IntegerToString(dtLocal.hour, 2, '0') + "." + IntegerToString(dtLocal.min, 2, '0') + "." + IntegerToString(dtLocal.sec, 2, '0'); name = "ScreenShots/" + date + "/" + _Symbol + "_" +date + "_" + time + ".png"; if (!ChartScreenShot(0, name, 1920,1200, ALIGN_RIGHT)) return; ResetLastError(); for (int i=0; i < 100000; i++){ if (FileIsExist(name,false) && FileSize(name) > 0) break; } //--- int flags=FILE_READ|FILE_BIN|FILE_SHARE_READ; //--- int file=FileOpen(name,flags); if(file<0) { Print("Операция FileOpen неудачна, ошибка ",GetLastError()); return; } uchar photo[]; FileReadArray(file,photo); FileClose(file); Print(ArraySize(photo)); } 从指标中读取二进制文件不起作用,从EA中读取同样的代码却能顺利工作! 1...260626072608260926102611261226132614261526162617261826192620...3184 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
关于GetMicrosecondCount()的问题
而在视频的最后,打印记录显示
OD 0 22:58:46.604 测试(EURUSD,M15) 66190
GJ 0 22:58:46.669 测试(EURUSD,M15) 65134
GQ 0 22:58:55.914 测试(EURUSD,M15) 67867 这个值和之前的值相差9秒,但是GetMicrosecondCount()显示67867毫秒。
PD 0 22:58:56.715 测试(EURUSD,M15) 66139
另外,在视频的最后,打印记录显示
OD 0 22:58:46.604 测试(EURUSD,M15) 66190
GJ 0 22:58:46.669 测试(EURUSD,M15) 65134
GQ 0 22:58:55.914 测试(EURUSD,M15) 67867 这个值和之前的值相差9秒,但是GetMicrosecondCount()显示67867毫秒。
PD 0 22:58:56.715 测试(EURUSD,M15) 66139
溢出......计数器必须以模数进行比较
另外,在视频的最后,打印记录显示
OD 0 22:58:46.604 测试(EURUSD,M15) 66190
GJ 0 22:58:46.669 测试(EURUSD,M15) 65134
GQ 0 22:58:55.914 测试(EURUSD,M15) 67867 这个值和之前的值相差9秒,但是GetMicrosecondCount()显示67867毫秒。
PD 0 22:58:56.715 测试(EURUSD,M15) 66139
不幸的是,你没有显示你的完整代码。
你打算如何讨论百万分之一秒的测量,只呈现视频而完全忽视代码?
如果你肯定想讨论微秒计时器 测量的准确性,那么就运行这个例子。
没有测量误差。
GetMicrosecondCount()在系统的QueryPerformanceCounter上运行,为方便起见,嵌入了对应用程序启动时间的引用。
寻找你的定时代码中的错误。
不幸的是,你没有显示你的完整代码。
你打算如何讨论测量百万分之一秒的问题,只提出一个视频,而完全忽略了代码?
如果你肯定想讨论微秒计时器测量的准确性,那么请运行这个例子。
没有测量误差。
GetMicrosecondCount()在系统的QueryPerformanceCounter上运行,为了方便起见,对应用程序开始时间的引用被放在里面。
在你自己的时间测量代码中寻找错误。
我使用了标准库。我稍后会公布代码,但那里没有什么新东西。
保持对货币和国家的选择也不是一个坏主意。
我希望能在优化完成之前看到正向优化 的结果。
我希望这些结果的显示方式与主优化的结果相同--立即显示在窗口中。而现在,根本就没有这样的窗口。
奇怪的是,为什么在同一个(本质上)过程中,有一个窗口而没有另一个窗口......
据我所知,在 "市场概览 "窗口中,符号现在有买入和卖出价格,没有被关闭?
图片2265。
从指标中读取二进制文件不起作用!!!来自EA的类似代码工作起来没有问题