Download MetaTrader 5

Anchor (Get Method)

Gets anchor type of the "Arrow" object

ENUM_ARROW_ANCHOR  Anchor() const

Return Value

Anchor type of the "Arrow" object assigned to the class instance (to the chart). If there is no object assigned, it returns WRONG_VALUE.

Anchor (Set Method)

Sets anchor type for the "Arrow" object

bool  Anchor(
   ENUM_ARROW_ANCHOR  anchor      // anchor type



[in]  New anchor type value

Return Value

true - successful, false - cannot change the anchor type.


//--- example for CChartObject::Anchor  
#include <ChartObjects\ChartObjectsArrows.mqh>  
void OnStart()  
   CChartObjectArrow arrow;  
//--- set object parameters  
   double price=SymbolInfoDouble(Symbol(),SYMBOL_BID);  
      //--- arrow create error  
      printf("Arrow create: Error %d!",GetLastError());  
//--- get anchor of arrow  
     //--- set anchor of arrow  
//--- use arrow  
//--- . . .