Files
mql5-skills/skills/mql5/references/docs/34-standardlibrary/2139-standardlibrary-chart-object-classes-cchartobject-cchartobjectsetpoint.md
T

51 lines
1.0 KiB
Markdown
Raw Normal View History

2026-06-23 21:47:51 +08:00
# SetPoint
Sets new coordinates of the specified anchor point of the graphical object.
```
bool  SetPoint(
   int       point,         // point number
   datetime  new_time,      // time coordinate
   double    new_price      // price coordinate
   )
```
Parameters
point
[in]  Number of the graphical object anchor point.
new_time
[in]  New value for the time coordinate of the specified anchor point.
new_price
[in]  New value for price coordinate of the specified anchor point.
Return Value
true - success, false - cannot change coordinates of the point.
Example:
```
//--- example for CChartObject::SetPoint  
#include <ChartObjects\ChartObject.mqh>  
//---  
void OnStart()  
  {  
   CChartObject object;  
   double       price;  
   //---  
   if(object.NumPoints()>0)  
     {  
      //--- set point of chart object  
      object.SetPoint(0,CurrTime(),price);  
     }  
  }  
```