Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 424

 
Hello, esteemed trader. Could you please tell me how I can replace the text from the Comment() function? I have Comment() in int init() and I want a different text to appear in int start(). Can I just call it again and give new parameters? In this case the old parameters will be erased? And I need this to work in mql 4 code.
 

The yellow line of the indicator is supposed to zigzag between the last four tops +100-100 MAX MIN respectively before the opening of a new bar

and end at High[0].

As I understand it, the DRAW_SECTION style connects non-zero values of the indicator buffer by segments. The result is a broken continuous line.

The Alert printout confirms that the correct non-zero values in ZigzagBuffer3 are present. It is by the values of this buffer that the

derived ZZ .

After the opening of a new bar the indicator will become a "gift" for freeloaders.

P.S. My terminal does not draw chunks of yellow line, which can be seen in VladislavVG pictures. The pill (cure) is an attempt to help the forum member

SPLXGF ( #property indicator_buffers 4 //changed from indicator_buffers 1.)

 

cm-MA 29.04.13.rar

Can anyone decompile and change some parameters a bit????

Files:
cm-max29f04n13.ex4  2478 kb
 
vitali-attila:
Hello, esteemed trader. Could you please tell me how to replace text from Comment() function ? I have Comment() in int init() and I want a different text to appear in int start(). Can I just call it again and give new parameters? In this case the old parameters will be erased? And I need this to work in mql 4 code.


The new text will erase the old text itself. Where necessary, feel free to put Comment(" New text ");

It's possible to write multiple lines: Comment("mas[00]= ",mas[0],"\n",

--- like ---

"mas[01]= ",mas[1]);

 
kosmos0975:

The yellow line of the indicator is supposed to zigzag between the last four tops +100-100 MAX MIN respectively before the opening of a new bar

and end at High[0].

As I understand it, the DRAW_SECTION style connects non-zero values of the indicator buffer by segments. The result is a broken continuous line.

The Alert printout confirms that the correct non-zero values in ZigzagBuffer3 are present. It is by the values of this buffer that the

derived ZZ .

After the opening of a new bar the indicator will become a "gift" for freeloaders.

P.S. My terminal does not draw chunks of yellow line, which can be seen in VladislavVG pictures. The pill (cure) is an attempt to help the forum member

SPLXGF ( #property indicator_buffers 4 //changed from indicator_buffers 1).

You are thinking in code cracker categories ))))))))))). You don't need any "cure" - you just need to specify correctly the number of buffers for display, which was advised to you: since you display the 4th buffer (numbering is the same as in C - from zero)

SetIndexBuffer(3,ZigzagBuffer3);

respectively there should be 4-th buffer, not less as in your code.

The indicator is built based on the values of buffer ZigzagBuffer3 - I showed you on the pictures.

 
Respect and respect to those who monitor the correctness of MT4.
It's people like you that I wanted to hear from.
Those who are interested can see what I wanted. Tomorrow will be different.
Files:
 

Thanks to everyone who helped solve the problem.

I will think about option 2. Maybe there won't be a problem now.

Attached a screenshot. I can't see it. I will try again. It's a loading error.

I'll get it next time.

 
kosmos0975:


Another time will do the trick.


It's a strange habit to put your trust in another time. Sometimes there may not be another time
 
Guys, I've encountered a strange problem. At this part of the code, the tester just hangs: no errors in the log, the processor is running at maximum, but the tester does nothing.
ticket = OrderSend(Symbol(),OP_SELL,FindRightLot(OP_BUY),Bid,Slippage,0,0,"",Magic,0,Red);
                  if (ticket>0)
                  CloseHalfOrders(OP_BUY);
                  ModifyOrders(OP_BUY);// зависает на этом моменте, после закрытия ордеров
                  ModifyOrders(OP_SELL);

///вот эта функция
void ModifyOrders(int otype) // усреднение профита всех ордеров сетки с выставлением тейк-профита
{
  double avgprice = 0,                      
         order_lots = 0;
         
         price = 0;
  for (int i = OrdersTotal()-1; i>=0; i--)
  {
    if (OrderSelect(i, SELECT_BY_POS,MODE_TRADES))
    {
       if (OrderSymbol()==Symbol() && OrderMagicNumber()==Magic && OrderType() == otype)
       {
          price +=OrderOpenPrice() * OrderLots();
          order_lots +=OrderLots(); 
       } 
    }
  }
  avgprice = NormalizeDouble (price / order_lots, Digits);
  if (otype == OP_BUY) TP = NormalizeDouble (avgprice + TakeProfit * Point,Digits);
  if (otype == OP_SELL) TP = NormalizeDouble (avgprice - TakeProfit * Point,Digits);
  
  
  for (i = OrdersTotal()-1; i>=0; i--)
  {
    if (OrderSelect(i, SELECT_BY_POS,MODE_TRADES))
    {
       if (OrderSymbol()==Symbol() && OrderMagicNumber()==Magic && OrderType() == otype)
       
         OrderModify(OrderTicket(), OrderOpenPrice(),0,TP,0);
       }
   }
  
}
 
where is the code ?
CloseHalfOrders ???
hangs on it, not in the modification
Reason: