Download MetaTrader 5

Different visual form

To add comments, please log in or register
Pawel Drucis
177
Pawel Drucis  

Hello guys,


I've got an MT4 indi which plot the lines (pic.1). Can you tell me, what do I have to change in the code to make it visible like on the pic.2? (square instead of lines)


Thanks

F.

Files:
pic1.png 36 kb
pic2.png 37 kb
Stanislav Korotky
23921
Stanislav Korotky  
flashed:

Hello guys, 

I've got an MT4 indi which plot the lines (pic.1). Can you tell me, what do I have to change in the code to make it visible like on the pic.2? (square instead of lines)

You should post some code, bacause it's not clear if those lines are objects or indicator buffers.

Basically you can create rectangles something like this:

if(ObjectFind(rect) == -1)
{
  ObjectCreate(rect, OBJ_RECTANGLE, 0, time1, price1, time2, price2);
  ObjectSet(rect, OBJPROP_BACK, true);
  ObjectSet(rect, OBJPROP_COLOR, c);
}
Pawel Drucis
177
Pawel Drucis  
marketeer:

You should post some code, bacause it's not clear if those lines are objects or indicator buffers.

Basically you can create rectangles something like this:

ohh sorry. I quess this reffers to:


   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2,Black);
   SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2,Black);
   SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,2,Black);
   SetIndexStyle(3,DRAW_LINE,STYLE_SOLID,2,Black);
  

Stanislav Korotky
23921
Stanislav Korotky  
flashed:

ohh sorry. I quess this reffers to:


   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2,Black);
   SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2,Black);
   SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,2,Black);
   SetIndexStyle(3,DRAW_LINE,STYLE_SOLID,2,Black);
  

As far as I know, MT does not allow drawing rectangles by indicator buffers. So, I'd suggest to extract price values and bar times from the specified buffers and place rectangle objects on the chart by the code I provided earlier, using the extracted coordinates.
Pawel Drucis
177
Pawel Drucis  
marketeer:
As far as I know, MT does not allow drawing rectangles by indicator buffers. So, I'd suggest to extract price values and bar times from the specified buffers and place rectangle objects on the chart by the code I provided earlier, using the extracted coordinates.
Thank you for your answer, but it's still mission impossible for me since my coding skills equals zero.  Maybe someone can do it for me? I can pay via Skrill. PM me please.
Alain Verleyen
Moderator
36081
Alain Verleyen  
flashed:
Thank you for your answer, but it's still mission impossible for me since my coding skills equals zero.  Maybe someone can do it for me? I can pay via Skrill. PM me please.
See Freelance section.
To add comments, please log in or register