Bug: Class CChartObjectTrendByAngle does not save/load OBJPROP_ANGLE

 

The class CChartObjectTrendByAngle (defined in <ChartObjects\ChartObjectsLines.mqh>) does not have a Save nor Load method.


This Save(int filehandle) should save the OBJPROP_ANGLE property.

The Load(int filehandle) method should load that property.


The code below does the job:


//+------------------------------------------------------------------+

//| Writing parameters of object to file                            |

//+------------------------------------------------------------------+

bool CChartObjectTrendByAngle::Save(const int file_handle)

  {

//--- check

   if(file_handle==INVALID_HANDLE || m_chart_id==-1)

      return(false);

//--- write

   if(!CChartObjectTrend::Save(file_handle))

      return(false);

//--- write value of the "Angle" property

   if(!FileWriteDouble(file_handle,ObjectGetDouble(m_chart_id,m_name,OBJPROP_ANGLE)))

      return(false);

//--- successful

   return(true);

  }

//+------------------------------------------------------------------+

//| Reading parameters of object from file                           |

//+------------------------------------------------------------------+

bool CChartObjectTrendByAngle::Load(const int file_handle)

  {

//--- check

   if(file_handle==INVALID_HANDLE || m_chart_id==-1)

      return(false);

//--- read

   if(!CChartObjectTrend::Load(file_handle))

      return(false);

//--- read value of the "Angle" property

   if(!ObjectSetDouble(m_chart_id,m_name,OBJPROP_ANGLE,FileReadDouble(file_handle)))

      return(false);

//--- successful

   return(true);

  }


 
Angle is not saved, cos it will be calculated by coords
Reason: