Arrows issue on HIGH[]

 

Why does the OBJECT_CREATE function normally to the LOW price, but not to the HIGH price?

See the distance:


 
AliceRioBR: Why does the OBJECT_CREATE function normally to the LOW price, but not to the HIGH price? See the distance:

You have been here long enough to know that a question related to code should be accompanied by your code sample.

In the case that this is an ARROW graphical object, did you correctly set the anchor point accordingly?

Also, should this be an indicator, consider using a arrow buffer instead of graphical objects.

 
Fernando Carreiro #:

You have been here long enough to know that a question related to code should be accompanied by your code sample.

In the case that this is an ARROW graphical object, did you correctly set the anchor point accordingly?

Also, should this be an indicator, consider using a arrow buffer instead of graphical objects.

OMG! I'm tired and I forgot the basics Fernando, I'm sorry...

The code I'm using is:

// Plots the arrow ...

    
            if(  Sinal_Compra  )
              {   DrawArrow(i, "UpArrow_" + TimeToString( time[i-1]), time[i-1], low[i-1] , clrLightGreen, 233);              }
              
            if(  Sinal_Venda  )
              {   DrawArrow(i, "DnArrow_" + TimeToString( time[i-1]), time[i-1], high[i-1] , clrOrangeRed, 234);              }


// ... and the function to plot the arrows
        

      if(IsUpArrow)
      { ObjectCreate(0, name, OBJ_ARROW, 0, time, price);
      }
      else
        {
         ObjectCreate(0, name, OBJ_ARROW, 0, time, price + (10 * Point()));
        }
      ObjectSetInteger(0, name, OBJPROP_ARROWCODE, arrowCode);
      ObjectSetInteger(0, name, OBJPROP_COLOR, arrowColor);
      ObjectSetInteger(0, name, OBJPROP_WIDTH, 5);
      
     


And I cannot use a BUFFER to plot them because this code is an INDICATOR working on a "separate_window".

I don't wan't to build two indicators working together to handle this...


 
AliceRioBR #: The code I'm using is:

I will repeat ... "In the case that this is an ARROW graphical object, did you correctly set the anchor point accordingly?"

From your code, it seems you did not ...

Note: Anchor point position relative to the object can be selected from ENUM_ARROW_ANCHOR.

Graphical objects Arrow (OBJ_ARROW) have only 2 ways of linking their coordinates. Identifiers are listed in ENUM_ARROW_ANCHOR.

ENUM_ARROW_ANCHOR

ID

Description

ANCHOR_TOP

Anchor on the top side

ANCHOR_BOTTOM

Anchor on the bottom side

Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Methods of Object Binding
Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Methods of Object Binding
  • www.mql5.com
Methods of Object Binding - Objects Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Thank you Fernando - it solves the problem.
Reason: