Chart lines

 

Hello. I find it annoying that my chart lines are placed at random levels. For example, my grid has lines on eur/usd (daily) at 12656; 12800; 130840 and so on. Those are random levels. Much, much more useful would be levels from one hundred pips, like 12800, 12900, 13000. Hpow can i have lines at those numbers and not random?

 

Many thanks :)

 

Cheers 

 
Cristopher:

Hello. I find it annoying that my chart lines are placed at random levels. For example, my grid has lines on eur/usd (daily) at 12656; 12800; 130840 and so on. Those are random levels. Much, much more useful would be levels from one hundred pips, like 12800, 12900, 13000. Hpow can i have lines at those numbers and not random?

Create an Indicator to draw the lines where you need them and turn off the Grid.
 

Just joined MT4 as trading platform. Afraid i can't make indicators for myself. I was taught to make money, not lines :)) 

 

Now, seriously, did anybody already do it? 

 
Cristopher:

Just joined MT4 as trading platform. Afraid i can't make indicators for myself. I was taught to make money, not lines :)) 

 

Now, seriously, did anybody already do it? 

Where have you looked ?
 
Cristopher: Now, seriously, did anybody already do it? 
there are no slaves here, do your own research.
 

Here's something I'd use to solve that problem. The good people at this forum have helped me develop some of this code. Rectangles are 10 pips each. 

And here's a good long thread on the subject, https://www.mql5.com/en/forum/140093  

 

 rectangles every 10 pips

 

//+------------------------------------------------------------------+
//|                                                   Tens Lines.mq4 |
//|                                                       Scott Gaul |
//|                                                    ScottGaul.com |
//+------------------------------------------------------------------+
#property copyright "Scott Gaul"
#property indicator_chart_window

double multLimitStop = 1.615;
int nLines = 500;              // Number of total rectangles to draw ( Blue )
datetime CurrentTime;

// http://colorschemedesigner.com/#0142dnChx00vy
//GetTickCount
// ===== deinitialization function ==================================
int deinit()
{
   ObjectDelete("VertLine1");
   ObjectDelete("VertLine2");
   ObjectDelete("VertLine3");
   ObjectDelete("VertLine4");
   ObjectDelete("VertLine5");
   for (int ixd = 0; ixd < nLines; ixd++) // Loop span number of times
   {
      ObjectDelete("tensRec"+ixd);
   }
   ObjectDelete("fenceHigh");
   ObjectDelete("fenceLow");
   ObjectDelete("aveBarInfo");
   return(0);
}

// ===== start function =============================================
int start()
{
// ----- vert lines on the 24s --------------------------------------
   int oneDay = 1440 / Period(); // for different periods
   int inc=1;
   while(inc <= 5) // draw 3 vertlines
   {
      ObjectCreate("VertLine"+inc, OBJ_VLINE, 0, Time[oneDay*inc], Bid); // draw ix hr vert line
      ObjectSet("VertLine"+inc, OBJPROP_TIME1, Time[oneDay*inc]);
      ObjectSet("VertLine"+inc, OBJPROP_COLOR, 0x404040);
      ObjectSet("VertLine"+inc, OBJPROP_BACK, true);
      inc++;
   }
// ----- draw rectangles on the 10s - only once per new bar ---------
   if (CurrentTime != Time[0])
   {
      CurrentTime = Time[0];
      double lineInterval = 0.0020;                   // interval between rectangles
      double normPrice = NormalizeDouble(Close[1],3); // Current price is rounded to 10's - "x.xxx00"
      datetime timeGap = (Time[0] - Time[1]);         // find time from one bar to the next
      for (int ix = 0; ix < nLines; ix++)             // Loop span number of times
      {
         ObjectCreate("tensRec"+ix, OBJ_RECTANGLE, 0, Bars, normPrice+((ix-(nLines/2))*lineInterval), Time[0], normPrice+((ix-(nLines/2))*lineInterval+0.0010));  // Place half above and half below the current price
         ObjectSet("tensRec"+ix,OBJPROP_TIME2,Time[0] + (timeGap*500)); // keep the rectangle stretching off screen right
         ObjectSet("tensRec"+ix,OBJPROP_COLOR,0x101010);                // Make the rectangles look better
      }
   } // end of if
   return(0); //All done
} // ===== end of start =============================================

Reason: