Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 649

 
Coding wizards, who can help? There is a need to get the coordinates(time, price) of rectangles from other timeframes. What function can do this?
 
.roman.:
Coding wizards, who can help? There is a need to get the coordinates(time, price) of rectangles from other timeframes. What function can do this?

how does it differ from the current timeframe? time, price... same on all timeframes
 
sergeev:

how does it differ from the current TF? time, price... the same on all TFs

void RectangleReader()
{
   double supplyEdgePrice = ObjectGet("Supply",3), demandEdgePrice = ObjectGet("Demand",1);
   int barsSinceSupplyStart = iBarShift(NULL, 0, ObjectGet("Supply",0)), barsSinceDemandStart = iBarShift(NULL, 0, ObjectGet("Demand",0));
   int barNumberTillSupTouch = 0, barNumberTillDemTouch = 0 ;
   int a,b;
   for(a=0; High[a]<=supplyEdgePrice; a++)
   {
      barNumberTillSupTouch = a;
   }
   for(b=0;Low[b]>=demandEdgePrice;b++)
   {
      barNumberTillDemTouch = b;
   }
   string Obj_Name ="Lbl";
   ObjectCreate(Obj_Name,OBJ_LABEL,0,0,0);
   ObjectSet(Obj_Name,OBJPROP_CORNER,1);
   ObjectSet(Obj_Name,OBJPROP_XDISTANCE,3);
   ObjectSet(Obj_Name,OBJPROP_YDISTANCE,300);
   if(barNumberTillSupTouch!=0 && barNumberTillSupTouch<barNumberTillDemTouch)ObjectSetText(Obj_Name,"Rect DOWN",10,"MS Sans Serif",Red);
   else ObjectSetText(Obj_Name,"Rect UP",10,"MS Sans Serif",Green);
}
Here is my code. Maybe I didn't express it correctly...I need to get rectangle parameters from H4 and daily, for example, while being on H1.
 
.roman.:

You need to be on H1, for example, to get rectangle parameters from H4 and the diary.

I don't see any rectangles in the code. only labels

 
sergeev:

I don't see any rectangles in the code. only labels

ObjectGet retrieves rectangle parameters (supply and demand are rectangle names, for example).
 
.roman.:
ObjectGet retrieves rectangle parameters (supply and demand are rectangle names, for example).

Well, they did. Okay.

what's your question?

 
sergeev:

Well, they did. Okay.

What's the question?



Ok, let me try to be more specific. In my code, the data comes from rectangles on the chart of the current timeframe (H1, for example). I, being on H1 again, need to get similar data from rectangles on other timeframes (H4 and daily), while staying on the same H1.
 
.roman.:

Ok, I'll try to be more specific. In my code, the data comes from rectangles, which are on the chart of the current TF (H1, for example). I, being on H1 again, need to get similar data from rectangles on other timeframes (H4 and daily), while staying on the same H1.

Well, you've already written

ObjectGet(name, what parameter)

 
sergeev:

Well, you've already written

ObjectGet(name, what parameter)



My understanding is that it needs to get object parameters from another chart.

Isn't it easier to draw these objects on the current chart?

 
AlexeyVik:

My understanding is that he needs to get object parameters from another chart.

If from another chart, let him use the function variant with the chart identifier.

no problem either.