Download MetaTrader 5

MAX_DBL

To add comments, please log in or register
The entire MQL5.community history on a single page!
Alextarch
5
Alextarch 2011.03.21 01:35 

Hello,

I keep getting this error for empty_value. What am I doing incorrectly?

bool CSignalCOS::InitIndicators(CIndicators* indicators)
  {
//--- 
   if(indicators==NULL)       return(false);
//--- 
   if(!InitOpen(indicators))  return(false);
//--- 
   if(!InitHigh(indicators))  return(false);
//--- 
   if(!InitLow(indicators))  return(false);
//--- 
   if(!InitClose(indicators))  return(false);
//--- 
   if(!InitTickVolume(indicators))  return(false);
//
   return(true);
  }
//---
bool CSignalCOS::InitOpen(CIndicators* indicators)
  {
//---
   if(m_open==NULL)
      if((m_open=new CiOpen)==NULL)
        {
         printf(__FUNCTION__+": error creating object");
         return(false);
        }
//---
   if(!indicators.Add(GetPointer(m_open)))
     {
      printf(__FUNCTION__+": error adding object");
      delete m_open;
      return(false);
     }
//---
   if(!m_open.Create(m_symbol.Name(),m_period))
     {
      printf(__FUNCTION__+": error initializing object");
      return(false);
     }
//---
   m_open.Refresh(-1);
   return(true);
  }
bool CSignalCOS::InitHigh(CIndicators* indicators)
  {
//---
   if(m_high==NULL)
      if((m_high=new CiHigh)==NULL)
        {
         printf(__FUNCTION__+": error creating object");
         return(false);
        }
//---
   if(!indicators.Add(GetPointer(m_high)))
     {
      printf(__FUNCTION__+": error adding object");
      delete m_high;
      return(false);
     }
//---
   if(!m_high.Create(m_symbol.Name(),m_period))
     {
      printf(__FUNCTION__+": error initializing object");
      return(false);
     }
//---
   m_high.Refresh(-1);
   return(true);
  }
bool CSignalCOS::InitLow(CIndicators* indicators)
  {
//---
   if(m_low==NULL)
      if((m_low=new CiLow)==NULL)
        {
         printf(__FUNCTION__+": error creating object");
         return(false);
        }
//---
   if(!indicators.Add(GetPointer(m_low)))
     {
      printf(__FUNCTION__+": error adding object");
      delete m_low;
      return(false);
     }
//---
   if(!m_low.Create(m_symbol.Name(),m_period))
     {
      printf(__FUNCTION__+": error initializing object");
      return(false);
     }
//---
   m_low.Refresh(-1);
   return(true);
  }
bool CSignalCOS::InitClose(CIndicators* indicators)
  {
//---
   if(m_close==NULL)
      if((m_close=new CiClose)==NULL)
        {
         printf(__FUNCTION__+": error creating object");
         return(false);
        }
//---
   if(!indicators.Add(GetPointer(m_close)))
     {
      printf(__FUNCTION__+": error adding object");
      delete m_close;
      return(false);
     }
//---
   if(!m_close.Create(m_symbol.Name(),m_period))
     {
      printf(__FUNCTION__+": error initializing object");
      return(false);
     }
//---
   m_close.Refresh(-1);
   return(true);
  }
bool CSignalCOS::InitTickVolume(CIndicators *indicators)
  {
//---
   if(m_tick_volume==NULL)
      if((m_tick_volume=new CiTickVolume)==NULL)
        {
         printf(__FUNCTION__+": error creating object");
         return(false);
        }
//---
   if(!indicators.Add(GetPointer(m_tick_volume)))
     {
      printf(__FUNCTION__+": error adding object");
      delete m_tick_volume;
      return(false);
     }
//---
   if(!m_tick_volume.Create(m_symbol.Name(),m_period))
     {
      printf(__FUNCTION__+": error initializing object");
      return(false);
     }
//---
   m_tick_volume.Refresh(-1);
   return(true);
  }
//
double CSignalCOS::Opens(int index)
   {
      m_open.Refresh(-1);
      double open;
      open=Open(index)-Open(index+5);
      open/=6;
      Print(" open : ",open," & op price : ",Open(index));
      return(open);
   }
//---
double CSignalCOS::Highs(int index)
   {
      m_high.Refresh(-1);
      double high;
      high=High(index)-High(index+5);
      high/=6;
      Print(" high : ",high," & hi price : ",High(index));
      return(high);
   }
//---
double CSignalCOS::Lows(int index)
   {
      m_low.Refresh(-1);
      double low;
      low=Low(index)-Low(index+5);
      low/=6;
      Print(" low : ",low," & lo price : ",Low(index));
      return(low);
   }
//---
double CSignalCOS::Closes(int index)
   {
      m_close.Refresh(-1);
      double close;
      close=Close(index)-Close(index+5);
      close/=6;
      Print(" close : ",close," & cl price : ",Close(index));
      return(close);
   }
//---
long CSignalCOS::TickVolumes(int index)
   {
      m_tick_volume.Refresh(-1);
      long tick_volume;
      tick_volume=TickVolume(index)+TickVolume(index+1)+TickVolume(index+2)+TickVolume(index+3)+TickVolume(index+4)+TickVolume(index+5);
      Print(" vol : ",tick_volume);
      return(tick_volume);
   }
//---
Alexey Da
Moderator
6598
Alexey Da 2011.03.23 12:35  

Could you create ticket using ServiceDesk?

We need to get a full source code (all mq5, mqh files) to reproduce. Unfortunately the part of code you have attached doesn't allow us to reproduce your problem.

To add comments, please log in or register