One Reason why rectangle traders don't want to move from MT4 to MT5 - page 3

 
      datetime time,time0=rect.Time(0),time1=rect.Time(1);
      double prce,prce0=rect.Price(0),prce1=rect.Price(1);
      ChartXYToTimePrice(chartID,(int)lparam,(int)dparam,wnd,time,prce);
      ulong  time0dif=MathAbs(time0-time);
      ulong  time1dif=MathAbs(time1-time);
      double prce0dif=MathAbs(prce0-prce);
      double prce1dif=MathAbs(prce1-prce);
      //check if Time(0) && Price(1) || Time(1) && Price(0) coordinates and switch time coordinates
      if((time0dif<time1dif && prce1dif<prce0dif) ||
         (time1dif<time0dif && prce0dif<prce1dif)) { 
         rect.Time(0,time1);
         rect.Time(1,time0);
         rect.Detach();
         ChartRedraw(chartID); }
      rect.Detach(); }
 
Yes, your implementation is definitely a good one.

So the issue about the rectangles has been solved....

Waiting for a market product. Let's see who steals the code.

Anyone here to make a free product from that?