How to get last two/three TP/SL trendline parameter

 

Hi,

I need to get last TP1, TP2, SL1, SL2, SL3 parameter/value?




 
There is no TP1, TP2, SL1, SL2, SL3. Select the order and get the current TP/SL.
 
William Roeder #:
There is no TP1, TP2, SL1, SL2, SL3. Select the order and get the current TP/SL.A

As I can see here the system didn't add my pictures. Check attachment.


This is my code:

    int i;
     int total=ObjectsTotal(0, 0, OBJ_TREND);
          for(int i=0; i<total; i++)
      {
    
   objName=ObjectName(0, i, 0, OBJ_TREND);
        if (ObjectType(objName) == OBJ_TREND)
        {
        
        fnFileWriteLine("aaaa.txt",("ObjectName: "+objName+";Price:"+ObjectGet(objName, OBJPROP_PRICE1)+","));


Now returns all but I need to get TP1, TP2, TP3 , SL1, SL2 - last one only.




Files:
 
  objName=ObjectName(0, i, 0, OBJ_TREND);
Invalid MT4 call. ObjectName - Object Functions - MQL4 Reference