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

71 lines
1.5 KiB
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.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# LevelDescription (Get Method)
Gets a description (text) of the level of a graphical object.
```
string  LevelDescription(
   int  level       // level number
   ) const
```
Parameters
level
[in]  Number of a graphical object level.
Return Value
Description (text) of the specified level of a graphical object that is bound to an instance of the class. Returns NULL if there is no bound object or the object has no specified level.
# LevelDescription (Set Method)
Sets the description (text) of the specified graphical object level.
```
bool  LevelDescription(
   int     level ,     // level number
   string  text        // text
   )
```
Parameters
level
[in]  Number of a graphical object level.
text
[in]  New value of description (text) of the specified graphical object level.
Return Value
true success, false - cannot change the description (text).
Example:
```
//--- example for CChartObject::LevelDescription 
#include <ChartObjects\ChartObject.mqh> 
//--- 
void OnStart() 
  { 
   CChartObject object; 
   //--- 
   for(int i=0;i<object.LevelsCount();i++) 
     { 
      //--- get level description of chart object  
      string level_description=object.LevelDescription(i); 
      if(level_description=="") 
        { 
         //--- set level description of chart object 
         object.LevelDescription(i,"Level_"+IntegerToString(i)); 
        } 
     } 
  } 
```