How I can identify the color of the trendline of the indicator?

 

How I can identify the color of the trendline of the indicator?

 

Thank you 

 
Tiago Cetto Pietralonga:

How I can identify the color of the trendline of the indicator?

 

Thank you 

. Immediately returns the property value.

long  ObjectGetInteger(
   long                             chart_id,          // chart identifier
   string                           name,              // object name
   ENUM_OBJECT_PROPERTY_INTEGER     prop_id,           // property identifier
   int                              prop_modifier=0    // property modifier, if required
   );

ENUM_OBJECT_PROPERTY_INTEGER

Identifier

Description

Property Type

OBJPROP_COLOR

Color

color

 

i tried but result is " no one of overload can be apllied to function call

color TrendlineColorGet(const long chart_ID=0)
  {
//--- prepare the variable to receive the color
   long result=clrNONE;
//--- reset the error value
   ResetLastError();
//--- receive chart background color
   if(!ChartGetInteger(chart_ID,OBJ_TREND,OBJPROP_COLOR,0,result))
     {
      //--- display the error message in Experts journal
      Print(__FUNCTION__+", Error Code = ",GetLastError());
     }
//--- return the value of the chart property
   return((color)result);
  }

dont know what is the error

 
B Ravi Shankar # :

i tried but result is " no one of overload can be apllied to function call

dont know what is the error

This line has an error:

if(!ChartGetInteger(chart_ID,OBJ_TREND,OBJPROP_COLOR,0,result))


Read the documentation carefully ChartGetInteger

bool  ChartGetInteger(
   long    chart_id,        // Chart ID
   int     prop_id,         // Property ID
   int     sub_window,      // subwindow number
   long&   long_var         // Target variable for the property
   );

prop_id

[in]  Chart property ID. This value can be one of the ENUM_CHART_PROPERTY_INTEGER values.

Documentation on MQL5: Chart Operations / ChartGetInteger
Documentation on MQL5: Chart Operations / ChartGetInteger
  • www.mql5.com
ChartGetInteger - Chart Operations - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: