Drawing a square or rectangle. Really need help... - page 7

 
evillive:

To replace a tick with another symbol,OBJ_ARROW and ARROW_CODE.

This is where I figured out how to do it. It worked.
 
AlexeyVik:

What's not to like about

DRAW_SECTION

1

The bars between non-empty values of the line

Because it is not drawn correctly in the indicator, in the way it is represented now, the line is drawn through the indicator buffer not on each H4, but on each bar of the TF, on which the indicator is running. To avoid this, you need to either seriously revise the code or draw the lines with objects, which is easier.

 
evillive:

The fact that it is not drawn correctly in that indicator, in the way it is represented now, the line through the indicator buffer will be drawn not on each H4, but on each bar of the TF, on which the indicator is running. To avoid it, you should either seriously modify the code or draw lines by objects, that is easier.

I do not insist, it is up to each his own. But the vertical markup and indicator line can well get along in one code.

The only thing that confuses me is that you have to do it completely to explain it. I will not help you with this on principle. That's why I gave up the tip.

 

The first anchor point is there, it was in principle.

How do I find the second anchor point?

   datetime t_Line = iTime(Symbol(),PERIOD_H4,i);         //--- В ПЕРЕМ t_Line Будет Присваиваться значение времени открытия бара
   CopyRates(_Symbol, PERIOD_H4, t_Line, 1, mqlRates);    //--- Структура для хранения информации 
   
   High_A = mqlRates[0].high; // глоб перем     Первая точка
   Time_A = t_Line;           // глоб перем
   
   High_B = mqlRates[0].high + mqlRates[0].high; // глоб перем      Вторая точка    (значение не правельное)
   Time_B = t_Line + t_Line;                      // глоб перем

    //+------------------------ Рисуем трендовые линии -----------------------------------------------------+                 
   ObjectCreate (Name_TLine + " TLine" + DoubleToStr(i,0),OBJ_TREND,0,Time_A,High_A,Time_B,High_B);         //--- Создаём обьект вертикальную линию
   ObjectSet    (Name_TLine + " TLine" + DoubleToStr(i,0),OBJPROP_STYLE,2);              //--- Со стилем
   ObjectSet    (Name_TLine + " TLine" + DoubleToStr(i,0),OBJPROP_COLOR,DimGray);        //--- Со цветом  
   ObjectSet    (Name_TLine + " TLine" + DoubleToStr(i,0),OBJPROP_WIDTH,0);              //--- С  толщиной
   ObjectSet    (Name_TLine + " TLine" + DoubleToStr(i,0),OBJPROP_BACK,0);               //--- С типом отображения. Объект на заднем плане
   ObjectSet    (Name_TLine + " TLine" + DoubleToStr(i,0),OBJPROP_RAY_RIGHT, false); 

 

In this variant the line is drawn as a whole, but in a straight line.

"And you want the end of the line to be tied to the next H4 candle's hai".

         ObjectCreate    (0,Name_Obj + " V_Line" + DoubleToStr(i,0), OBJ_TREND, 0, t_Line, mqlRates[0].high, t_Line,mqlRates[0].low);
 
AlexeyVik:

The only thing that embarrasses me is that you have to do the whole thing to explain it. I don't help on principle. That's why I've given up on the tips.

That's understandable, but how do you understand not asking for help? You don't have to write it all down.

And this communication "by the way" makes it easier to learn the language. For beginners, there are tasks which, without help, well, can't be solved.

 
AlexeyVik:

I don't insist, to each his own. But the vertical markup and the indicator line get along fine in the same code.


The question is how to understand this process. Besides, not all questions can be answered in the help.

 
Alex_Profit:


The question is how to understand this process. Besides, not all questions can be answered in the help.

I gave an example of a working script, we need to add arrows and trendlines to it, and re-do it for H4 instead of month. It is only necessary to move away from the indicator concept and look at the problem from a different angle.

I do not see the practical use of such a markup - it is a fence but what may be got from it?

 
evillive:

I don't see the practical benefit of such markings, so a fence, but what do you get out of it?

Everyone sees the fence differently.

"I look at the holes in the fence" figuratively speaking.

 
Alex_Profit:


The question is how to understand this process. The question is how to understand the process, and not all questions can be answered in the help.

Reading the help is what helps you learn the programming language. And then, if something in the help is not clear, you can ask questions.

How can you advise a person who has not read the documentation and has no idea where should be SetIndexStyle(0, DRAW_SECTION); and inserts it into OnCalculate with bewilderment?

Alex_Profit:

No change for some reason