Библиотеки: Высокопроизводительная библиотека iTimeSeries - страница 2

 
nicholishen:
You are testing these in debugging mode, are you not? Compile and test by applying the script to the chart. 
Release 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.
 

Bug

#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]));        
  }
}


Result

iBar.Close(0) = 1.17587
Close[0] = 1.17587

iBar.Close(0) = 1.17587
Close[0] = 1.17589
 
Не компилируется скрипт
Причина обращения: