[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 609

 
FAQ:


1) down_line+TimeToStr

2) " downline_"+TimeToStr

dellline(up_line, down_line );

That one's taken care of. Spos!
 
alsu:
I'm building everything on mingw under codeblocks just fine. What exactly is the problem?

I don't understand what the problem is. Can you give me an example of some kind of library...?

Checked for dependencies, re-keyed the code and everything. Still it swears it can't connect library (in "Experts" 126 gives error)...

 
//------ функция удаляющая ненужные линии

void dellline(string name_line_up,string name_line_down)
  {
   string name_l;
   int obj=ObjectsTotal(); // найдем количество объектов 
   for(int i=obj-1; i>=0; i--) // obj-1 т.к. >=0 ЗДЕСЬ >=N ПАРАМЕТРА ЗАДАННОГО ПОЛЬЗОВАТЕЛЕМ.
     {
      name_l=ObjectName(i); // узнаем имя
      if(ObjectType(name_l)!=OBJ_TREND)continue; // если не трендлиния продолжим цикл * for(int i=obj-1; i>=0; i--)
      if(StringFind(name_l,name_line_up)!=-1)ObjectDelete(name_l);
      if(StringFind(name_l,name_line_down)!=-1)ObjectDelete(name_l);
     }
   }
//+------------------------------------------------------------------+

It doesn't work. Maybe I didn't make myself clear, I need a user-defined number (N) of lines to remain on the chart.

In intermediate variants I can remove either bottom or top lines, but for some reason they are drawn and removed in an arbitrary number (2,3,7).

(2,3,7...) and secondly only individually, either delete the top and NOT drawn bottom, or vice versa. There is no problem with deleting lines from the graph

there is no problem with deinit.

 

There is still this question unanswered.

Thank you!

 
You enter the time in the line name - why ? add the number {line_up_1,line_dn_1, line_up_2, line_dn_2 ....} and draw only the number of lines you need, when you move in time they will move themselves to the new places and you will not have to delete anything.
 
Solree:

I don't understand what the problem is. Can you give me an example of a library...?

Checked for dependencies, re-keyed code and in general. Still it swears it can't link library (in "Experts" 126 gives error)...

That's it, got it figured out. It only sees the plugin library in the MT folder, the dependencies need to be in the system or PATH. Thank you all.
 

Please explain to me how to "pass parameters by reference" the built-in help gave just hints on how to use it but it's not very easy to understand...

void func(int& x, double& y, double& z[])
  {
   double calculated_tp;
   ...
   for(int i=0; i<OrdersTotal(); i++)
     {
      if(i==ArraySize(z))       break;
      if(OrderSelect(i)==false) break;
      z[i]=OrderOpenPrice();
     }
   x=i;
   y=calculated_tp;
  }
 
FAQ:
You enter the time in the line name - why ? add the number {line_up_1,line_dn_1, line_up_2, line_dn_2 ....} and draw only the number of lines you need, when you move in time they will move themselves to the new places and you will not have to delete anything.
Good idea! Thank you!
 
ruslanchik:

Please explain to me how to "pass parameters by reference" the built-in help gave just hints on how to use it but it's not very easy to understand...

int start()
{
    int a = 5;
    Alert(a); //Будет 5
    
    setNew(a);
    Alert(a); //Будет 10

    return;
}

void setNew(int &a)
{
    a = 10;
}
 
Solree:


what is the calculation ahead of a=5 or a=10 ?