Find second point in object trend by angle

 

Find second point trend by angle

Hello I have an object designed with trend by angle. I can only find the anchor point that I already know. I can't find or calculate the second price point. I always get zero. But Metatrader has this data. See image above. This is my code

      
      max_col=iHighest(NULL,0,MODE_HIGH,30,0);
      pto_max=High[max_col];

      LD=2;
      linea_direzione[LD]="linea_direzione["+IntegerToString(LD)+"]";
      ObjectCreate(linea_direzione[LD], OBJ_TRENDBYANGLE,0,Time[max_col],pto_max,Time[max_col-3],0);
      ObjectSetDouble(0,linea_direzione[LD],OBJPROP_ANGLE,315);
      ObjectSet(linea_direzione[LD], OBJPROP_WIDTH, 1);
      ObjectSet(linea_direzione[LD], OBJPROP_RAY,false);
      ObjectSetInteger(0,linea_direzione[LD],OBJPROP_COLOR,clrViolet);

How can I calculate / find the price of the second point? Price that exists in the properties of the MT4 object - see image.

I tried to find the price: ObjectGetDouble, ObjectGet, ObjectGetValueByTime. But I always get zero


Thanks to who will answer


Alfred
 
There is no second point. There is only the anchor and the angle drawn by pixels.
  1. There is no angle from 2 anchor points. An angle requires distance divided by distance; a unit-less number. A chart has price and time. What is the angle of going 30 miles in 45 minutes? Meaningless!

  2. You can get the slope from a trendline: m=ΔPrice÷ΔTime. Changing the price scale, bar width, or window size, changes the apparent angle, the slope is constant. Angle is meaningless.

  3. You can create an angled line using one point and setting the angle (Object Properties - Objects Constants - Standard Constants, Enumerations and Structures - MQL4 Reference.) The line is drawn that angle in pixels. Changing the axes scales does NOT change the angle (and thus is meaningless.)

  4. If you insist, take the two price/time coordinates, convert them to pixel coordinates and then to apparent angle with arctan.
              How to get the angle of a trendline and place a text object to it? - Trend Indicators - MQL4 programming forum - Page 2

 


Metatrader finds it. Why doesn't he exhibit it?

Doesn't it make sense to draw an object if I can't find the coordinates either with Cartesian coordinates or with polar coordinates? How big is the drawn segment?