Files
mql5-skills/skills/mql5/references/docs/34-standardlibrary/2134-standardlibrary-chart-object-classes-cchartobject-cchartobjectchartid.md
T
2026-06-23 21:47:51 +08:00

28 lines
496 B
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ChartId
Gets the ID of the chart a graphical object belongs to.
```
long  ChartId() const
```
Return Value
ID of the chart where the graphical object is located. If there is no bound object, it returns -1.
Example:
```
//--- example for CChartObject::ChartId 
#include <ChartObjects\ChartObject.mqh> 
//--- 
void OnStart() 
  { 
   CChartObject object; 
   //--- get chart idintifier of chart object  
   long chart_id=object.ChartId(); 
  } 
```