WindowPriceMax()/WindowPriceMin() problem - page 2

 

OK thanks for the tip - this works but still not great as there is a lag before data is updated.

int init()
  {
   ObjectCreate("lane1",OBJ_RECTANGLE,0,Time[200],WindowPriceMax(0),Time[170],WindowPriceMin(0));
   ObjectSet("lane1",OBJPROP_COLOR,Red);
   Print(WindowPriceMax(0),"  ",WindowPriceMin(0));
   
   ObjectCreate("lane2",OBJ_RECTANGLE,0,Time[168],WindowPriceMax(0),Time[138],WindowPriceMin(0));
   ObjectSet("lane2",OBJPROP_COLOR,Red);
   
   ObjectCreate("lane3",OBJ_RECTANGLE,0,Time[136],WindowPriceMax(0),Time[106],WindowPriceMin(0));
   ObjectSet("lane3",OBJPROP_COLOR,Red);
   
   ObjectCreate("lane4",OBJ_RECTANGLE,0,Time[104],WindowPriceMax(0),Time[74],WindowPriceMin(0));
   ObjectSet("lane4",OBJPROP_COLOR,Red);
   Print("start: Check for Error after ObjectCreate: ", GetLastError());
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   ObjectDelete("lane1");
   ObjectDelete("lane2");
   ObjectDelete("lane3");
   ObjectDelete("lane4");
   
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
  
  ObjectSet("lane1",OBJPROP_TIME1,Time[200]);
  ObjectSet("lane1",OBJPROP_PRICE1,WindowPriceMax(0));
  ObjectSet("lane1",OBJPROP_TIME2,Time[170]);
  ObjectSet("lane1",OBJPROP_PRICE2,WindowPriceMin(0));
  WindowRedraw();
   
   return(0);
  }
 
sd59:

OK thanks for the tip - this works but still not great as there is a lag before data is updated.

Do you really need to use WindoPriceMin() and Max ?  can't your rectangle go from zero to a large number ?
 
yep probably could - i just need to think things through for rest of program. Thanks again.