程序库: 用于时间敏感应用程序的高性能 iTimeSeries - 页 2 12 新评论 fxsaber 2017.05.28 19:36 #11 nicholishen: 你说得对。测试是为了反映阿兰的基准而设计的。下面是一个带有时间偏移的示例,可以更准确地模拟该算法在现实世界中的应用。https://i.imgtc.com/rhYzQFj.pngiBarShift benchmark 3 based on 6417330 runs. ======================================================= iBarShift(Alain Verleyen) for 2005.03.14 12:29:59 is 4295861 in 22086.599 milliseconds. ------------------------------------------------------------- iBarShift3 for 2005.03.14 12:29:59 is 4295861 in 10717.378 milliseconds. ------------------------------------------------------------- iBarShift(direct function call) for 2005.03.14 12:29:59 is 4295861 in 20133.535 milliseconds. ------------------------------------------------------------- iBar.Shift(performance mode) for 2005.03.14 12:29:59 is 4295861 in 19648.571 milliseconds. ------------------------------------------------------------- Stanislav Korotky 2017.05.28 20:29 #12 什么是iBarShift3? fxsaber 2017.05.28 21:58 #13 Stanislav Korotky: 什么是 iBarShift3? 在本主题的源代码中。 nicholish en 2017.05.30 06:49 #14 fxsaber: 您是在调试模式 下进行测试的吧?在图表中应用脚本进行编译和测试。 fxsaber 2017.06.07 22:17 #15 nicholishen: 您是在调试模式下进行测试的吧?在图表中应用脚本进行编译和测试。 第 1606 版iBarShift benchmark 3 based on 100000 runs. ======================================================= iBarShift(Alain Verleyen) for 2017.03.30 12:36:53 is 71117 in 349.886 milliseconds. ------------------------------------------------------------- iBarShift3 for 2017.03.30 12:36:53 is 71117 in 168.600 milliseconds. ------------------------------------------------------------- iBarShift(direct function call) for 2017.03.30 12:36:53 is 71117 in 315.877 milliseconds. ------------------------------------------------------------- iBar.Shift(performance mode) for 2017.03.30 12:36:53 is 71117 in 284.332 milliseconds. fxsaber 2017.11.22 15:20 #16 错误#define DEFINE_TIMESERIE(NAME,FUNC,T) \ class CLASS##NAME \ { \ public: \ static T Get(const string Symb,const int TimeFrame,const int iShift) \ { \ T tValue[]; \ \ return((Copy##FUNC((Symb == NULL) ? _Symbol : Symb, _Period, iShift, 1, tValue) > 0) ? tValue[0] : -1); \ } \ \ T operator[](const int iPos) const \ { \ return(CLASS##NAME::Get(_Symbol, _Period, iPos)); \ } \ }; \ \ CLASS##NAME NAME; \ \ T i##NAME(const string Symb,const int TimeFrame,const int iShift) \ { \ return(CLASS##NAME::Get(Symb, TimeFrame, iShift)); \ } DEFINE_TIMESERIE(Volume,TickVolume,long) DEFINE_TIMESERIE(Time,Time,datetime) DEFINE_TIMESERIE(Open,Open,double) DEFINE_TIMESERIE(High,High,double) DEFINE_TIMESERIE(Low,Low,double) DEFINE_TIMESERIE(Close,Close,double) #include <iTimeSeries_nicholishen_v2.mqh> #define TOSTRING(A) (#A + " = " + (string)(A) + "\n") void OnStart() { CiTimeSeries iBar; if (iBar.Init()) { const double PrevClose = iBar.Close(0); Print(TOSTRING(iBar.Close(0)) + TOSTRING(Close[0])); while (!IsStopped() && (SymbolInfoDouble(_Symbol, SYMBOL_BID) == PrevClose)) Sleep(100); // iBar.Refresh(); Print(TOSTRING(iBar.Close(0)) + TOSTRING(Close[0])); } }结果iBar.Close(0) = 1.17587 Close[0] = 1.17587 iBar.Close(0) = 1.17587 Close[0] = 1.17589 Виктор Астахов 2020.08.12 13:58 #17 脚本无法编译 Yu Pang Chan 2025.09.24 11:43 #18 使用该函数库的用户需要注意: m_periodSecAdj可能无法很好地输入,并导致除数为零的 错误 在应用该函数库之前,请妥善处理它。 12 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
你说得对。测试是为了反映阿兰的基准而设计的。下面是一个带有时间偏移的示例,可以更准确地模拟该算法在现实世界中的应用。
https://i.imgtc.com/rhYzQFj.png
什么是 iBarShift3?
您是在调试模式下进行测试的吧?在图表中应用脚本进行编译和测试。
错误
结果
m_periodSecAdj可能无法很好地输入,并导致除数为零的 错误
在应用该函数库之前,请妥善处理它。