Download MetaTrader 5

vertical line x , y,z amount of bars move to the right

To add comments, please log in or register
blue1156
25
blue1156  

  hello. i need an indicator.

i want indicator to draw vertical line X, Y, Z bar after current bar and repaint it each bar.can you help me please?

whroeder1
14781
whroeder1  
blue1156: i want
You have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you.
We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
blue1156
25
blue1156  

I have this.It will give you a nice visual of 10 pips vertically. It also includes some vertical lines the correspondent to moving averages I use.


Btw i wanna draw with current candle ...




#property indicator_chart_window

int nLines = 1000;      // Number of total rectangles to draw
datetime CurrentTime;

int start()
{  
   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 nearest "10"
      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
      }
      ObjectCreate("VertLine4", OBJ_VLINE, 0, Time[4], Bid); // draw vert line
      ObjectSet("VertLine4", OBJPROP_TIME1, Time[4]);
      ObjectSet("VertLine4", OBJPROP_COLOR, 0x202020);
      ObjectSet("VertLine4", OBJPROP_BACK, true);
      
      ObjectCreate("VertLine8", OBJ_VLINE, 0, Time[8], Bid); // draw vert line
      ObjectSet("VertLine8", OBJPROP_TIME1, Time[8]);
      ObjectSet("VertLine8", OBJPROP_COLOR, 0x202020);
      ObjectSet("VertLine8", OBJPROP_BACK, true);
      
      ObjectCreate("VertLine24", OBJ_VLINE, 0, Time[24], Bid); // draw vert line
      ObjectSet("VertLine24", OBJPROP_TIME1, Time[24]);
      ObjectSet("VertLine24", OBJPROP_COLOR, 0x202020);
      ObjectSet("VertLine24", OBJPROP_BACK, true);
      return(0); //All done
   }
}


To add comments, please log in or register