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

54 lines
1.0 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.
# Timeframes (Get Method)
Gets visibility flags of a graphical object.
```
int  Timeframes() const
```
Return Value
Visibility flags of the graphical object attached to an instance of the class. If there is no attached object, it returns 0.
# Timeframes (Set Method)
Sets visibility flags of a graphical object.
```
bool  Timeframes(
   int  new_timeframes      // visibility flags
   )
```
Parameters
new_timeframes
[in]  New visibility flags of the graphical object.
Return Value
true - success, false - cannot change the flags of visibility.
Example:
```
//--- example for CChartObject::Timeframes  
#include <ChartObjects\ChartObject.mqh>  
//---  
void OnStart()  
  {  
   CChartObject object;  
   //--- get timeframes of chart object   
   int timeframes=object.Timeframes();  
   if(!(timeframes&OBJ_PERIOD_H1))  
     {  
      //--- set timeframes of chart object  
      object.Timeframes(timeframes|OBJ_PERIOD_H1);  
     }  
  }  
```