Libraries: AccurateTimer - page 4

 
fxsaber #:

I got this error when try compiling the indicator, my indicator has had OnInit(), OnDeinit(), OnTimer() and OnChartEvent().

 
Le Minh Duc #:

I got this error when try compiling the indicator, my indicator has had OnInit(), OnDeinit(), OnTimer() and OnChartEvent().

#include <AccurateTimer.mqh> // https://www.mql5.com/en/code/19859
#include <Init_Sync.mqh> // https://www.mql5.com/en/code/18138

#property indicator_chart_window

#property indicator_buffers 1
#property indicator_plots   1
#property indicator_color1  clrRed
#property indicator_type1   DRAW_LINE

input int Input = 0;

double Buffer[];

int OnInit()
{
  SetIndexBuffer(0, Buffer);
  Print("Init");
  return(INIT_SUCCEEDED);
}

void OnDeinit( const int Reason )
{
  Print("DeInit");
}

void OnChartEvent( const int id,
                   const long& lparam,
                   const double& dparam,
                   const string& sparam )
{
}

void OnTimer()
{
}

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[] )
{
  ArrayCopy(Buffer, open, prev_calculated, prev_calculated);  
  return(rates_total);
}


'AccurateTimer.mqh'     AccurateTimer.mqh       1       1
'Init_Sync.mqh' Init_Sync.mqh   1       1
'TypeToBytes.mqh'       TypeToBytes.mqh 1       1
'crc64.mqh'     crc64.mqh       1       1
macro 'OnTimer' redefinition    Init_Sync.mqh   225     9
   see previous declaration of macro 'OnTimer'  AccurateTimer.mqh       110     9
code generated          1       1
0 errors, 1 warnings, 167 msec elapsed without optimizations, cpu='AVX'         1       2